/* ===================================================================
   HAPPY BIRTHDAY SAI – THE MIDNIGHT SURPRISE
   MAIN DESIGN SYSTEM & LUXURY STYLES
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --bg-deep-black: #080808;
    --bg-surface-black: rgba(14, 14, 14, 0.75);
    --bg-card-border: rgba(214, 184, 117, 0.22);
    --bg-card-hover: rgba(214, 184, 117, 0.35);

    --primary-champagne-gold: #D6B875;
    --secondary-soft-gold: #E8D6A5;
    --antique-gold: #A68B4B;
    --dark-gold-line: rgba(214, 184, 117, 0.2);
    --gold-glow: rgba(214, 184, 117, 0.35);
    --gold-glow-intense: rgba(214, 184, 117, 0.65);

    --text-warm-white: #F5F1E8;
    --text-muted: #B8B0A2;
    --text-gold-gradient: linear-gradient(135deg, #FFF0CA 0%, #D6B875 50%, #9F8244 100%);
    --btn-gold-gradient: linear-gradient(135deg, #ECC880 0%, #D6B875 50%, #AA8743 100%);
    --btn-gold-hover: linear-gradient(135deg, #FFF0CA 0%, #E8D6A5 50%, #BD994F 100%);

    --font-heading: 'Cinzel', Georgia, 'Times New Roman', serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --shadow-luxury: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(214, 184, 117, 0.08);
}

/* Base Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-deep-black);
    color: var(--text-warm-white);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: 
        radial-gradient(circle at 50% 15%, rgba(214, 184, 117, 0.07) 0%, transparent 60%),
        radial-gradient(circle at 50% 85%, rgba(214, 184, 117, 0.03) 0%, transparent 70%),
        #080808;
}

/* Background Particle Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Subtle Vignette Overlay */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.65) 100%);
}

/* Global Navigation & Top Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    padding-top: max(1.25rem, env(safe-area-inset-top));
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: linear-gradient(180deg, rgba(8, 8, 8, 0.85) 0%, rgba(8, 8, 8, 0) 100%);
}

/* Step Progress Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary-champagne-gold);
    font-weight: 600;
}

.progress-track {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.progress-pill {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: rgba(214, 184, 117, 0.2);
    transition: var(--transition-smooth);
}

.progress-pill.active {
    background: var(--primary-champagne-gold);
    box-shadow: 0 0 10px var(--gold-glow-intense);
    width: 32px;
}

.progress-pill.completed {
    background: var(--antique-gold);
}

/* Back Link Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: var(--transition-smooth);
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(214, 184, 117, 0.15);
}

.back-btn:hover {
    color: var(--secondary-soft-gold);
    border-color: var(--primary-champagne-gold);
    background: rgba(214, 184, 117, 0.08);
    transform: translateX(-3px);
}

.back-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

/* Floating Audio Player Pill */
.audio-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.95rem;
    background: rgba(18, 18, 18, 0.85);
    border: 1px solid var(--dark-gold-line);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.audio-pill:hover {
    border-color: rgba(214, 184, 117, 0.45);
    box-shadow: 0 8px 30px rgba(214, 184, 117, 0.15);
}

/* Sound Wave Equalizer Bars */
.sound-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 14px;
}

.sound-bar {
    width: 2.5px;
    height: 5px;
    border-radius: 2px;
    background: var(--primary-champagne-gold);
    transition: height 0.2s ease;
}

.audio-pill.playing .sound-bar:nth-child(1) {
    animation: barBounce 1.1s ease-in-out infinite alternate;
}
.audio-pill.playing .sound-bar:nth-child(2) {
    animation: barBounce 0.8s ease-in-out infinite alternate 0.2s;
}
.audio-pill.playing .sound-bar:nth-child(3) {
    animation: barBounce 1.3s ease-in-out infinite alternate 0.4s;
}
.audio-pill.playing .sound-bar:nth-child(4) {
    animation: barBounce 0.9s ease-in-out infinite alternate 0.1s;
}

@keyframes barBounce {
    0% { height: 4px; }
    50% { height: 14px; }
    100% { height: 6px; }
}

.audio-label {
    font-size: 0.72rem;
    color: var(--text-warm-white);
    letter-spacing: 0.05em;
    font-weight: 500;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.audio-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary-champagne-gold);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.audio-btn:hover {
    background: rgba(214, 184, 117, 0.15);
    transform: scale(1.1);
    color: var(--secondary-soft-gold);
}

.audio-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Page Container & Layout */
.main-stage {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6rem 1.5rem 3rem 1.5rem;
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

.content-wrapper {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInContent 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Typography Helpers */
.title-gold {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--text-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 14px rgba(214, 184, 117, 0.3));
    margin-bottom: 1.25rem;
    line-height: 1.15;
}

.subtitle-gold {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    letter-spacing: 0.15em;
    color: var(--secondary-soft-gold);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1rem;
}

.lead-text {
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    color: var(--text-warm-white);
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 2rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.secondary-prompt {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--secondary-soft-gold);
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Decorative Golden Elements */
.gold-divider {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-champagne-gold), transparent);
    margin: 1.5rem auto;
}

