:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-red: #a81818; /* Rouge plus vif pour l'effet peinture */
    --accent-gold: #d4af37;
    --accent-gold-dim: #8a702a;
    --input-bg: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Lato', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Chiaroscuro: deep vignette + angled spotlight + soft haze */
.chiaroscuro {
    position: absolute;
    inset: -20vh -20vw;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 235, 190, 0.09) 0%, rgba(0, 0, 0, 0) 45%),
        radial-gradient(closest-side at 50% 55%, rgba(0, 0, 0, 0.0) 0%, rgba(0, 0, 0, 0.45) 70%, rgba(0, 0, 0, 0.95) 115%),
        conic-gradient(from 210deg at 50% 35%, rgba(255, 220, 160, 0.08), rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0) 100%);
    mix-blend-mode: multiply;
    filter: blur(0.2px);
}

.chiaroscuro::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.2) 35%, rgba(0,0,0,0.75));
    opacity: 0.55;
}

.chiaroscuro::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image:
        radial-gradient(rgba(255,255,255,0.18) 0.8px, transparent 0.9px),
        radial-gradient(rgba(255,255,255,0.10) 0.8px, transparent 0.9px);
    background-size: 140px 140px, 220px 220px;
    background-position: 0 0, 60px 80px;
    filter: blur(0.2px);
}

/* Ensure both screens are centered consistently */
.container {
    display: grid;
    place-items: center;
}

.screen {
    width: 100%;
}

/* Background Effects */
.bg-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.9)),
        url('https://static.wixstatic.com/media/52610a_bb2fa020899247c5af44d1a819f0b65c~mv2.png') no-repeat center center fixed;
    background-size: cover;
    z-index: 0;
    opacity: 1;
    filter: contrast(1.1) saturate(0.8);
}

/* Falling petals canvas */
#petals {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
    mix-blend-mode: screen;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 1px, transparent 1px);
    background-size: 50px 50px, 100px 100px;
    background-position: 0 0, 25px 25px;
    opacity: 0.05;
    animation: particleMove 60s linear infinite;
    z-index: 0;
}

@keyframes particleMove {
    0% { background-position: 0 0, 25px 25px; }
    100% { background-position: 100px 100px, 125px 125px; }
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 2.25rem;
    margin: 3rem auto;
    text-align: center;
    position: relative;
    z-index: 3;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Improve readability without a visible panel */
#login-screen {
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
}

.eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 0.92rem;
    letter-spacing: 0.48em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0.75rem;
    text-shadow: 0 10px 26px rgba(0,0,0,0.85);
}

/* Typography */
.title {
    font-family: 'Cinzel', serif;
    font-size: 4.2rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 8px;
    position: relative;
    display: inline-block;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.7),
        0 16px 40px rgba(0, 0, 0, 0.85);
    background:
        linear-gradient(180deg, #fff6d6 0%, #e1c37a 18%, #a67d2f 55%, #f4e3b9 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Subtle worn-metal overlay */
.title::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: transparent;
    background:
        radial-gradient(circle at 25% 15%, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%),
        radial-gradient(circle at 70% 55%, rgba(255,214,140,0.10) 0%, rgba(255,214,140,0) 60%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    mix-blend-mode: screen;
    opacity: 0.32;
    pointer-events: none;
}

/* Slight distressed edge to mimic key art lettering */
.title {
    filter: drop-shadow(0 18px 30px rgba(0,0,0,0.75));
}

.title span {
    display: inline-block;
}

.title::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    margin-top: 10px;
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.25);
    opacity: 0.75;
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.02rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.9;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    display: block;
    width: 100%;
    text-align: center;
}

/* Prefer-reduced-motion: calmer ambience */
@media (prefers-reduced-motion: reduce) {
    .particles {
        animation: none;
    }
    .screen {
        transition: opacity 0.2s linear;
    }
}

#login-screen {
    text-align: center;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    box-shadow: none;
    outline: none;
    padding: 1rem 0.5rem;
    color: white;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    text-align: center;
    transition: all 0.4s ease;
    letter-spacing: 1px;
}

input::placeholder {
    color: #555;
    font-style: italic;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
}

input:focus {
    border-bottom-color: var(--accent-gold);
    background: transparent;
    box-shadow: none;
}

/* Fix for autocomplete background color (removes the white/blue box) */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active  {
    -webkit-text-fill-color: white !important;
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    background-color: transparent !important;
    background-image: none !important;
    caret-color: white;
    /* Use transition to keep background transparent */
    transition: background-color 5000s ease-in-out 0s;
}

