/* =========================================================================
   vAdvent — Stylesheet
   3 Themes: Romantic, Cozy, Minimal
   Mobile-first & PWA Ready
   ========================================================================= */

:root, [data-theme="romantic"] {
    color-scheme: dark;
    --bg-main: #14080e;
    --bg-gradient: radial-gradient(circle at 50% 25%, #2d0f1c 0%, #170710 65%, #090206 100%);
    --surface: rgba(45, 16, 28, 0.78);
    --surface-solid: #260e19;
    --door-bg: linear-gradient(145deg, #381322, #210a14);
    --door-open-bg: rgba(18, 5, 11, 0.94);
    --border: rgba(244, 180, 110, 0.25);
    --border-hover: rgba(244, 180, 110, 0.6);
    --accent: #f5b971;
    --accent-hover: #ffd299;
    --accent-2: #e11d48;
    --text: #fdf2f8;
    --text-muted: #d4a7b7;
    --btn-text: #1a0710;
    --card-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
    --font-title: 'Instrument Serif', 'Playfair Display', Georgia, serif;

    /* Variables Analógicas de Cartón / Papel Físico */
    --cardboard-bg: #270c18;
    --cardboard-border: #b8864a;
    --cardboard-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(245, 185, 113, 0.35);
    --cardboard-text: #fae8d2;
    --cavity-bg: #12040b;
    --cavity-shadow: inset 3px 4px 10px rgba(0,0,0,0.85), inset -1px -1px 3px rgba(245, 185, 113, 0.15);
    --flap-bg: linear-gradient(150deg, #3d1528 0%, #280a18 100%);
    --flap-border: rgba(212, 163, 89, 0.45);
    --flap-number: #f7c873;
    --perforation-line: rgba(247, 200, 115, 0.42);
    --notch-bg: rgba(0, 0, 0, 0.55);
}

[data-theme="cozy"] {
    color-scheme: dark;
    --bg-main: #180f09;
    --bg-gradient: radial-gradient(circle at 50% 25%, #2e1a10 0%, #170d07 65%, #0d0704 100%);
    --surface: rgba(38, 23, 14, 0.86);
    --surface-solid: #26160d;
    --door-bg: linear-gradient(145deg, #3a2315, #22130b);
    --door-open-bg: rgba(20, 11, 6, 0.94);
    --border: rgba(245, 195, 132, 0.28);
    --border-hover: rgba(245, 195, 132, 0.65);
    --accent: #f5c384;
    --accent-hover: #fde68a;
    --accent-2: #10b981;
    --text: #fbf3ea;
    --text-muted: #cbb69e;
    --btn-text: #1c1008;
    --card-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
    --font-title: 'Instrument Serif', 'Playfair Display', Georgia, serif;

    /* Variables Analógicas de Cartón Kraft Clásico */
    --cardboard-bg: #c5a882;
    --cardboard-border: #75522e;
    --cardboard-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 2px 5px rgba(255, 255, 255, 0.4);
    --cardboard-text: #2f1709;
    --cavity-bg: #1e1107;
    --cavity-shadow: inset 3px 4px 10px rgba(0,0,0,0.8), inset -1px -1px 3px rgba(255,255,255,0.06);
    --flap-bg: linear-gradient(150deg, #dfc49f 0%, #c19f77 100%);
    --flap-border: #886238;
    --flap-number: #991b1b;
    --perforation-line: rgba(75, 45, 18, 0.55);
    --notch-bg: rgba(45, 25, 10, 0.35);
}

[data-theme="minimal"] {
    --bg-main: #dfd7c8;
    --bg-gradient: radial-gradient(circle at 50% 20%, #ece5d8 0%, #d5ccba 100%);
    --surface: rgba(255, 255, 255, 0.94);
    --surface-solid: #ffffff;
    --door-bg: linear-gradient(145deg, #ffffff, #efe9dd);
    --door-open-bg: #e6dfd1;
    --border: rgba(30, 41, 59, 0.18);
    --border-hover: rgba(194, 94, 62, 0.55);
    --accent: #b84a27;
    --accent-hover: #9a3412;
    --accent-2: #1e293b;
    --text: #1e293b;
    --text-muted: #475569;
    --btn-text: #ffffff;
    --card-shadow: 0 14px 32px rgba(50, 38, 25, 0.1);
    --font-title: 'Instrument Serif', 'Playfair Display', Georgia, serif;

    /* Variables Analógicas de Cartulina y Algodón Prensado */
    --cardboard-bg: #ede6d9;
    --cardboard-border: #b8ad9b;
    --cardboard-shadow: 0 20px 45px rgba(50, 40, 30, 0.15), inset 0 2px 5px #fff;
    --cardboard-text: #2c2925;
    --cavity-bg: #2b2823;
    --cavity-shadow: inset 3px 4px 9px rgba(0,0,0,0.4);
    --flap-bg: linear-gradient(150deg, #faf7f2 0%, #e7e0d2 100%);
    --flap-border: #bfb39f;
    --flap-number: #b84a27;
    --perforation-line: rgba(70, 60, 50, 0.35);
    --notch-bg: rgba(0, 0, 0, 0.18);
}

[data-theme="minimal"] .landing-step-card,
[data-theme="minimal"] .media-tools-box,
[data-theme="minimal"] .share-link-url-box,
[data-theme="minimal"] .audio-player-box,
[data-theme="minimal"] .sponsor-cta-box {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(30, 41, 59, 0.25);
    color: #1e293b;
}

[data-theme="minimal"] .landing-privacy-badge,
[data-theme="minimal"] .badge-free {
    background: rgba(4, 120, 87, 0.12);
    color: #065f46;
    border-color: rgba(4, 120, 87, 0.35);
}

[data-theme="minimal"] .save-link-banner,
[data-theme="minimal"] .voucher-ticket {
    background: rgba(184, 74, 39, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    background-color: var(--bg-main);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.35s ease, color 0.35s ease;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Ambient Sparkles */
.ambient-sparkles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(2px 2px at 12% 20%, rgba(255, 215, 130, 0.4), transparent),
        radial-gradient(2px 2px at 45% 65%, rgba(255, 215, 130, 0.25), transparent),
        radial-gradient(3px 3px at 80% 25%, rgba(255, 215, 130, 0.35), transparent),
        radial-gradient(2px 2px at 85% 75%, rgba(255, 215, 130, 0.3), transparent);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 18px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
    transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
    transform: translateY(-1px) scale(1.03);
}

.brand-door-shape {
    fill: var(--cardboard-bg);
    stroke: var(--accent);
    stroke-width: 2.6;
    stroke-dasharray: 4.5 3;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.brand-door-num {
    fill: var(--flap-number);
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 25px;
    letter-spacing: -0.5px;
    transition: fill 0.3s ease;
}

.brand-title {
    font-family: 'Segoe Script', 'Dancing Script', 'Snell Roundhand', 'Brush Script MT', 'Apple Chancery', cursive;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.05;
    text-transform: lowercase;
    color: var(--accent);
    text-shadow: 0 2px 10px rgba(245, 185, 113, 0.25);
}

.brand-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.top-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.select-pill {
    background: var(--surface-solid);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: var(--btn-text);
    border-color: var(--accent);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-whatsapp {
    background: #25d366;
    color: #0b2512;
    border-color: #25d366;
    font-weight: 700;
}

.btn-whatsapp:hover {
    background: #2ee06f;
}

/* Simulator Bar */
.sim-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 16px;
    margin: 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-free {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Nav View Tabs */
.view-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 16px;
    flex-wrap: wrap;
}

.view-tab {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-tab.active {
    background: var(--accent);
    color: var(--btn-text);
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.calendar-hero {
    text-align: center;
    margin: 20px 0 26px;
}

.distance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    margin-bottom: 10px;
    color: var(--accent);
    font-weight: 600;
}

.calendar-hero h1 {
    font-family: var(--font-title);
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    margin-bottom: 8px;
}

.calendar-hero p {
    color: var(--text-muted);
    font-size: 0.94rem;
    max-width: 620px;
    margin: 0 auto;
}

/* =========================================================================
   REALISTIC ANALOG CARDBOARD ADVENT CALENDAR (Cartón Físico Troquelado)
   ========================================================================= */

.cardboard-board {
    background: var(--cardboard-bg);
    border: 5px solid var(--cardboard-border);
    border-radius: 20px;
    padding: 26px 22px 22px;
    margin: 20px auto 32px;
    box-shadow: var(--cardboard-shadow);
    position: relative;
    color: var(--cardboard-text);
    background-image: 
        repeating-linear-gradient(45deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 2px, transparent 2px, transparent 5px),
        radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.08), transparent 70%);
}

/* Vintage Airmail / Postmark Header on the Board */
.board-vintage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed var(--perforation-line);
    padding-bottom: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.vintage-airmail-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border: 1.5px solid var(--perforation-line);
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
}

.vintage-postmark {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.9;
}

.board-corner-ribbon {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--flap-number);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* 24 Doors Grid inside Cardboard Board */
.doors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

/* Single Physical Door Slot */
.door-card {
    height: 155px;
    position: relative;
    perspective: 1100px;
    user-select: none;
}

/* 1. Interior Cavity (El hueco troquelado en el cartón donde reposa la sorpresa) */
.door-cavity {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: var(--cavity-bg);
    box-shadow: var(--cavity-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    z-index: 1;
    overflow: hidden;
    cursor: pointer;
}

.cavity-center-icon {
    font-size: 2.1rem;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
    transition: transform 0.2s ease;
}

.door-card:hover .cavity-center-icon {
    transform: scale(1.1);
}

.cavity-hint {
    font-size: 0.74rem;
    color: #f1f5f9;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* 2. Front Cardboard Flap (La solapa troquelada exterior de cartón) */
.door-flap {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: var(--flap-bg);
    border: 1.5px solid var(--flap-border);
    transform-origin: left center;
    transition: transform 0.65s cubic-bezier(0.34, 1.35, 0.64, 1), box-shadow 0.35s ease;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 9px 12px;
    cursor: pointer;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.3);
}

/* Perforated lines around the flap (línea de troquel perforado) */
.door-flap::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1.5px dashed var(--perforation-line);
    border-radius: 7px;
    pointer-events: none;
}

/* Semicircular Thumb Notch (La muesca de uña a la derecha para tirar de la solapa) */
.thumb-notch {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 24px;
    border-radius: 0 12px 12px 0;
    background: var(--notch-bg);
    border: 1.5px dashed var(--perforation-line);
    border-left: none;
    z-index: 3;
    pointer-events: none;
    box-shadow: 2px 0 4px rgba(0,0,0,0.2);
}

/* Door Flap Top (Número y autor) */
.flap-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 4;
}

.door-number {
    font-family: var(--font-title);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--flap-number);
    line-height: 1;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.2);
}

.door-author-tag {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    color: var(--cardboard-text);
    font-weight: 700;
}

/* Center motif (motivo de sello navideño vintage en la solapa) */
.flap-center-motif {
    text-align: center;
    font-size: 1.5rem;
    opacity: 0.85;
    margin: 2px 0;
    filter: drop-shadow(0 1px 1px rgba(255,255,255,0.3));
}

/* Flap Bottom text */
.flap-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--cardboard-text);
    opacity: 0.9;
    font-weight: 700;
    position: relative;
    z-index: 4;
}

/* ESTADOS DE LAS PUERTAS FÍSICAS */

/* 1. Puerta ABIERTA: la solapa de cartón rota 3D hacia la izquierda y se queda doblada */
.door-card.opened .door-flap {
    transform: rotateY(-118deg);
    box-shadow: -4px 6px 14px rgba(0,0,0,0.5);
    pointer-events: none; /* Permite hacer clic directo en la cavidad para ver la sorpresa */
}

/* 2. Puerta de HOY: invita a meter la uña para rasgar */
.door-card.today .thumb-notch {
    background: var(--accent);
    animation: notchPulse 1.8s infinite;
}

@keyframes notchPulse {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.8; }
    50% { transform: translateY(-50%) scale(1.25); opacity: 1; }
}

.door-card.today:not(.opened) .door-flap {
    border-color: var(--accent);
    animation: flapGentleShake 4s infinite ease-in-out;
}

@keyframes flapGentleShake {
    0%, 90%, 100% { transform: rotateY(0deg); }
    93% { transform: rotateY(-8deg); }
    96% { transform: rotateY(0deg); }
    98% { transform: rotateY(-5deg); }
}

/* Hover físico: levantar ligeramente la esquina de cartón troquelado */
.door-card.today:not(.opened):hover .door-flap,
.door-card.unlocked:not(.opened):hover .door-flap {
    transform: rotateY(-22deg);
    box-shadow: 4px 8px 18px rgba(0,0,0,0.4);
}

.door-card.locked .door-flap {
    cursor: not-allowed;
    filter: saturate(0.85);
}

.board-vintage-footer {
    text-align: center;
    border-top: 2px dashed var(--perforation-line);
    padding-top: 14px;
    margin-top: 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

/* Sponsor & Countdown Banner */
.sponsor-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 20px 0 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.countdown-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.countdown-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

.sponsor-cta-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Creator Studio */
.studio-grid {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 20px;
    margin-bottom: 36px;
}

@media (max-width: 860px) {
    .studio-grid { grid-template-columns: 1fr; }
}

.studio-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.day-pills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-top: 12px;
}

.day-pill {
    padding: 9px 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-solid);
    color: var(--text);
    text-align: center;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.15s;
}

.day-pill.active {
    border: 2px solid var(--accent);
    background: var(--accent);
    color: var(--btn-text);
}

.day-pill.ready {
    border-color: rgba(16, 185, 129, 0.55);
}

.day-pill.partner-locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin: 12px 0 16px;
}

.type-btn {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.79rem;
    font-weight: 600;
    text-align: left;
    transition: all 0.15s;
}

.type-btn.active {
    border-color: var(--accent);
    background: rgba(245, 185, 113, 0.15);
    color: var(--accent);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.86rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

/* Audio & Image Recording Controls */
.media-tools-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Partner Suggestion Cards in Editor */
.partner-suggestions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.partner-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.partner-card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.partner-tag {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 700;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--surface-solid);
    border: 2px solid var(--accent);
    border-radius: 20px;
    max-width: 560px;
    width: 100%;
    padding: 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

/* =========================================================================
   LANDING PAGE & SECURITY ALERT STYLES
   ========================================================================= */

.landing-hero {
    text-align: center;
    padding: 24px 0 36px;
    max-width: 820px;
    margin: 0 auto;
}

.landing-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.38);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 0.02em;
}

.landing-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.landing-cta-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin: 20px 0 40px;
    text-align: left;
}

