/* ============================================================
   Smart Derivador — Página Pública
   Diseño Liquid Glass / Glassmorphism
   Compatible: Chrome 76+, Safari 9+, Firefox 103+
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --theme-color:     #1a1a2e;
    --glass-bg:        rgba(255, 255, 255, 0.10);
    --glass-border:    rgba(255, 255, 255, 0.18);
    --glass-shadow:    rgba(0, 0, 0, 0.25);
    --glass-highlight: rgba(255, 255, 255, 0.28);
    --text-primary:    #ffffff;
    --text-secondary:  rgba(255, 255, 255, 0.75);
    --blur-amount:     20px;
    --radius-card:     22px;
    --radius-btn:      16px;
    --transition:      0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---------- Background ---------- */
body {
    min-height: 100vh;
    background-color: var(--theme-color);
    position: relative;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(0,0,0,0.35) 0%,
        rgba(0,0,0,0.20) 50%,
        rgba(0,0,0,0.45) 100%
    );
}

/* Fondo por defecto (sin banner) */
.bg-layer.no-banner {
    background: linear-gradient(
        135deg,
        #1a1a2e 0%,
        #16213e 40%,
        #0f3460 100%
    );
}

/* ---------- Layout Principal ---------- */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ---------- Contenedor Glass Principal ---------- */
.glass-container {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-card);
    position: relative;
    overflow: hidden;
}

@supports (backdrop-filter: blur(1px)) {
    .glass-container {
        background: var(--glass-bg);
        backdrop-filter: blur(var(--blur-amount)) saturate(180%);
        -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
        border: 1px solid var(--glass-border);
        box-shadow:
            0 8px 40px var(--glass-shadow),
            inset 0 1px 0 var(--glass-highlight),
            inset 0 -1px 0 rgba(0,0,0,0.12);
    }
}

/* Fallback sin backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
    .glass-container {
        background: rgba(20, 20, 40, 0.80);
        border: 1px solid rgba(255,255,255,0.12);
        box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    }
}

/* Efecto de luz interna (liquid glass highlight) */
.glass-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.4) 30%,
        rgba(255,255,255,0.6) 50%,
        rgba(255,255,255,0.4) 70%,
        transparent
    );
    pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
    text-align: center;
    margin-bottom: 2rem;
}

.site-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.site-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 50%;
    /* Mezcla el fondo blanco del logo con el fondo glassmorphism */
    mix-blend-mode: multiply;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.25));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.site-logo:hover {
    transform: scale(1.04) rotate(-2deg);
}

.site-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* ---------- Grid de Botones ---------- */
.buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

/* ---------- Botón Individual ---------- */
.action-btn {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-btn);
    text-decoration: none;
    cursor: pointer;
    border: none;
    width: 100%;
    background: var(--btn-color, rgba(255,255,255,0.12));
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

@supports (backdrop-filter: blur(1px)) {
    .action-btn {
        backdrop-filter: blur(12px) saturate(160%);
        -webkit-backdrop-filter: blur(12px) saturate(160%);
        border: 1px solid rgba(255,255,255,0.2);
        box-shadow:
            0 4px 16px rgba(0,0,0,0.2),
            inset 0 1px 0 rgba(255,255,255,0.25),
            inset 0 -1px 0 rgba(0,0,0,0.08);
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .action-btn {
        border: 1px solid rgba(255,255,255,0.15);
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    }
}

/* Highlight superior en botones */
.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    pointer-events: none;
}

/* Hover */
.action-btn:hover {
    transform: translateY(-2px) scale(1.012);
    box-shadow:
        0 8px 28px rgba(0,0,0,0.28),
        inset 0 1px 0 rgba(255,255,255,0.3);
    filter: brightness(1.08);
}

/* Active */
.action-btn:active {
    transform: translateY(0) scale(0.98);
    filter: brightness(0.95);
}

/* Ícono del botón */
.btn-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    color: rgba(255,255,255,0.92);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.btn-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Texto del botón */
.btn-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.01em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    flex: 1;
}

/* Flecha derecha */
.btn-arrow {
    color: rgba(255,255,255,0.5);
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    transition: transform var(--transition), color 0.2s;
}

.action-btn:hover .btn-arrow {
    color: rgba(255,255,255,0.85);
    transform: translateX(3px);
}

/* ---------- Estado vacío ---------- */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---------- Responsive: Desktop ---------- */
@media (min-width: 640px) {
    .glass-container {
        padding: 3rem 2.5rem;
    }
    .buttons-grid {
        grid-template-columns: 1fr 1fr;
    }
    .site-name {
        font-size: 2.25rem;
    }
}

/* ---------- Responsive: Large Desktop ---------- */
@media (min-width: 1024px) {
    .glass-container {
        max-width: 600px;
    }
}

/* ---------- Animación de entrada ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-container {
    animation: fadeInUp 0.5s ease-out both;
}

.action-btn {
    animation: fadeInUp 0.4s ease-out both;
}

.action-btn:nth-child(1)  { animation-delay: 0.05s; }
.action-btn:nth-child(2)  { animation-delay: 0.10s; }
.action-btn:nth-child(3)  { animation-delay: 0.15s; }
.action-btn:nth-child(4)  { animation-delay: 0.20s; }
.action-btn:nth-child(5)  { animation-delay: 0.25s; }
.action-btn:nth-child(6)  { animation-delay: 0.30s; }
.action-btn:nth-child(7)  { animation-delay: 0.35s; }
.action-btn:nth-child(8)  { animation-delay: 0.40s; }

/* ---------- Reducir movimiento (accesibilidad) ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