/* Firefox (and other browsers) autofill variants */
input:autofill {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
}

button {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-red);
    transition: left 0.4s ease;
    z-index: -1;
}

button:hover {
    color: white;
    border-color: var(--accent-red);
    box-shadow: 0 0 30px rgba(168, 24, 24, 0.3);
}

button:hover::before {
    left: 0;
}

/* Error Message */
.error {
    color: var(--accent-red);
    margin-top: 2rem;
    font-size: 0.9rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s;
    text-shadow: 0 0 10px rgba(168, 24, 24, 0.2);
}

.error.visible {
    opacity: 1;
}

/* Screens Transition (scoped to screens only) */
.screen {
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(24px) scale(0.98);
    position: absolute;
    inset: 0;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
    position: relative;
}

/* Shake without touching `transform` (avoids transition conflicts) */
.screen.shake {
    animation: screenShake 280ms ease-in-out;
}

@keyframes screenShake {
    0% { left: 0; }
    25% { left: 6px; }
    50% { left: -6px; }
    75% { left: 4px; }
    100% { left: 0; }
}

/* Utility hiding for non-screen elements */
.is-hidden {
    display: none !important;
}

/* Invite Screen Specifics */
.content-box {
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 3.25rem 2.5rem;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.95) 0%, rgba(25, 25, 25, 0.98) 100%);
    position: relative;
    box-shadow: 0 0 80px rgba(0,0,0,0.9), inset 0 0 50px rgba(0,0,0,0.5);
    overflow: hidden;
}

/* Decorative inner border */
.content-box::before {
    content: '';
    position: absolute;
    top: 12px; left: 12px; right: 12px; bottom: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    pointer-events: none;
    z-index: 1;
}

/* Decorative corners for invite */
.content-box::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 1px solid transparent;
    /* Corner accents using gradients */
    background: 
        linear-gradient(to right, var(--accent-gold) 2px, transparent 2px) 0 0,
        linear-gradient(to bottom, var(--accent-gold) 2px, transparent 2px) 0 0,
        linear-gradient(to left, var(--accent-gold) 2px, transparent 2px) 100% 0,
        linear-gradient(to bottom, var(--accent-gold) 2px, transparent 2px) 100% 0,
        linear-gradient(to right, var(--accent-gold) 2px, transparent 2px) 0 100%,
        linear-gradient(to top, var(--accent-gold) 2px, transparent 2px) 0 100%,
        linear-gradient(to left, var(--accent-gold) 2px, transparent 2px) 100% 100%,
        linear-gradient(to top, var(--accent-gold) 2px, transparent 2px) 100% 100%;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 2;
}

.welcome-text {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.guest-name {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    text-shadow: 
        0 0 20px rgba(168, 24, 24, 0.5),
        2px 2px 0px rgba(0,0,0,0.8);
    /* Paint brush effect background */
    background: linear-gradient(90deg, transparent, rgba(168, 24, 24, 0.1), transparent);
    padding: 0.5rem 0;
    transform: scale(1);
    animation: pulseName 3s infinite ease-in-out;
}

@keyframes pulseName {
    0%, 100% { transform: scale(1); text-shadow: 0 0 20px rgba(168, 24, 24, 0.5); }
    50% { transform: scale(1.02); text-shadow: 0 0 30px rgba(168, 24, 24, 0.8); }
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    margin: 2rem auto;
    width: 60%;
    opacity: 0.6;
    position: relative;
    z-index: 2;
}

.divider::after {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-gold);
    background: #111;
    padding: 0 10px;
    font-size: 0.8rem;
}

.invite-text {
    font-family: 'Lato', sans-serif;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #ccc;
    position: relative;
    z-index: 2;
}

.details-box {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.details-box p {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--accent-gold);
    letter-spacing: 1px;
    margin: 0.5rem 0;
    text-transform: uppercase;
}

.number-33 {
    font-family: 'Cinzel', serif;
    font-size: 16rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.03);
    opacity: 1;
    pointer-events: none;
    font-weight: bold;
    z-index: 0;
    filter: blur(0px);
}



/* Audio UI */
.audio-ui {
    position: fixed;
    right: 22px;
    top: 18px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.18);
    backdrop-filter: blur(4px);
}

.audio-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.5);
    font-family: 'Cinzel', serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 7px 10px;
    min-width: 58px;
    text-align: center;
    cursor: pointer;
}

.audio-btn:hover {
    border-color: rgba(212, 175, 55, 0.9);
}

