/* ===== Wedding Invitation — Nouhaila & Sofiane ===== */

/* ===== VARIABLES ===== */
:root {
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', 'Helvetica Neue', sans-serif;
    --font-script: 'Great Vibes', cursive;

    --bg-primary: #F8F4EF;
    --bg-paper: #FDFBF8;
    --white: #FFFFFF;

    --text-dark: #1A1A1A;
    --text-medium: #1A1A1A;
    --text-light: #333333;

    --gold: #B8956A;
    --gold-dark: #8B6F47;
    --gold-light: #D4BC96;

    --burgundy: #8B1A1A;
    --burgundy-dark: #6B1010;
    --burgundy-light: #A52A2A;

    --rose: #C9A396;
    --rose-light: #E8D5CE;
    --rose-lighter: #F3EBE6;

    --envelope: #C4A97D;
    --envelope-dark: #A8905F;
    --seal-bg: #7B2D26;
    --seal-dark: #5A1F1A;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: #FAFAFA url('white-relief-bg.png') repeat;
    background-size: 400px;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== PAGE LAYOUT ===== */
.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    background: transparent;
}

.page-inner {
    position: relative;
    width: 100%;
    max-width: 520px;
    min-height: 80vh;
    background: #FAFAFA url('white-relief-bg.png') repeat;
    background-size: 400px;
    border-radius: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    overflow: hidden;
}

/* White overlay so text is readable on top of the relief */
.page-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    pointer-events: none;
    z-index: 0;
}

.page-inner > * {
    position: relative;
    z-index: 1;
}

/* ===== LACE CORNERS ===== */
.lace-corner {
    position: absolute;
    width: clamp(70px, 14vw, 140px);
    height: clamp(70px, 14vw, 140px);
    background-image: url('lace-corner.png');
    background-size: contain;
    background-repeat: no-repeat;
    mix-blend-mode: multiply;
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}

.lace-tl {
    top: 0;
    left: 0;
    background-position: top left;
}

.lace-br {
    bottom: 0;
    right: 0;
    transform: rotate(180deg);
    background-position: top left;
}

/* ===== BUTTONS ===== */
.btn {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 14px 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.btn-submit {
    display: block;
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(139, 26, 26, 0.3);
    font-size: 0.8rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 26, 26, 0.4);
}

/* ===== TYPOGRAPHY ===== */
.citadel-font {
    font-family: "Citadel Script", cursive !important;
}

/* ===== PREMIUM INTRO ===== */
#intro {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    transition: opacity 1.5s ease;
    overflow: hidden;
}
#intro.fade-out {
    opacity: 0;
    pointer-events: none;
}

#intro.gone {
    display: none;
}

