/* ==========================================================================
   1. VARIABLES, FUENTES Y RESET
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --font-heading: 'Helvetica Now Display Bold', sans-serif;
    --font-body: 'Inter', sans-serif;
    --color-text: #192837;
    --color-accent: #7342E2;
    --color-login-bg: #F2F2EE;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-login-bg);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fondo de Vídeo Principal */
.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* ==========================================================================
   2. CABECERA (NAVBAR)
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100; /* Asegura que se sitúe por encima del contenido al hacer scroll */
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(242, 242, 238, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(25, 40, 55, 0.05);
}

@media (min-width: 640px) {
    .navbar { padding: 1.25rem 2rem; }
}

.logo {
    display: flex;
    align-items: center;
}

.nav-desktop {
    display: none;
    gap: 2rem;
    align-items: center;
}

.nav-desktop a {
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: opacity 0.2s ease;
}

.nav-desktop a:hover { 
    opacity: 0.7; 
}

.auth-buttons-desktop {
    display: none;
    gap: 0.75rem;
    align-items: center;
}

@media (min-width: 768px) {
    .nav-desktop, .auth-buttons-desktop { display: flex; }
    .btn-menu-mobile { display: none; }
}

/* ==========================================================================
   3. BOTONES COMPARTIDOS
   ========================================================================== */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-signin {
    background-color: #F2F2EE;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
}
.btn-signin:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.btn-signin:active { transform: scale(0.95); }

.btn-start {
    background-color: var(--color-accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
}
.btn-start:hover { box-shadow: 0 10px 15px -3px rgba(115, 66, 226, 0.3); }
.btn-start:active { transform: scale(0.95); }

.btn-menu-mobile {
    background: transparent;
    color: var(--color-text);
    padding: 0.25rem;
    z-index: 50;
}

.w-full {
    width: 100%;
}

/* ==========================================================================
   4. SECCIÓN HERO (ZONA PRINCIPAL)
   ========================================================================== */
.hero-container {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(40px, 8vw, 72px) 1.25rem 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.hero-content {
    max-width: 660px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.65rem, 5vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.nowrap { 
    white-space: nowrap; 
}

.inline-icon {
    display: inline;
    vertical-align: middle;
    position: relative;
    top: -2px;
    margin: 0 4px;
}
.inline-icon.fingerprint { margin-left: 6px; }

p {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.65;
    color: var(--color-text);
    opacity: 0.8;
    max-width: 560px;
    margin-bottom: 2.5rem;
}

.btn-cta {
    background-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
    border-radius: 50px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    padding: 17px 24px;
    min-width: 210px;
    box-shadow: 0 4px 24px rgba(115, 66, 226, 0.28);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.btn-cta:hover { transform: scale(1.04); filter: brightness(1.1); }
.btn-cta:active { transform: scale(0.96); }

/* ==========================================================================
   5. SECCIONES DE CONTENIDO ADICIONAL
   ========================================================================== */
.content-section {
    position: relative;
    z-index: 10;
    padding: 6rem 1.25rem;
    width: 100%;
    scroll-margin-top: 90px; /* Margen para que no quede oculto detrás del menú sticky */
}

.bg-alt {
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.section-container h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.section-container p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 auto 3rem;
    max-width: 700px;
    color: var(--color-text);
    opacity: 0.8;
}

/* Grid de Bloques de Beneficios */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
}

@media (min-width: 768px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Formulario del Bloque de Ayuda */
.contact-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(25, 40, 55, 0.15);
    border-radius: 0.75rem;
    font-family: var(--font-body);
    font-size: 1rem;
    background: #fff;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(115, 66, 226, 0.1);
}

.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.98); }

/* ==========================================================================
   6. MENÚ LATERAL MÓVIL (SLIDE SHEET)
   ========================================================================== */
.mobile-menu-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 999; /* Máxima prioridad sobre cualquier otra capa */
    pointer-events: none;
    visibility: hidden;
}
.mobile-menu-wrapper.active {
    pointer-events: auto;
    visibility: visible;
}

