:root {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: 40px;
    --liquid-gradient: linear-gradient(135deg, #00E5FF 0%, #7000FF 100%);
    --ios-safe-top: env(safe-area-inset-top, 20px);
    --ios-safe-bottom: env(safe-area-inset-bottom, 20px);
}

body {
    background: #04050a !important; /* Fondo base negro profundo */
    color: #f8fafc;
    position: relative;
    padding-top: var(--ios-safe-top);
    padding-bottom: var(--ios-safe-bottom);
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

/* Efecto Liquid en los fondos animados */
.bg-shapes .shape {
    position: absolute;
    z-index: 0; /* Las formas flotan sobre el fondo del body pero bajo el contenido */
    filter: blur(120px);
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: liquidMove 15s infinite alternate ease-in-out;
    pointer-events: none;
}

.shape-1 { background: #00E5FF; width: 40vw; height: 40vw; top: -10%; left: -10%; }
.shape-2 { background: #7000FF; width: 50vw; height: 50vw; bottom: -10%; right: -10%; animation-delay: -5s; }
.shape-3 { background: #FF00A0; width: 30vw; height: 30vw; top: 40%; left: 30%; animation-delay: -10s; }

@keyframes liquidMove {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(5%, 10%) scale(1.1) rotate(10deg); }
    100% { transform: translate(-5%, 5%) scale(1) rotate(-10deg); }
}

/* Paneles Liquid Glass */
.glass-panel, .modal-content, .bento-card, .metric-card {
    /* Cristal más translúcido para ver el fondo líquido */
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%), 
                rgba(10, 14, 30, 0.3) !important; 
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 32px !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 229, 255, 0.1);
}

/* Botones estilo iOS26 */
.btn-primary {
    background: var(--liquid-gradient) !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 14px 24px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3) !important;
    color: white !important;
    min-height: 48px; /* Touch target optimizado para móvil */
}

.btn-primary:active {
    transform: scale(0.96);
}

/* Sidebar adaptada a App Híbrida */
@media (min-width: 981px) {
    .sidebar {
        border-radius: 0 32px 32px 0 !important;
        margin-left: 0;
        height: 100vh !important;
        position: sticky;
        top: 0;
    }
}


/* Dashboard Bento Grid Moderno */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.bento-card {
    padding: 20px !important;
    text-align: center;
}

.bento-value {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
    font-family: 'Outfit', sans-serif;
    background: var(--liquid-gradient);
    -webkit-background-clip: text;
    background-clip: text; /* Añadido para compatibilidad con navegadores no-webkit */
    -webkit-text-fill-color: transparent;
}

/* Refinar Sidebar para el look moderno */
.sidebar {
    background: rgba(8, 12, 25, 0.4) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--glass-border) !important;
}

/* Inputs Modernos */
input, select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    color: white !important;
    padding: 12px !important;
    width: 100%;
    font-size: 16px; /* Evita zoom automático en iOS */
    min-height: 52px; /* Área de toque cómoda para escribir */
}

/* Botones Premium y Teasers de Progresión */
.btn-premium-upgrade {
    background: linear-gradient(135deg, #FFB800 0%, #FF8A00 100%) !important;
    color: #04050a !important; /* Negro sobre oro para legibilidad crítica y contraste WCAG */
    border: none !important;
    border-radius: 16px !important;
    padding: 12px 24px !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(255, 184, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.btn-premium-upgrade:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 30px rgba(255, 184, 0, 0.4);
}

.projection-teaser {
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* Estilos para el selector de emojis del Check-in */
.emoji-selector {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
}

.emoji-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 2rem;
    padding: 10px !important;
    border-radius: 16px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Forzar stack de fuentes nativas de emoji para evitar interferencias de fuentes de iconos */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para el listado de opciones bento en check-in */
.checkin-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
}

.checkin-option-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 16px 20px !important;
    border-radius: 18px !important;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(5px);
}

.checkin-option-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(4px);
    border-color: var(--brand-primary) !important;
}

.checkin-option-btn:active {
    transform: scale(0.98);
}

.emoji-btn:hover { transform: scale(1.25); background: rgba(255,255,255,0.05) !important; }
.emoji-btn:active { transform: scale(0.9); }