/* --- OUVERTURE ÉLÉGANTE (GATEFOLD) --- */
.gatefold {
    position: absolute;
    inset: 0;
    display: flex;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.gate {
    width: 50%;
    height: 100%;
    background-color: var(--bg-paper);
    background-image: url('white-relief-bg.png');
    background-size: 400px;
    position: relative;
    transition: transform 1.5s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: 0 0 30px rgba(0,0,0,0.08);
}

.gate-left {
    transform-origin: left;
    border-right: 1px solid var(--gold-light);
}

.gate-right {
    transform-origin: right;
    border-left: 1px solid var(--gold-light);
}

/* Liseré doré intérieur pour un rendu "papeterie de luxe" */
.gate-left::before {
    content: '';
    position: absolute;
    top: 20px; bottom: 20px; right: 12px;
    width: 1px;
    background: var(--gold);
    opacity: 0.5;
}

.gate-right::before {
    content: '';
    position: absolute;
    top: 20px; bottom: 20px; left: 12px;
    width: 1px;
    background: var(--gold);
    opacity: 0.5;
}

/* État ouvert : les portes coulissent vers l'extérieur */
.gatefold.open .gate-left {
    transform: translateX(-100%);
    box-shadow: 15px 0 40px rgba(0,0,0,0.1);
}

.gatefold.open .gate-right {
    transform: translateX(100%);
    box-shadow: -15px 0 40px rgba(0,0,0,0.1);
}

/* --- Photorealistic wax seal --- */
.intro-seal {
    position: relative;
    z-index: 10;
    width: clamp(130px, 32vw, 180px);
    height: clamp(130px, 32vw, 180px);
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    mix-blend-mode: darken;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.8s ease;
    animation: sealAppear 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both,
               sealFloat 5s ease-in-out infinite 2s;
}

.intro-seal img {
    width: 115%;
    height: 115%;
    filter: contrast(1.15) brightness(1.05);
    pointer-events: none;
    user-select: none;
}

.intro-seal:hover {
    transform: scale(1.03);
}

.intro-seal:active {
    transform: scale(0.93);
}

/* Seal pressed state */
.intro-seal.pressed {
    transform: scale(0.9) !important;
    animation: none !important;
    transition: transform 0.15s ease;
}

/* Disparition du sceau (il s'évapore élégamment) */
.intro-seal.lifted {
    transform: scale(1.1) !important;
    opacity: 0 !important;
    animation: none !important;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0, 1), opacity 0.6s ease !important;
}

@keyframes sealAppear {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

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

/* --- Hint text --- */
.intro-hint {
    position: relative;
    z-index: 10;
    margin-top: 40px;
    font-family: var(--font-script);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--burgundy);
    animation: fadeInUp 1.2s ease 1.2s both;
    transition: opacity 0.5s ease;
}

.intro-hint.fade-out {
    opacity: 0;
}

/* Space out below intro so spacing is preserved */
/* ===== PAGE 2 — INVITATION ===== */
#invitation {
    background: transparent;
}

.invitation-content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
}

.invitation-bismillah {
    width: clamp(90px, 28vw, 160px);
    height: auto;
    display: block;
    margin: 0 auto 30px;
    mix-blend-mode: multiply;
}

.invitation-monogram {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-dark);
    letter-spacing: 6px;
    margin-bottom: 40px;
}

.mono-sep {
    margin: 0 4px;
    font-weight: 300;
}

.invitation-names {
    margin-bottom: 24px;
}

.inv-name {
    display: block;
    font-family: var(--font-script);
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    color: var(--burgundy);
    line-height: 1.2;
}

.inv-amp {
    display: block;
    font-family: var(--font-script);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    color: var(--burgundy-light);
    margin: 4px 0;
}

/* Diagonal name layout */
.inv-left {
    text-align: left;
    padding-left: 8%;
}

.inv-right {
    text-align: right;
    padding-right: 8%;
}

.invitation-subtitle {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-medium);
    line-height: 1.8;
    margin-bottom: 28px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.invitation-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.date-num {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 400;
    color: var(--burgundy);
    letter-spacing: 2px;
}

.date-sep {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 300;
    color: var(--gold);
}

/* --- Scroll Indicator (guide les invités à descendre) --- */
.scroll-cue {
    margin-top: 48px;
    text-align: center;
    transition: opacity 0.6s ease;
}

.scroll-cue-text {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-style: italic;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.scroll-cue-arrow {
    width: 16px;
    height: 16px;
    margin: 0 auto;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 1; }
    50% { transform: rotate(45deg) translateY(8px); opacity: 0.4; }
}

/* ===== PAGE 3 — LIEUX ===== */
#lieux {
    background: transparent;
}

.lieux-content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
}

.lieu-block {
    margin-bottom: 24px;
}

.lieu-icon-img {
    font-size: 2rem;
    margin-bottom: 12px;
}

.lieu-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-medium);
    margin-bottom: 4px;
}

.lieu-name {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--burgundy);
    margin-bottom: 6px;
}