.menu-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(25, 40, 55, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-menu-wrapper.active .menu-backdrop { opacity: 1; }

.menu-sheet {
    position: absolute;
    top: 0; right: 0;
    width: min(88vw, 360px);
    height: 100dvh;
    background-color: #CFC8C5;
    box-shadow: -12px 0 48px rgba(25, 40, 55, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu-wrapper.active .menu-sheet {
    transform: translateX(0);
}
.mobile-menu-wrapper.closing .menu-sheet {
    transition: transform 0.35s cubic-bezier(0.55, 0, 1, 0.45);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
}

.btn-close {
    width: 40px; height: 40px;
    border-radius: 50%;
    background-color: rgba(25, 40, 55, 0.1);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-close:active { transform: scale(0.9); }

.menu-divider {
    height: 1px;
    background-color: rgba(25, 40, 55, 0.12);
    margin: 0 24px;
}

.nav-mobile {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem 0;
    gap: 0.5rem;
}

.nav-mobile a {
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s;
    opacity: 0;
    transform: translateX(24px);
}
.nav-mobile a:hover { background-color: rgba(0, 0, 0, 0.1); }

.mobile-menu-wrapper.active .nav-mobile a {
    animation: slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(0.18s + (var(--i) * 0.07s));
}

@keyframes slideInRight {
    to { opacity: 1; transform: translateX(0); }
}

.auth-buttons-mobile {
    margin-top: auto;
    padding: 1.5rem;
}

/* ==========================================================================
   7. SISTEMA DE ANIMACIONES (INTERSECTION OBSERVER Y FADE-UP)
   ========================================================================== */
.animate-fade-up {
    opacity: 0;
    transform: translateY(28px);
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--delay);
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
/* ==========================================================================
   8. SECCIÓN LEGAL (CUSTOM)
   ========================================================================== */
.legal-wrapper {
    background-color: #0B0F19 !important;
    padding: 3rem 1.5rem !important;
    width: 100%;
}

.legal-box {
    max-width: 900px;
    margin: 0 auto;
    background-color: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 1rem !important;
    padding: 1.25rem 1.5rem !important;
}

.legal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15) !important;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.legal-title {
    color: #f1f5f9 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

.legal-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .legal-content { grid-template-columns: 1fr 1fr; }
}

.legal-content p {
    font-size: 9px !important;
    color: #94a3b8 !important;
    line-height: 1.5 !important;
    text-align: justify;
    margin: 0 !important;
}

.legal-content strong {
    color: #ffffff !important;
}
 /* VARIABLES Y UTILIDADES GLOBALES */
    :root {
        --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
        --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    }

    body {
        overflow-x: hidden;
        background-color: #FAFAFC;
    }

    /* RUIDO Y GRID PREMIUM */
    .bg-noise {
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 50;
        opacity: 0.035;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    }

    .bg-grid {
        position: absolute;
        inset: 0;
        background-image: 
            linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
        background-size: 40px 40px;
        mask-image: radial-gradient(circle at center, black, transparent 80%);
        pointer-events: none;
        z-index: 0;
    }

    /* ANIMACIONES DE BLOBS */
    @keyframes blob-spin {
        0% { transform: rotate(0deg) scale(1); }
        50% { transform: rotate(180deg) scale(1.1); }
        100% { transform: rotate(360deg) scale(1); }
    }
    .blob-animated {
        animation: blob-spin 20s linear infinite;
        will-change: transform;
    }

    /* ANIMACIONES 3D (SHARDS Y ELEMENTOS) */
    @keyframes float-shard-1 {
        0%, 100% { transform: translateY(0) rotate3d(1, 1, 1, 0deg); }
        50% { transform: translateY(-20px) rotate3d(1, 1, 1, 10deg); }
    }
    @keyframes float-shard-2 {
        0%, 100% { transform: translateY(0) rotate3d(-1, 1, 0, 0deg); }
        50% { transform: translateY(25px) rotate3d(-1, 1, 0, -15deg); }
    }
    @keyframes float-shard-3 {
        0%, 100% { transform: scale(1) translate3d(0,0,0); }
        50% { transform: scale(1.05) translate3d(-10px, -15px, 20px); }
    }
    .animate-shard-1 { animation: float-shard-1 7s ease-in-out infinite; will-change: transform; }
    .animate-shard-2 { animation: float-shard-2 9s ease-in-out infinite; will-change: transform; }
    .animate-shard-3 { animation: float-shard-3 8s ease-in-out infinite; will-change: transform; }

    /* REVEAL ON SCROLL */
    .reveal-item {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(8px);
        transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo), filter 0.8s var(--ease-out-expo);
        will-change: opacity, transform, filter;
    }
    .reveal-item.is-visible {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }

    /* TEXT REVEAL PARA EL HERO */
    .word {
        display: inline-block;
        opacity: 0;
        transform: translateY(20px);
        filter: blur(8px);
        transition: all 0.8s cubic-bezier(0.2, 0, 0, 1);
        will-change: transform, opacity, filter;
    }
    .word.is-visible {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }

    /* BOTONES PREMIUM */
    .btn-premium {
        transition: all 0.4s var(--ease-spring);
        position: relative;
        overflow: hidden;
    }
    .btn-premium::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transform: translateX(-100%);
        transition: transform 0.6s ease;
    }
    .btn-premium:hover::after {
        transform: translateX(100%);
    }
    .btn-premium:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 15px 30px -5px rgba(139, 92, 246, 0.4), 0 0 15px rgba(6, 182, 212, 0.3);
    }
    .btn-premium:active {
        transform: translateY(1px) scale(0.98);
    }

    /* TILT 3D EFECTOS */
    .tilt-wrapper {
        perspective: 1200px;
        transform-style: preserve-3d;
    }
    .tilt-element {
        transition: transform 0.1s ease-out;
        will-change: transform;
        transform-style: preserve-3d;
    }
    .glare {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2), transparent 60%);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 50;
        mix-blend-mode: overlay;
    }
    .tilt-wrapper:hover .glare {
        opacity: 1;
    }