.landing-feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.landing-feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.landing-feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.landing-feature-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--accent);
}

.landing-feature-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.landing-steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0 40px;
}

.landing-step-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 18px;
    position: relative;
}

.landing-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--btn-text);
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* Security Alert Callouts */
.security-alert-box {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.security-alert-box.danger {
    background: rgba(225, 29, 72, 0.14);
    border-color: rgba(225, 29, 72, 0.45);
}

.share-link-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
    text-align: left;
}

.share-link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.share-link-url-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    word-break: break-all;
    margin-bottom: 10px;
    user-select: all;
}

.save-link-banner {
    background: rgba(245, 185, 113, 0.12);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 10px 16px;
    margin: 14px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.84rem;
}

@keyframes popIn {
    from { transform: scale(0.88); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.voucher-ticket {
    background: rgba(245, 185, 113, 0.12);
    border: 2px dashed var(--accent);
    border-radius: 14px;
    padding: 16px;
    margin: 14px 0;
}

.polaroid-frame {
    background: #fff;
    color: #1e293b;
    padding: 10px 10px 20px 10px;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    margin: 12px auto;
    max-width: 300px;
    transform: rotate(-1.5deg);
}

.polaroid-img {
    width: 100%;
    height: 180px;
    border-radius: 4px;
    object-fit: cover;
    background: #e2e8f0;
}

.audio-player-box {
    margin: 12px 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.memory-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hidden { display: none !important; }

/* =========================================================================
   MODERN WEB GUIDANCE POLISH (View Transitions, Typography Balance, Select)
   ========================================================================= */
h1, h2, h3 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

select option {
    background-color: var(--surface-solid);
    color: var(--text);
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.24s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none !important;
    }
}

/* =========================================================================
   EDITORIAL HYBRID LANDING (A: Motion 3D Wax-Seal Door + B: Hand-Drawn SVG)
   ========================================================================= */
.editorial-landing {
    padding: 26px 0 42px;
    max-width: 1120px;
    margin: 0 auto;
}

.editorial-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 44px;
    align-items: center;
    padding: 16px 0 28px;
}

@media (max-width: 860px) {
    .editorial-hero {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    .editorial-kicker,
    .editorial-cta-row {
        justify-content: center;
    }
    .editorial-lead {
        margin-left: auto;
        margin-right: auto;
    }
}

.editorial-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.editorial-kicker::before {
    content: "";
    width: 26px;
    height: 1px;
    background: var(--accent);
}

.editorial-h1 {
    font-family: 'Instrument Serif', 'Playfair Display', Georgia, serif;
    font-size: clamp(2.6rem, 5.6vw, 4.6rem);
    font-weight: 400;
    line-height: 0.99;
    letter-spacing: -0.025em;
    margin-bottom: 22px;
    color: var(--text);
}

.editorial-h1 em {
    font-style: italic;
    color: var(--accent);
}

.editorial-lead {
    font-size: 1.04rem;
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 490px;
    margin-bottom: 28px;
}

.editorial-cta-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.btn-editorial-main {
    background: var(--accent);
    color: var(--btn-text);
    text-decoration: none;
    padding: 15px 28px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.94rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}

.btn-editorial-main:hover {
    background: var(--accent-hover);
    transform: translateY(-3px) scale(1.03);
}

.editorial-whisper {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: var(--text-muted);
    opacity: 0.85;
}

/* Interactive 3D Hero Door Stage */
.editorial-stage {
    perspective: 1400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.hero-door-shell {
    width: 290px;
    height: 356px;
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    animation: heroDoorFloat 5.5s ease-in-out infinite;
    user-select: none;
}

@keyframes heroDoorFloat {
    0%, 100% { transform: translateY(0px) rotate(-1deg); }
    50% { transform: translateY(-9px) rotate(0.8deg); }
}

.hero-door-cavity {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--cavity-bg);
    border: 2px solid var(--border);
    box-shadow: inset 0 14px 36px rgba(0, 0, 0, 0.88), 0 28px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.hero-mini-polaroid {
    background: #fffdf8;
    color: #1c1917;
    padding: 10px 10px 22px;
    border-radius: 4px;
    width: 196px;
    transform: rotate(-3deg) scale(0.88);
    opacity: 0.35;
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

.hero-door-shell.opened .hero-mini-polaroid {
    transform: rotate(2deg) scale(1);
    opacity: 1;
}

.hero-polaroid-art {
    height: 112px;
    background: linear-gradient(135deg, #fda4af, #fcd34d);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.hero-polaroid-note {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    margin-top: 8px;
    line-height: 1.15;
}

.hero-voice-tag {
    margin-top: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--accent);
}

.hero-door-flap {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--flap-bg);
    border: 2px solid var(--flap-border);
    transform-origin: left center;
    transition: transform 0.85s cubic-bezier(0.34, 1.4, 0.64, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    box-shadow: 12px 24px 50px rgba(0, 0, 0, 0.5);
    backface-visibility: hidden;
}

.hero-door-flap::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1.5px dashed var(--perforation-line);
    border-radius: 12px;
    pointer-events: none;
}

.hero-door-shell:hover:not(.opened) .hero-door-flap {
    transform: rotateY(-18deg);
}

.hero-door-shell.opened .hero-door-flap {
    transform: rotateY(-126deg);
}

.hero-flap-meta {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
}

.hero-wax-seal {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e11d48, #881337);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Instrument Serif', 'Playfair Display', serif;
    font-size: 1.85rem;
    color: #fde68a;
    margin: 0 auto;
}

.hero-flap-cta {
    text-align: center;
    font-size: 0.74rem;
    color: var(--text);
    opacity: 0.85;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

/* Hand-Drawn Animated Postal Flight Path SVG */
.postal-flight-ribbon {
    max-width: 820px;
    margin: 22px auto 12px;
    padding: 8px 12px;
}

.postal-flight-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.postal-dot {
    fill: var(--accent);
}

.postal-city-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    fill: var(--text-muted);
    letter-spacing: 0.08em;
}

.postal-hand-note {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    fill: var(--accent);
}

.postal-flight-path {
    stroke: var(--accent);
    stroke-width: 2.2;
    stroke-dasharray: 8 7;
    fill: none;
    stroke-dashoffset: 680;
    animation: drawPostalFlight 3.6s ease-out infinite;
}

@keyframes drawPostalFlight {
    0% { stroke-dashoffset: 680; }
    65%, 100% { stroke-dashoffset: 0; }
}

/* 3 Editorial Principles (Clean, Zero AI-Card Clutter) */
.editorial-principles {
    margin-top: 18px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 760px) {
    .editorial-principles {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

.principle-title {
    font-family: 'Instrument Serif', 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.editorial-principle p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* =========================================================================
   UNIFIED EDITORIAL CRAFT SYSTEM ACROSS ENTIRE APP (Wizard, Calendar,
   Studio, Album, Modals & Navigation)
   ========================================================================= */

/* Header & Navigation refined */
header {
    background: color-mix(in srgb, var(--bg-main) 84%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.btn {
    border-radius: 999px;
    padding: 9px 18px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

/* View Tabs -> Editorial Segmented Pill Bar */
.view-tabs {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px;
    border-radius: 999px;
    width: fit-content;
    margin: 22px auto 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.view-tab {
    border: none;
    background: transparent;
    padding: 9px 18px;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.view-tab:hover:not(.active) {
    color: var(--text);
}

.view-tab.active {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

/* Calendar Hero -> Editorial Typography & Monospace Kicker */
.calendar-hero {
    margin: 26px 0 30px;
}

.distance-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 16px;
    background: transparent;
    border: 1px dashed var(--border-hover);
}

.calendar-hero h1 {
    font-family: var(--font-title);
    font-weight: 400;
    font-size: clamp(2.1rem, 4.4vw, 3.3rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 10px 0 10px;
}

.calendar-hero p {
    font-size: 0.96rem;
    line-height: 1.6;
}

/* Wizard & Creator Studio Panels -> Editorial Framed Cards */
.studio-panel {
    border-radius: 22px;
    padding: 26px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    position: relative;
}

.studio-panel h2,
.studio-panel h3 {
    font-family: var(--font-title);
    font-weight: 400;
    letter-spacing: -0.015em;
}

#wizard-card {
    border: 1.5px solid var(--border-hover);
    padding: 32px 30px;
}

#wizard-card h2 {
    font-size: 2.1rem;
    line-height: 1.05;
}

/* Form Controls & Type Selector */
.form-group label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.form-control {
    border-radius: 12px;
    padding: 11px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.day-pill {
    border-radius: 12px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease;
}

.day-pill:hover:not(.partner-locked) {
    transform: translateY(-2px);
}

.type-btn {
    border-radius: 12px;
    padding: 10px 12px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, background 0.2s ease;
}

.type-btn:hover {
    transform: translateY(-1px);
    border-color: var(--border-hover);
}

/* Save Link Banner & Countdown Banner */
.save-link-banner,
.sponsor-banner {
    border-radius: 18px;
    border-style: dashed;
    padding: 14px 20px;
}

.countdown-time {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}

/* Modals -> Editorial Wax-Seal Framed Feel */
.modal-card {
    border-radius: 24px;
    border: 1.5px solid var(--accent);
    padding: 30px;
    position: relative;
}

.modal-card h2 {
    font-family: var(--font-title);
    font-weight: 400;
    font-size: 2rem;
    line-height: 1.08;
}

/* Album of Memories -> Keepsake Polaroid / Postcard Feel */
.memory-card {
    border-radius: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease;
}

.memory-card:hover {
    transform: translateY(-4px) rotate(-0.4deg);
    border-color: var(--border-hover);
}

.memory-card h3 {
    font-family: var(--font-title);
    font-weight: 400;
    font-size: 1.45rem;
    line-height: 1.1;
}

.polaroid-frame {
    font-family: 'Caveat', cursive;
}

.polaroid-frame div {
    font-family: 'Caveat', cursive !important;
    font-size: 1.25rem !important;
}

/* Language Switcher Pill (ES | EN) */
.lang-switch {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px;
    gap: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: var(--accent);
    color: var(--btn-text);
}
