/* ============================================================================
   ANIMATION MARIAGE IMMERSIVE 3D - Charlotte & Julien
   ============================================================================
   Expérience immersive avec éléments floraux et effets de profondeur
   ============================================================================ */

/* ====================================================================
   VARIABLES
   ==================================================================== */
:root {
    --gold: #d4af37;
    --gold-light: #f0d890;
    --rose: #f0beaa;
    --rose-dark: #c97960;
    --cream: #faf6f0;
    --ivory: #fffff0;
    --deep-green: #2d4a3e;
    --sage: #9caf88;
    --blush: #fce4e4;
}

/* ====================================================================
   BASE
   ==================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.intro-page {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
    font-family: 'Lato', sans-serif;
    cursor: default;
}

/* ====================================================================
   FOND ÉTOILÉ / PARTICULES
   ==================================================================== */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
}

/* ====================================================================
   COUCHES DE PROFONDEUR 3D
   ==================================================================== */
.parallax-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 1000px;
    transform-style: preserve-3d;
    z-index: 2;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.layer-back { z-index: 1; }
.layer-mid { z-index: 2; }
.layer-front { z-index: 3; }

/* ====================================================================
   ÉLÉMENTS FLORAUX
   ==================================================================== */
.floral-element {
    position: absolute;
    opacity: 0;
    transform-origin: center center;
    will-change: transform, opacity;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.3));
}

/* Grandes fleurs de fond */
.flower-large {
    width: clamp(150px, 25vw, 300px);
    height: auto;
}

.flower-1 { top: -5%; left: -5%; }
.flower-2 { top: -5%; right: -5%; transform: scaleX(-1); }
.flower-3 { bottom: -5%; left: -5%; transform: rotate(180deg); }
.flower-4 { bottom: -5%; right: -5%; transform: rotate(180deg) scaleX(-1); }

/* Fleurs moyennes */
.flower-medium {
    width: clamp(80px, 15vw, 180px);
    height: auto;
}

.flower-5 { top: 20%; left: 5%; }
.flower-6 { top: 15%; right: 8%; }
.flower-7 { bottom: 20%; left: 8%; }
.flower-8 { bottom: 15%; right: 5%; }

/* Petites fleurs et feuilles */
.flower-small {
    width: clamp(40px, 8vw, 100px);
    height: auto;
}

/* Animation d'apparition des fleurs */
.floral-element.visible {
    animation: flowerBloom 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes flowerBloom {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-30deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Animation de flottement */
.floral-element.floating {
    animation: gentleFloat 6s ease-in-out infinite;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(-1deg); }
    75% { transform: translateY(-15px) rotate(1deg); }
}

/* ====================================================================
   PÉTALES FLOTTANTS
   ==================================================================== */
.petals-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 20px;
    height: 25px;
    opacity: 0;
    pointer-events: none;
}

.petal svg {
    width: 100%;
    height: 100%;
}

.petal.falling {
    animation: petalFall linear forwards;
}

@keyframes petalFall {
    0% {
        opacity: 0;
        transform: translateY(-50px) rotate(0deg) scale(0.5);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(calc(100vh + 50px)) rotate(720deg) scale(0.8);
    }
}

/* ====================================================================
   CONTENU PRINCIPAL
   ==================================================================== */
.main-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 20;
    width: 90%;
    max-width: 600px;
}