.audio-slider {
    width: 140px;
    accent-color: var(--accent-gold);
}

.codex-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    padding-bottom: 4px;
}

.codex-link:hover {
    color: rgba(255, 255, 255, 0.92);
    border-bottom-color: rgba(212, 175, 55, 0.75);
}

.codex-link--invite {
    position: absolute;
    top: 18px;
    right: 18px;
    margin-top: 0;
    z-index: 3;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    opacity: 0.85;
}

.logout-link--invite {
    position: absolute;
    top: 18px;
    left: 18px;
    margin-top: 0;
    z-index: 3;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    opacity: 0.85;
}

.admin-panel {
    margin-top: 1.25rem;
    text-align: left;
}

.checklist {
    text-align: left;
    margin-bottom: 1.25rem;
    padding: 1rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(0, 0, 0, 0.18);
}

.checklist .invite-text {
    margin-bottom: 0.75rem;
}

.checklist__item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.55rem 0;
    border-top: 1px solid rgba(212, 175, 55, 0.10);
}

.checklist__item:first-of-type {
    border-top: none;
}

.checklist__item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
}

.checklist__item label {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.88);
}

.checklist__item a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.checklist__item a:hover {
    color: rgba(255, 255, 255, 0.96);
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}

.admin-field label {
    display: block;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0.35rem;
}

.admin-field input[readonly] {
    opacity: 0.9;
}

.admin-actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-users {
    margin-top: 1.25rem;
    border: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(0, 0, 0, 0.22);
    padding: 0.9rem 1rem;
}

.admin-users__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-users__header .invite-text {
    margin: 0;
}

.admin-users__header button {
    padding: 0.8rem 1.2rem;
    font-size: 0.85rem;
    letter-spacing: 2px;
}

.admin-users__list {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.6rem;
}

.admin-user-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(212, 175, 55, 0.12);
    background: rgba(0, 0, 0, 0.18);
}

.admin-user-row__meta {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.85rem;
}

.admin-user-row__code {
    font-family: 'Lato', sans-serif;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    word-break: break-word;
}

.admin-user-row__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.admin-user-row__actions button {
    padding: 0.8rem 1.1rem;
    font-size: 0.85rem;
    letter-spacing: 2px;
}

@media (min-width: 520px) {
    .admin-user-row {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
    .admin-user-row__actions {
        justify-content: flex-end;
    }
    .admin-user-row__code {
        grid-column: 1 / -1;
    }
}

@media (min-width: 520px) {
    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-field--code {
        grid-column: 1 / -1;
    }
}

/* Codex page */
body.codex-page {
    overflow: auto;
}

body.codex-page .container {
    max-width: 900px;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.codex-box {
    text-align: center;
}

.codex-link--panel {
    position: absolute;
    top: 18px;
    right: 18px;
    margin-top: 0;
    z-index: 3;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    opacity: 0.85;
}

.faq {
    text-align: left;
    margin-top: 1.5rem;
}

.faq details {
    border: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(0, 0, 0, 0.25);
    padding: 0.9rem 1rem;
    margin: 0.9rem 0;
}

.faq summary {
    cursor: pointer;
    list-style: none;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: '＋';
    float: right;
    color: rgba(212, 175, 55, 0.85);
}

.faq details[open] summary::after {
    content: '－';
}

.faq-body {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}

.faq code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: rgba(212, 175, 55, 0.9);
}

/* RSVP / Questionnaire */
.rsvp {
    position: relative;
    z-index: 2;
    text-align: left;
    margin-top: 1.5rem;
}

.rsvp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

.rsvp-field label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0.5rem;
}

.rsvp-field input,
.rsvp-field select,
.rsvp-field textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(212, 175, 55, 0.18);
    color: rgba(255,255,255,0.92);
    border-radius: 0;
    padding: 0.8rem 0.9rem;
    font-family: 'Lato', sans-serif;
    outline: none;
}

.rsvp-field textarea {
    resize: vertical;
}

.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.08);
}

.rsvp-actions {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.75rem;
}

.rsvp-actions button {
    width: 100%;
}

.rsvp-status {
    min-height: 1.1em;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
}

.invite-confirm {
    position: relative;
    z-index: 2;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.quick-links .codex-link {
    margin-top: 0;
}

.admin-user-row__rsvp {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.10);
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

#invite-confirm .rsvp-actions {
    justify-content: center;
    gap: 0.75rem;
}

#invite-confirm #rsvp-edit {
    padding: 0.95rem 2.2rem;
    font-size: 0.95rem;
}