/* ========================================================================== 
   FASE 3 - Ajustes responsive y accesibilidad móvil
   ========================================================================== */
@media (max-width: 639px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    main { min-width: 0; }
    input, select, textarea, button { max-width: 100%; }
    .tilt-wrapper { perspective: none; }
    .tilt-element { transform: none !important; }
    .glare { display: none; }
    .btn-premium:hover { transform: none; }
    .reveal-item { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


@media (hover: none), (pointer: coarse) {
    .tilt-wrapper { perspective: none; }
    .tilt-element { transform: none !important; }
    .glare { display: none !important; }
    .btn-premium:hover { transform: none; }
}

img, video, canvas { max-width: 100%; height: auto; }


/* ==========================================================================
   12. AJUSTES DE RENDIMIENTO Y FLUIDEZ
   ========================================================================== */
html.modal-open,
body.modal-open {
    overflow: hidden;
}

img, svg, video {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@media (max-width: 768px) {
    html {
        scroll-behavior: auto;
    }

    /* IMPORTANTE: no usar selectores globales como [class*="blur-"] aquí.
       También coinciden con backdrop-blur-* y terminan desenfocando cabeceras,
       píldoras y menús completos en móvil. */
    .navbar {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Cabecera de la aplicación: reglas explícitas y estables en móvil. */
.shardia-header-shell {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transform: translateZ(0);
    isolation: isolate;
}

.shardia-kicker {
    background: rgba(241, 245, 249, .96) !important;
    border-color: #dbe3ee !important;
    color: #64748b !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    opacity: 1 !important;
}

@media (max-width: 639px) {
    .shardia-header-shell {
        position: sticky !important;
        position: -webkit-sticky !important;
        top: 0 !important;
        left: 0;
        right: 0;
        z-index: 1000 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        filter: none !important;
        background: rgba(250, 250, 252, .98) !important;
        border-bottom: 1px solid rgba(226, 232, 240, .95) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        backdrop-filter: blur(10px) !important;
    }

    .shardia-header-shell header {
        min-height: 64px !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        gap: 8px !important;
    }

    .shardia-header-shell a,
    .shardia-header-shell button,
    .shardia-header-shell svg,
    .shardia-header-shell span,
    .shardia-header-shell div {
        filter: none;
    }

    /* Asegura que los botones táctiles sigan siendo visibles aunque el viewport sea estrecho. */
    .shardia-mobile-action {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .shardia-kicker {
        font-size: 10px !important;
        line-height: 1 !important;
        padding: 6px 10px !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .05) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.12s !important;
        scroll-behavior: auto !important;
    }
}


/* Mensajes contextuales: aparecen brevemente y no desplazan la navegación */
.js-flash-message {
    opacity: 1;
    transform: translateY(0);
    max-height: 220px;
    overflow: hidden;
    transition: opacity .22s ease, transform .22s ease, max-height .26s ease, margin .26s ease, padding .26s ease, border-width .26s ease;
}

.js-flash-message.flash-leaving {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
}


/* Modal surfaces: the panel owns the radius and clips header/footer backgrounds. */
[role="dialog"],
.shardia-modal-surface {
    background-clip: padding-box;
}

/* ==========================================================================
   14. APP BAR RESPONSIVE: MOBILE/TABLET Y DESKTOP SEPARADOS
   ========================================================================== */
.shardia-appbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    width: 100%;
    background: rgba(250, 250, 252, .92);
    border-bottom: 1px solid rgba(226, 232, 240, .72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding-top: env(safe-area-inset-top);
}

.shardia-desktopbar {
    min-height: 76px;
}

.shardia-mobilebar {
    height: 66px;
    min-height: 66px;
    align-items: center;
}

.shardia-mobile-navbtn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .06);
    transition: border-color .18s ease, color .18s ease, background-color .18s ease, transform .18s ease;
}

.shardia-mobile-navbtn:active {
    transform: scale(.96);
}

.shardia-mobile-logout {
    color: #ef4444;
    background: #fff7f7;
    border-color: #fee2e2;
}

.shardia-mobile-login,
.shardia-mobile-register {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.shardia-mobile-login {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
}
.shardia-mobile-register {
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    color: #fff;
    box-shadow: 0 6px 18px rgba(139, 92, 246, .18);
}

.shardia-notification-panel {
    top: calc(env(safe-area-inset-top) + 82px);
    right: max(20px, calc((100vw - 1280px) / 2 + 24px));
    width: min(340px, calc(100vw - 32px));
}

@media (max-width: 1023px) {
    .shardia-appbar {
        background: rgba(250, 250, 252, .88);
        border-bottom: 1px solid rgba(226, 232, 240, .38) !important;
        box-shadow: 0 8px 26px rgba(15, 23, 42, .045);
        -webkit-backdrop-filter: saturate(135%) blur(12px);
        backdrop-filter: saturate(135%) blur(12px);
        transform: translate3d(0, 0, 0);
        transition: transform .22s cubic-bezier(.22,.61,.36,1), background-color .2s ease, box-shadow .2s ease;
        will-change: transform;
    }

    .shardia-appbar.shardia-appbar--hidden {
        transform: translate3d(0, calc(-100% - env(safe-area-inset-top)), 0);
        box-shadow: none;
    }

    .shardia-mobilebar {
        height: 66px !important;
        min-height: 66px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .shardia-notification-panel {
        position: fixed;
        top: calc(env(safe-area-inset-top) + 76px);
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 420px) {
    .shardia-mobilebar {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .shardia-mobile-navbtn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 13px;
    }
}


@media (max-width: 1023px) {
    .shardia-mobilebar > a,
    .shardia-mobilebar > nav {
        align-self: stretch;
        display: flex;
        align-items: center;
    }
}


/* ==========================================================================
   15. NAVEGACIÓN DUAL Y AJUSTES PARA PANTALLAS MUY ESTRECHAS
   ========================================================================== */
.shardia-mobile-navbtn[aria-current="page"][href="dashboard"] {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.shardia-mobile-navbtn[aria-current="page"][href="perfil"] {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    border-color: transparent;
    color: #fff;
}

@media (max-width: 370px) {
    .shardia-mobilebar {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .shardia-mobilebar > a {
        gap: 0 !important;
    }

    .shardia-mobilebar > a > div:last-child {
        display: none;
    }

    .shardia-mobile-navbtn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        border-radius: 12px;
    }

    .shardia-mobilebar nav {
        gap: 5px !important;
    }
}

/* ========================================================================== 
   16. FASE 4.1 · NOTIFICACIONES FLOTANTES EN MÓVIL
   ========================================================================== */
.shardia-mobile-notif-fab {
    display: none;
}

@media (max-width: 1023px) {
    .shardia-mobile-notif-fab {
        position: fixed;
        right: max(16px, env(safe-area-inset-right));
        bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
        z-index: 1180;
        width: 52px;
        height: 52px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
        background: #0f172a;
        color: #fff;
        border: 1px solid rgba(255,255,255,.12);
        box-shadow: 0 14px 34px rgba(15,23,42,.24);
        transition: transform .18s ease, box-shadow .18s ease;
    }
    .shardia-mobile-notif-fab:active {
        transform: scale(.95);
    }
    .shardia-notification-panel {
        top: auto;
        bottom: max(82px, calc(env(safe-area-inset-bottom) + 76px));
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        max-height: min(62vh, 28rem);
    }
}

/* ========================================================================== 
   17. HOME · VOLVER ARRIBA
   ========================================================================== */
.shardia-back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1160;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    color: #0f172a;
    box-shadow: 0 12px 30px rgba(15,23,42,.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, 10px, 0);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.shardia-back-to-top--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
}
.shardia-back-to-top:active {
    transform: scale(.96);
}
@media (max-width: 1023px) {
    .shardia-back-to-top {
        right: 18px;
        bottom: calc(env(safe-area-inset-bottom) + 82px);
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }
}