.lieu-address {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-medium);
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.lieu-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.sep-line {
    width: 50px;
    height: 1px;
    background: var(--gold);
}

.sep-dot {
    font-size: 6px;
    color: var(--gold);
}

.lieu-info {
    background: var(--rose-lighter);
    border-radius: 8px;
    padding: 20px;
    margin: 28px 0 20px;
}

.lieu-note {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--text-medium);
    line-height: 1.7;
    margin-bottom: 8px;
}

.lieu-note:last-child {
    margin-bottom: 0;
}

.programme-note {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-top: 16px;
}

/* ===== PAGE 4 — MESSAGE ===== */
#message {
    background: transparent;
}

.message-content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
}

.message-title {
    font-family: var(--font-script);
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    color: var(--burgundy);
    margin-bottom: 36px;
    font-weight: 400;
}

.message-text {
    max-width: 380px;
    margin: 0 auto 36px;
}

.message-text p {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-medium);
    line-height: 1.9;
    margin-bottom: 20px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong {
    color: var(--burgundy);
    font-weight: 500;
}

.message-merci {
    font-family: var(--font-script);
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    color: var(--burgundy);
    margin-bottom: 24px;
}

.message-monogram {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-dark);
    letter-spacing: 6px;
}

/* ===== PAGE 5 — RSVP ===== */
#rsvp {
    background: transparent;
}

.rsvp-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.rsvp-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--burgundy);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.rsvp-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

/* FORM */
.rsvp-form {
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    margin-bottom: 16px;
}

/* Honeypot — caché visuellement mais pas avec display:none (les bots détectent ça) */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.form-group label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 300;
    padding: 10px 14px;
    border: 1px solid var(--rose-light);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--burgundy-light);
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
    font-weight: 300;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238C7B6F' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: 300;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--rose);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--burgundy);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--burgundy);
    border-radius: 50%;
}

/* RSVP Success */
.rsvp-success {
    display: none;
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.6s ease;
}

.rsvp-success.show {
    display: block;
}

.success-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.rsvp-success h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.rsvp-success p {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-medium);
    line-height: 1.7;
}

/* Thanks section */
.rsvp-thanks {
    margin-top: 36px;
    text-align: center;
}

.thanks-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.thanks-text {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: 6px;
}

.thanks-monogram {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-dark);
    letter-spacing: 6px;
    margin-top: 16px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-intro {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.animate-intro.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .page-inner {
        padding: 50px 28px;
        min-height: auto;
    }

    .inv-name {
        font-size: 2.5rem;
    }

    .date-num {
        font-size: 2.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 16px;
    }

    .page-inner {
        padding: 40px 20px;
    }

    .inv-name {
        font-size: 2.2rem;
    }

    .inv-amp {
        font-size: 1.5rem;
    }

    .date-num {
        font-size: 2rem;
    }

    .invitation-monogram {
        font-size: 1.5rem;
    }

    .message-title {
        font-size: 2rem;
    }

    .message-text p {
        font-size: 0.9rem;
    }

    .lieu-name {
        font-size: 1.6rem;
    }

    .envelope {
        width: 300px;
        height: 200px;
        transform: translate(-50%, -46%) scale(1.8);
    }

    .seal {
        width: 85px;
        height: 85px;
    }

    .lace-corner {
        width: 65px;
        height: 65px;
    }
}

/* ===== MUSIC TOGGLE ===== */
.music-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--gold-light);
    background: rgba(253, 251, 248, 0.95);
    backdrop-filter: blur(8px);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--gold-dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 1s ease 1s forwards;
}

.music-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.music-toggle.playing {
    border-color: var(--burgundy-light);
    color: var(--burgundy);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ===== SOUND TOGGLE ===== */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.3s ease, background 0.3s ease;
}

.sound-toggle.visible {
    opacity: 1;
    pointer-events: auto;
}

.sound-toggle:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.95);
}

.sound-toggle:active {
    transform: scale(0.95);
}