.gold-diamond-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem auto;
    width: 100%;
    max-width: 240px;
}

.gold-diamond-divider .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--antique-gold), transparent);
}

.gold-diamond-divider .diamond {
    width: 6px;
    height: 6px;
    background: var(--primary-champagne-gold);
    transform: rotate(45deg);
    box-shadow: 0 0 8px var(--primary-champagne-gold);
}

/* Luxury Card Framing */
.luxury-card {
    position: relative;
    background: var(--bg-surface-black);
    border: 1px solid var(--bg-card-border);
    border-radius: 20px;
    padding: clamp(2rem, 5vw, 3.5rem);
    box-shadow: var(--shadow-luxury);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

.luxury-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(214, 184, 117, 0.6), transparent);
}

/* Buttons System */
.btn-gold {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.05rem 2.5rem;
    background: var(--btn-gold-gradient);
    color: #12100A;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(214, 184, 117, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-25deg);
    transition: 0.6s ease;
}

.btn-gold:hover {
    background: var(--btn-gold-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 35px rgba(214, 184, 117, 0.55), 0 4px 12px rgba(0, 0, 0, 0.5);
    color: #080808;
}

.btn-gold:hover::before {
    left: 150%;
}

.btn-gold:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(214, 184, 117, 0.3);
}

.btn-gold:focus-visible {
    outline: 2px solid var(--secondary-soft-gold);
    outline-offset: 4px;
}

/* Secondary Ghost Button */
.btn-gold-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.8rem;
    background: transparent;
    color: var(--primary-champagne-gold);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--antique-gold);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-gold-ghost:hover {
    background: rgba(214, 184, 117, 0.1);
    border-color: var(--secondary-soft-gold);
    color: var(--secondary-soft-gold);
    transform: translateY(-2px);
}

/* Form Styles for Page 2 */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-family: var(--font-heading);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--secondary-soft-gold);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    color: var(--text-warm-white);
    font-family: var(--font-body);
    font-size: 1rem;
    letter-spacing: 0.03em;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-champagne-gold);
    box-shadow: 0 0 16px rgba(214, 184, 117, 0.25);
    background: rgba(15, 15, 15, 0.6);
}

.form-input::placeholder {
    color: rgba(184, 176, 162, 0.4);
}

.input-icon-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.input-icon-btn:hover {
    color: var(--primary-champagne-gold);
}

.input-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Feedback / Error Alerts */
.feedback-box {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.2rem;
    border-radius: 10px;
    font-size: 0.88rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    transition: var(--transition-smooth);
}

.feedback-box.error {
    display: flex;
    background: rgba(180, 40, 40, 0.12);
    border: 1px solid rgba(220, 80, 80, 0.35);
    color: #FFC0C0;
    animation: shakeError 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.feedback-box.success {
    display: flex;
    background: rgba(214, 184, 117, 0.15);
    border: 1px solid var(--primary-champagne-gold);
    color: var(--secondary-soft-gold);
}

@keyframes shakeError {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Golden Unlock Overlay Animation */
.unlock-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 8, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.unlock-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.unlock-crest {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--primary-champagne-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px var(--gold-glow-intense), inset 0 0 20px var(--gold-glow);
    animation: crestPulse 1.4s ease-in-out infinite alternate;
    margin-bottom: 1.5rem;
}

@keyframes crestPulse {
    from { transform: scale(0.95); box-shadow: 0 0 20px var(--gold-glow); }
    to { transform: scale(1.05); box-shadow: 0 0 50px var(--gold-glow-intense); }
}

.unlock-crest svg {
    width: 44px;
    height: 44px;
    fill: var(--primary-champagne-gold);
}

.unlock-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    letter-spacing: 0.15em;
    color: var(--secondary-soft-gold);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.unlock-desc {
    color: var(--text-warm-white);
    font-size: 0.95rem;
    font-weight: 300;
}

/* Page Transition Wrapper */
.page-fade-out {
    opacity: 0 !important;
    transform: translateY(-15px) scale(0.98) !important;
    transition: opacity 0.4s ease, transform 0.4s ease !important;
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    #particles-canvas {
        display: none;
    }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .top-nav {
        padding: 1rem 1.25rem;
    }

    .main-stage {
        padding: 5.5rem 1.25rem 2.5rem 1.25rem;
    }

    .luxury-card {
        padding: 1.75rem 1.25rem;
    }

    .audio-label {
        display: none;
    }

    .step-label {
        font-size: 0.68rem;
    }

    .progress-pill {
        width: 16px;
    }

    .progress-pill.active {
        width: 22px;
    }
}
