/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    /* Background */
    --bg-1: #0a0612;
    --bg-2: #150d24;
    --bg-3: #231440;
    --bg-4: #3a1148;

    /* Accent Colors */
    --pink: #ff3366;
    --pink-light: #ff6b8a;
    --pink-glow: rgba(255, 51, 102, 0.35);
    --rose: #e8255a;
    --gold: #f0c27f;
    --gold-light: #ffe29f;
    --green: #34d399;
    --green-dark: #10b981;
    --green-glow: rgba(52, 211, 153, 0.3);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
                    inset 0 1px 0 rgba(255, 255, 255, 0.06);

    /* Text */
    --text-primary: #f5f0ff;
    --text-secondary: rgba(245, 240, 255, 0.65);
    --text-muted: rgba(245, 240, 255, 0.4);

    /* Fonts */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --radius: 24px;
    --radius-sm: 14px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-1);
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   CANVAS BACKGROUND
   ============================================================ */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 20px;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96) translateY(16px);
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    max-width: 460px;
    width: 100%;
    animation: cardEnter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Soft gradient border */
.glass-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius);
    background: linear-gradient(
        160deg,
        rgba(255, 51, 102, 0.2) 0%,
        transparent 35%,
        transparent 65%,
        rgba(240, 194, 127, 0.15) 100%
    );
    z-index: -1;
    animation: shimmer 5s ease-in-out infinite alternate;
}

@keyframes shimmer {
    0%   { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(32px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   SCREEN EMOJIS
   ============================================================ */
.screen-emoji {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(255, 51, 102, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ============================================================
   SCREEN 1 — INTRO
   ============================================================ */
.intro-title {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.name-highlight {
    font-style: italic;
    background: linear-gradient(135deg, var(--pink-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typewriter {
    font-size: 1.1rem;
    color: var(--text-secondary);
    min-height: 1.6em;
    margin-bottom: 32px;
    font-weight: 300;
}

.typewriter .cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--pink);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    letter-spacing: 0.01em;
}

.btn:active {
    transform: scale(0.97) !important;
}

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--rose));
    color: white;
    box-shadow: 0 4px 20px var(--pink-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--pink-glow);
}

.btn-arrow {
    transition: transform 0.3s;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(3px);
}

/* YES */
.btn-yes {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: white;
    box-shadow: 0 4px 20px var(--green-glow);
    font-size: 1.1rem;
    padding: 18px 36px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-yes:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px var(--green-glow);
}

.btn-yes.heartbeat {
    animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%   { transform: scale(var(--yes-scale, 1)); }
    14%  { transform: scale(calc(var(--yes-scale, 1) * 1.08)); }
    28%  { transform: scale(var(--yes-scale, 1)); }
    42%  { transform: scale(calc(var(--yes-scale, 1) * 1.04)); }
    70%  { transform: scale(var(--yes-scale, 1)); }
}

/* NO */
.btn-no {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    font-size: 0.95rem;
    padding: 14px 28px;
}

.btn-no:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* The escaped button that lives outside cards */
.btn-no-escaped {
    position: fixed;
    z-index: 200;
    transition: left 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.2s ease,
                font-size 0.3s ease;
}

.btn-no-escaped.shaking {
    animation: shake 0.35s ease-in-out;
}

@keyframes shake {
    0%, 100% { rotate: 0deg; }
    25%      { rotate: -4deg; }
    50%      { rotate: 4deg; }
    75%      { rotate: -3deg; }
}

/* ============================================================
   SCREEN 2 — QUESTION
   ============================================================ */
.question-title {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.question-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    font-weight: 300;
    font-style: italic;
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    min-height: 60px;
    align-items: center;
}

.escape-counter {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 1.4em;
    font-style: italic;
    transition: opacity 0.3s;
}

/* ============================================================
   SCREEN 3 — FORM
   ============================================================ */
.form-card {
    text-align: left;
    padding: 36px 32px;
    max-width: 420px;
}

.form-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-header h2 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.form-header p {
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
    -webkit-appearance: none;
    cursor: pointer;
}

.form-group input:hover,
.form-group select:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.form-group input:focus,
.form-group select:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--pink-light);
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.12);
}

/* Custom dropdown arrow */
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-2);
    color: white;
    padding: 8px;
}

.btn-submit {
    width: 100%;
    margin-top: 8px;
    padding: 18px;
    font-size: 1.1rem;
}

/* ============================================================
   SCREEN 4 — CONFIRMATION
   ============================================================ */
.confirmation-card {
    padding: 48px 36px;
}

.heart-anim {
    margin-bottom: 16px;
}

.heart-svg {
    animation: heartPulse 1.3s ease-in-out infinite;
    filter: drop-shadow(0 4px 16px rgba(126, 200, 227, 0.5));
}

@keyframes heartPulse {
    0%   { transform: scale(1); }
    14%  { transform: scale(1.18); }
    28%  { transform: scale(1); }
    42%  { transform: scale(1.1); }
    70%  { transform: scale(1); }
}

.confirmation-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
    font-style: italic;
    background: linear-gradient(135deg, var(--pink-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.summary-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: left;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.summary-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-label {
    font-weight: 400;
    color: var(--text-muted);
    min-width: 70px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-weight: 600;
    color: var(--text-primary);
}

.special-message-container {
    margin-top: 8px;
}

.special-message {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    font-style: italic;
    background: linear-gradient(135deg, var(--pink), var(--pink-light), var(--gold-light));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    margin-bottom: 8px;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.divider-dots {
    color: var(--text-muted);
    letter-spacing: 6px;
    font-size: 1.2rem;
}

/* ============================================================
   CONFETTI
   ============================================================ */
#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 300;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: var(--w, 10px);
    height: var(--h, 14px);
    background: var(--color, #ff3366);
    border-radius: var(--br, 2px);
    opacity: 0;
    will-change: transform, opacity;
    animation: confettiFall var(--fall-duration, 3s) var(--delay, 0s)
               cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes confettiFall {
    0%  { transform: translateX(0) translateY(0) rotate(0deg); opacity: 1; }
    20% { opacity: 1; }
    100% {
        transform: translateX(var(--drift, 80px)) translateY(110vh)
                   rotate(var(--spin, 720deg));
        opacity: 0;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .glass-card {
        padding: 36px 24px;
        border-radius: 20px;
    }

    .intro-title { font-size: 2.1rem; }
    .question-title { font-size: 1.7rem; }
    .confirmation-title { font-size: 2.2rem; }
    .special-message { font-size: 1.8rem; }

    .buttons-container {
        flex-direction: column;
        gap: 12px;
    }

    .btn-yes, .btn-no {
        width: 100%;
        max-width: 260px;
    }

    .form-card { padding: 28px 20px; }

    .icon-circle { width: 56px; height: 56px; }
    .icon-circle--lg { width: 68px; height: 68px; }
    .icon-circle svg { width: 24px; height: 24px; }
    .icon-circle--lg svg { width: 32px; height: 32px; }
}

@media (max-width: 380px) {
    .glass-card { padding: 28px 16px; }
    .intro-title { font-size: 1.8rem; }
    .question-title { font-size: 1.4rem; }
}