/* Cadre doré */
.golden-frame {
    position: relative;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow:
        0 0 60px rgba(212, 175, 55, 0.1),
        inset 0 0 60px rgba(255, 255, 255, 0.02);
    opacity: 0;
    transform: scale(0.8);
    transition: all 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.golden-frame.visible {
    opacity: 1;
    transform: scale(1);
}

/* Ornements des coins */
.corner-ornament {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.golden-frame.visible .corner-ornament {
    opacity: 1;
}

.corner-tl { top: -10px; left: -10px; }
.corner-tr { top: -10px; right: -10px; transform: scaleX(-1); }
.corner-bl { bottom: -10px; left: -10px; transform: scaleY(-1); }
.corner-br { bottom: -10px; right: -10px; transform: scale(-1); }

/* ====================================================================
   TYPOGRAPHIE ANIMÉE
   ==================================================================== */
.intro-text {
    color: var(--gold-light);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
    transition-delay: 0.5s;
}

.golden-frame.visible .intro-text {
    opacity: 1;
    transform: translateY(0);
}

.names-container {
    position: relative;
    margin: 30px 0;
}

.name {
    font-family: var(--font-decorative, 'RTL-Adam Script'), cursive;
    font-size: clamp(3rem, 10vw, 5rem);
    color: transparent;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
}

.name.charlotte { transition-delay: 0.8s; }
.name.ampersand {
    font-size: clamp(1.5rem, 4vw, 2rem);
    transition-delay: 1s;
    display: block;
    margin: 10px 0;
}
.name.julien { transition-delay: 1.2s; }

.golden-frame.visible .name {
    opacity: 1;
    transform: translateY(0);
}

/* Ligne décorative */
.decorative-line {
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 25px auto;
    opacity: 0;
    transform: scaleX(0);
    transition: all 1s ease;
    transition-delay: 1.4s;
}

.golden-frame.visible .decorative-line {
    opacity: 1;
    transform: scaleX(1);
}

/* Date */
.date-container {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
    transition-delay: 1.6s;
}

.golden-frame.visible .date-container {
    opacity: 1;
    transform: translateY(0);
}

.date-text {
    color: var(--cream);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.location-text {
    color: var(--rose);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-style: italic;
    letter-spacing: 2px;
}

/* ====================================================================
   BOUTON DÉCOUVRIR
   ==================================================================== */
.discover-btn {
    margin-top: 40px;
    padding: 18px 50px;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

.golden-frame.visible .discover-btn {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.8s;
}

.discover-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transition: left 0.6s ease;
}

.discover-btn:hover {
    background: var(--gold);
    color: #1a1a2e;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.discover-btn:hover::before {
    left: 100%;
}

/* ====================================================================
   INDICATEUR SCROLL / CLIC
   ==================================================================== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 3s;
    z-index: 25;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.scroll-icon {
    width: 30px;
    height: 50px;
    border: 2px solid var(--gold);
    border-radius: 20px;
    position: relative;
    margin-bottom: 10px;
}

.scroll-icon::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--gold);
    border-radius: 2px;
    animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { top: 8px; opacity: 1; }
    50% { top: 20px; opacity: 0.5; }
}

.scroll-text {
    color: var(--gold-light);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ====================================================================
   TRANSITION VERS LE SITE
   ==================================================================== */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cream);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-overlay.active {
    opacity: 1;
    visibility: visible;
}

.transition-content {
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s ease;
    transition-delay: 0.3s;
}

.transition-overlay.active .transition-content {
    opacity: 1;
    transform: scale(1);
}

.transition-title {
    font-family: var(--font-decorative, 'RTL-Adam Script'), cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: var(--color-secondary, #dc9682);
    margin-bottom: 15px;
}

.transition-subtitle {
    color: var(--color-text, #222641);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* ====================================================================
   CONTRÔLES
   ==================================================================== */
.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: var(--gold);
    color: #1a1a2e;
    transform: scale(1.1);
}

.skip-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    z-index: 100;
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

/* ====================================================================
   LOADER
   ==================================================================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 20px;
    color: var(--gold-light);
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 768px) {
    .golden-frame {
        padding: 40px 25px;
    }

    .flower-large {
        width: clamp(100px, 30vw, 200px);
    }

    .flower-medium {
        width: clamp(60px, 20vw, 120px);
    }

    .corner-ornament {
        width: 40px;
        height: 40px;
    }

    .controls {
        top: 15px;
        right: 15px;
    }

    .skip-btn {
        top: 15px;
        left: 15px;
        padding: 8px 15px;
        font-size: 0.75rem;
    }

    .scroll-indicator {
        bottom: 25px;
    }
}

@media (max-width: 480px) {
    .golden-frame {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .intro-text {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    .decorative-line {
        width: 60px;
        margin: 20px auto;
    }

    .discover-btn {
        padding: 14px 35px;
        font-size: 0.85rem;
    }
}

/* Préférence mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====================================================================
   LUEUR AMBIANTE
   ==================================================================== */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--rose) 0%, transparent 70%);
    top: 10%;
    left: 10%;
    animation: glowPulse 8s ease-in-out infinite;
}

.glow-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    bottom: 20%;
    right: 15%;
    animation: glowPulse 10s ease-in-out infinite reverse;
}

.glow-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--sage) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: glowPulse 12s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ====================================================================
   MODAL MOT DE PASSE
   ==================================================================== */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.password-modal.active {
    opacity: 1;
    visibility: visible;
}

.password-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
}

.password-modal-content {
    position: relative;
    background: linear-gradient(145deg, rgba(40, 40, 60, 0.9), rgba(26, 26, 46, 0.95));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.password-modal.active .password-modal-content {
    transform: scale(1) translateY(0);
}

.password-modal-header {
    margin-bottom: 35px;
}

.password-modal-title {
    font-family: var(--font-decorative, 'RTL-Adam Script'), cursive;
    font-size: clamp(2rem, 6vw, 2.5rem);
    color: transparent;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    margin-bottom: 12px;
}

.password-modal-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.password-input-wrapper {
    position: relative;
}

.password-input {
    width: 100%;
    padding: 18px 50px 18px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    color: var(--cream);
    font-size: 1rem;
    letter-spacing: 2px;
    text-align: center;
    transition: all 0.3s ease;
}

.password-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.password-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.password-input.error {
    border-color: #e74c3c;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--gold);
}

.password-error {
    color: #e74c3c;
    font-size: 0.85rem;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.password-error.visible {
    opacity: 1;
    transform: translateY(0);
}

.password-submit {
    padding: 18px 40px;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.password-submit:hover:not(:disabled) {
    background: var(--gold);
    color: #1a1a2e;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.password-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.password-submit .btn-loader {
    display: none;
}

.password-submit.loading .btn-text {
    display: none;
}

.password-submit.loading .btn-loader {
    display: inline-block;
}

.password-modal-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.password-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-style: italic;
    letter-spacing: 0.5px;
}

.password-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.password-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* Animation de succès */
.password-modal-content.success {
    border-color: #27ae60;
}

.password-modal-content.success .password-input {
    border-color: #27ae60;
}

/* Responsive */
@media (max-width: 480px) {
    .password-modal-content {
        padding: 40px 25px;
        margin: 15px;
    }

    .password-modal-title {
        font-size: 1.8rem;
    }

    .password-input {
        padding: 15px 45px 15px 15px;
        font-size: 0.95rem;
    }

    .password-submit {
        padding: 15px 30px;
        font-size: 0.9rem;
    }
}