/* Botones de opción con texto para el Check-in Bi-modal */
.checkin-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.checkin-option-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 14px 20px !important;
    border-radius: 16px !important;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkin-option-btn {
    display: flex !important;
    align-items: center;
    gap: 12px;
}
.checkin-emoji {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
    margin-right: 12px;
}

.checkin-option-btn:hover { background: rgba(255, 255, 255, 0.12) !important; transform: translateX(5px); }
.checkin-option-btn:active { transform: scale(0.98); }

.projection-teaser p {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.95rem;
    max-width: 320px;
    line-height: 1.6;
    margin: 0;
}

/* Ajuste específico para grupos de campos (como el tiempo: mm:ss:cc) */
.form-grid-6 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
}

@media (min-width: 600px) {
    .form-grid-6 { grid-template-columns: repeat(2, 1fr); }
    .full-width { grid-column: span 2; }
}

.projection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

.badge-premium {
    background: linear-gradient(135deg, #FFB800, #FF8A00) !important;
    color: #04050a !important;
    padding: 4px 12px !important;
    border-radius: 100px !important;
    font-size: 0.65rem !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.time-unit-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

.form-time-group {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.form-time-group input {
    text-align: center;
    flex: 1;
    width: 0 !important; /* Permite que flex controle el ancho sin desbordar */
    min-width: 50px;
}

/* Banner de Cookies estilo Liquid Glass */
.cookie-banner {
    z-index: 3000 !important; /* Por encima de modales (1200) y cualquier otro elemento */
    background: rgba(10, 14, 30, 0.4) !important;
    backdrop-filter: blur(var(--glass-blur)) saturate(180%) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%) !important;
    border-top: 1px solid var(--glass-border) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    padding-bottom: calc(16px + var(--ios-safe-bottom)) !important;
}

.cookie-content p {
    color: var(--text-main) !important;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

/* Tarjetas de compartición social 1:1 */
.record-share-container,
.story-card-container {
    position: fixed;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(0.4); 
    z-index: 9999;
    display: none; /* Oculto por defecto */
    pointer-events: all;
}

.record-share-container:not(.hidden),
.story-card-container:not(.hidden) {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 0 100px rgba(0,229,255,0.5);
    border: 5px solid var(--brand-primary);
    z-index: 9999;
}

@media (max-height: 1000px) {
    .story-card-container {
        transform: translate(-50%, -50%) scale(0.35);
    }
}
@media (max-height: 850px) {
    .story-card-container {
        transform: translate(-50%, -50%) scale(0.3);
    }
}
@media (max-height: 700px) {
    .story-card-container {
        transform: translate(-50%, -50%) scale(0.25);
    }
}

.modal-actions-float {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(10, 14, 30, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: all;
    z-index: 10001;
}

.modal-actions-float button {
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-actions-float button:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

/* Overlay para oscurecer el fondo cuando se muestran estas tarjetas */
.modal-backdrop-story {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 9998;
    display: none;
}

.modal-backdrop-story.active {
    display: block;
}

.record-card.aspect-1to1 {
    width: 1000px;
    height: 1000px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px;
    text-align: center;
    border-radius: 60px !important;
    background: #070B19 !important;
}

.card-logo {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 60px;
}

.card-main-stat {
    font-size: 10rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    background: var(--liquid-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.phone-container {
    width: 1080px;
    height: 1920px;
    padding: 100px 60px;
    background: radial-gradient(at 0% 0%, hsla(213, 100%, 15%, 1) 0, transparent 50%), 
                radial-gradient(at 100% 0%, hsla(260, 100%, 15%, 1) 0, transparent 50%), 
                radial-gradient(at 50% 50%, hsla(220, 30%, 5%, 1) 0, transparent 100%), 
                radial-gradient(at 0% 100%, hsla(200, 100%, 10%, 1) 0, transparent 50%), 
                radial-gradient(at 100% 100%, hsla(280, 100%, 10%, 1) 0, transparent 50%);
    background-color: #0c0e17;
    display: flex;
    flex-direction: column;
}

.story-header-stitch { text-align: center; margin-bottom: 80px; }
.story-logo { width: 140px; height: 140px; margin-bottom: 40px; border-radius: 30px; }
.story-eyebrow { font-family: 'Inter', sans-serif; font-size: 24px; font-weight: 900; letter-spacing: 0.4em; color: #57bcff; text-transform: uppercase; margin-bottom: 20px; display: block; }
.story-title-stitch { font-family: 'Space Grotesk', sans-serif; font-size: 110px; font-weight: 900; line-height: 0.9; text-transform: uppercase; }
.gradient-text-stitch { background: linear-gradient(90deg, #57bcff, #81ecff, #a68cff); -webkit-background-clip: text; background-clip: text; color: transparent; }

.glass-card-stitch {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    padding: 60px;
    margin-bottom: 40px;
    position: relative;
}

.label-stitch { font-family: 'Inter', sans-serif; font-size: 24px; font-weight: 800; color: #aaaab7; text-transform: uppercase; margin-bottom: 20px; }
.main-stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 140px; font-weight: 900; text-shadow: 0 0 40px rgba(87, 188, 255, 0.3); }
.main-stat-unit { font-size: 40px; color: #57bcff; font-weight: 700; margin-left: 10px; }

.progress-container-stitch { margin-top: 40px; }
.progress-header-stitch { display: flex; justify-content: space-between; font-size: 22px; font-weight: 800; color: #aaaab7; margin-bottom: 15px; }
.progress-bar-stitch { height: 14px; background: rgba(255, 255, 255, 0.05); border-radius: 7px; overflow: hidden; }
.progress-fill-stitch { height: 100%; width: 94%; background: linear-gradient(90deg, #57bcff, #a68cff); }

.stats-grid-stitch { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.grid-card-stitch {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start; /* Alinea el contenido a la izquierda */
    padding: 50px;
    margin-bottom: 0;
    text-align: left; /* Asegura que el texto dentro esté alineado a la izquierda */
}
.icon-box-stitch { width: 100px; height: 100px; border-radius: 30px; display: flex; align-items: center; justify-content: center; }
.icon-box-stitch span { 
    font-family: 'Material Symbols Outlined' !important; 
    font-size: 50px; 
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}
.icon-purple { background: rgba(166, 140, 255, 0.15); color: #a68cff; }
.icon-cyan { background: rgba(0, 212, 236, 0.15); color: #81ecff; }
.grid-val { font-family: 'Space Grotesk', sans-serif; font-size: 80px; font-weight: 900; display: block; width: 100%; box-sizing: border-box; text-align: left; }
.grid-label { font-size: 22px; font-weight: 800; color: #aaaab7; text-transform: uppercase; display: block; width: 100%; box-sizing: border-box; text-align: left; overflow-wrap: break-word; }

.mood-card-stitch {
    background: linear-gradient(90deg, rgba(87, 188, 255, 0.3), rgba(166, 140, 255, 0.3));
    padding: 3px;
    border-radius: 60px;
}

.mood-inner-stitch {
    background: #0c0e17;
    border-radius: 57px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mood-info-stitch { display: flex; align-items: center; gap: 40px; }
.mood-emoji { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, #57bcff, #a68cff); display: flex; align-items: center; justify-content: center; font-size: 60px; }
.mood-title-stitch { font-family: 'Space Grotesk', sans-serif; font-size: 50px; font-weight: 900; text-transform: uppercase; }

.footer-stitch { margin-top: auto; text-align: center; display: flex; flex-direction: column; gap: 40px; }
.cta-label-stitch { font-size: 24px; font-weight: 900; color: rgba(255,255,255,0.4); letter-spacing: 0.3em; text-transform: uppercase; }
.url-stitch { font-family: 'Space Grotesk', sans-serif; font-size: 40px; font-weight: 800; }

.share-tag-stitch {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 20px 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    margin: 0 auto;
}

.pulse-dot-stitch { width: 12px; height: 12px; border-radius: 50%; background: #57bcff; }
.share-text-stitch { font-size: 20px; font-weight: 800; color: #aaaab7; text-transform: uppercase; }

.bg-icon-stitch { 
    font-family: 'Material Symbols Outlined' !important;
    position: absolute; 
    top: 30px; 
    right: 30px; 
    font-size: 140px; 
    opacity: 0.05; 
}

/* -- Corrección de z-index y Animación para Upsell -- */
.modal-overlay {
    z-index: 10000 !important;
}

.upsell-modal-overlay {
    z-index: 10001 !important; /* Un paso por encima del overlay base si fuera necesario */
}

@keyframes hfFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.upsell-panel { animation: hfFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }