/* ============================================================
   WEDDING WAGERS — Luxury Edition
   Inspired by Tiffany & Co. / Rolex editorial aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

/* ── Design Tokens ── */
:root {
    --cream:         #F5F0E8;
    --white:         #FDFBF7;
    --charcoal:      #1C1C1C;
    --charcoal-mid:  #3D3D3D;
    --muted:         #8A8375;
    --gold:          #C9A84C;
    --gold-light:    rgba(201, 168, 76, 0.12);
    --gold-border:   rgba(201, 168, 76, 0.30);
    --border:        rgba(28, 28, 28, 0.10);
    --error:         #B85450;

    --serif:  'Playfair Display', Georgia, serif;
    --sans:   'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --ease:   cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Base ── */
body {
    font-family: var(--sans);
    background: var(--cream);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--charcoal);
}

/* ── Card / Container ── */
.container {
    background: var(--white);
    padding: 64px 56px;
    max-width: 520px;
    width: 100%;
    border-top: 2px solid var(--gold);
    box-shadow:
        0 1px 0 var(--gold-border),
        0 4px 8px  rgba(28, 28, 28, 0.04),
        0 24px 64px rgba(28, 28, 28, 0.07);
    animation: fadeSlideUp 0.65s var(--ease) both;
    position: relative;
}

/* ── Keyframes ── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* kept for JS that references this name */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Typography ── */
h1 {
    font-family: var(--serif);
    color: var(--charcoal);
    text-align: center;
    margin-bottom: 10px;
    font-size: 38px;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

h2 {
    font-family: var(--serif);
    color: var(--charcoal);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0.2px;
}

.subtitle {
    color: var(--muted);
    text-align: center;
    margin-bottom: 12px;
    font-size: 11px;
    line-height: 1.9;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

/* ── Gold ornamental divider ── */
.ornament {
    text-align: center;
    margin: 4px 0 40px;
    color: var(--gold);
    font-size: 13px;
    letter-spacing: 10px;
    opacity: 0.75;
    user-select: none;
}

/* ── Screens ── */
.screen           { display: block; }
.screen.hidden    { display: none !important; }
.hidden           { display: none !important; }

/* ── Forms ── */
.form-group {
    margin-bottom: 32px;
}
.form-group.inline {
    display: inline-block;
    width: calc(50% - 8px);
    margin-right: 16px;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 15px;
    font-family: var(--sans);
    font-weight: 300;
    background: transparent;
    color: var(--charcoal);
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}
.form-group input:focus {
    outline: none;
    border-bottom-color: var(--gold);
}
.form-group input::placeholder {
    color: var(--muted);
    font-style: italic;
    font-size: 13px;
    font-weight: 300;
}

/* ── Questions ── */
.question-container {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
    animation: slideIn 0.4s var(--ease) both;
}
.question-container:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* ── Option tiles ── */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: transparent;
    transition: border-color 0.28s ease, background-color 0.28s ease;
}
.option:hover {
    border-color: var(--gold);
    background-color: var(--gold-light);
}
.option:has(input[type="radio"]:checked) {
    border-color: var(--gold);
    background-color: var(--gold-light);
}

.option input[type="radio"] {
    margin-right: 14px;
    cursor: pointer;
    accent-color: var(--gold);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.option span {
    font-size: 13px;
    color: var(--charcoal-mid);
    font-weight: 400;
    letter-spacing: 0.5px;
}
.option input[type="radio"]:checked + span {
    font-weight: 500;
    color: var(--charcoal);
}

/* ── Height input ── */
.height-input {
    display: flex;
    gap: 24px;
}

/* ── Progress bar ── */
.progress-bar {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin-bottom: 48px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--gold);
    transition: width 0.5s var(--ease);
}
/* hide the progress text (X/7 style counter) */
.progress-text { display: none; }

/* ── Buttons ── */
.btn {
    padding: 15px 40px;
    border: 1px solid var(--charcoal);
    border-radius: 0;
    font-size: 10px;
    cursor: pointer;
    transition:
        background-color 0.32s ease,
        color            0.32s ease,
        border-color     0.32s ease,
        transform        0.2s  ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-weight: 600;
    font-family: var(--sans);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    background: transparent;
    color: var(--charcoal);
    -webkit-font-smoothing: antialiased;
}
.btn:hover { transform: translateY(-1px); }

/* Primary: charcoal → gold on hover */
.btn-primary {
    background: var(--charcoal);
    color: var(--white);
    border-color: var(--charcoal);
}
.btn-primary:hover {
    background: var(--gold);
    color: var(--charcoal);
    border-color: var(--gold);
}

/* Secondary: ghost → cream fill */
.btn-secondary {
    background: transparent;
    color: var(--charcoal);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--cream);
    border-color: var(--charcoal);
    color: var(--charcoal);
}

/* Danger: for delete actions in admin */
.btn-danger {
    background: transparent;
    color: var(--error);
    border-color: rgba(184, 84, 80, 0.30);
    font-size: 10px;
    padding: 8px 18px;
    letter-spacing: 1.5px;
}
.btn-danger:hover {
    background: var(--error);
    color: var(--white);
    border-color: var(--error);
}

.btn.full-width {
    width: 100%;
    margin-top: 28px;
}

/* ── Leaderboard controls ── */
.leaderboard-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Success box ── */
.success-box {
    background: var(--gold-light);
    border: 1px solid var(--gold-border);
    padding: 32px;
    margin-bottom: 40px;
    text-align: center;
}
.success-box p {
    color: var(--charcoal-mid);
    margin-bottom: 14px;
    line-height: 1.9;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.3px;
}
.success-box p:last-child { margin-bottom: 0; }

/* ── Loading screen — glassmorphism ── */
.loading-screen {
    position: fixed;
    inset: 0;
    background: rgba(245, 240, 232, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}
.loading-screen.hidden { display: none !important; }

.spinner {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}
.loading-screen p {
    color: var(--muted);
    margin-top: 22px;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ── Error messages ── */
.error {
    color: var(--error);
    font-size: 11px;
    margin-top: 8px;
    display: block;
    letter-spacing: 0.5px;
}

/* ── Leaderboard table ── */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
.leaderboard-table th {
    background: transparent;
    color: var(--muted);
    padding: 10px 16px;
    text-align: left;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
.leaderboard-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--charcoal-mid);
    font-size: 14px;
    font-weight: 300;
}
/* rank column — italic serif numeral */
.leaderboard-table td:first-child {
    font-family: var(--serif);
    font-style: italic;
    color: var(--gold);
    font-size: 15px;
    font-weight: 400;
}
.leaderboard-table tbody tr {
    transition: background-color 0.22s ease;
}
.leaderboard-table tbody tr:hover {
    background-color: var(--gold-light);
}
.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Admin ── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.admin-header h1 {
    text-align: left;
    margin-bottom: 0;
    font-size: 28px;
}

.admin-tabs {
    display: flex;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--sans);
    font-weight: 500;
    transition: color 0.25s ease, border-color 0.25s ease;
    margin-bottom: -1px;
}
.tab-btn.active {
    color: var(--charcoal);
    border-bottom-color: var(--gold);
}
.tab-btn:hover { color: var(--charcoal); }

.tab-content       { display: none; }
.tab-content.active {
    display: block;
    animation: slideIn 0.4s var(--ease) both;
}

/* ── Utility ── */
.text-center { text-align: center; }

/* ── Responsive — Mobile First ── */
@media (max-width: 600px) {
    .container {
        padding: 48px 28px;
    }
    h1 { font-size: 30px; }
    h2 { font-size: 16px; }
    .subtitle { font-size: 10px; letter-spacing: 2px; }

    .form-group.inline {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 24px;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .admin-header .btn { align-self: flex-end; }

    .admin-tabs { flex-direction: column; }
    .tab-btn {
        border-bottom: none;
        border-left: 1px solid transparent;
        text-align: left;
        margin-bottom: 0;
        padding: 12px 16px;
    }
    .tab-btn.active {
        border-left-color: var(--gold);
        border-bottom: none;
    }

    .btn {
        padding: 14px 28px;
        font-size: 10px;
    }
}

@media (max-width: 380px) {
    .container { padding: 36px 20px; }
    h1 { font-size: 26px; }
}
