/* ============================================================
   Fenris Wedding — Connexion
   DA : noir & blanc, touche de doré
   ============================================================ */

:root {
  --noir: #0b0b0b;
  --noir-soft: #141414;
  --ivoire: #f5f1e8;
  --or: #c6a45c;
  --or-clair: #e6ce97;
  --gris: #8a8784;
  --gris-clair: #b8b4ad;
  --rouge: #d98a8a;
  --ff-display: "Cormorant Garamond", Georgia, serif;
  --ff-body: "Jost", system-ui, sans-serif;
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--ff-body); font-weight: 300; background: var(--noir); color: var(--ivoire); line-height: 1.7; -webkit-font-smoothing: antialiased; min-height: 100vh; padding-top: 88px; }
body.is-locked { overflow: hidden; }
img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
a { color: inherit; text-decoration: none; }

.grain { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.04; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ----------------------- Navigation ---------------------- */
.nav { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: 1.6rem 0; border-bottom: 1px solid transparent; transition: top 0.5s var(--ease), background 0.5s var(--ease), padding 0.5s var(--ease), border-color 0.5s var(--ease); }
.nav.is-scrolled { background: rgba(11,11,11,0.82); backdrop-filter: blur(14px); padding: 0.9rem 0; border-bottom: 1px solid rgba(198,164,92,0.18); }
.nav.is-hidden { top: -100%; transform: none; transition: top 0.5s var(--ease), background 0.5s var(--ease), padding 0.5s var(--ease); }
.nav__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.3rem, 5vw, 3rem); display: flex; align-items: center; justify-content: space-between; }
.nav__brand { font-family: var(--ff-display); font-size: 1.5rem; font-weight: 500; letter-spacing: 0.06em; }
.nav__brand span { color: var(--or); }
.nav__links { display: flex; align-items: center; gap: 2.1rem; }
.nav__links a { font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase; position: relative; padding: 0.3rem 0; }
.nav__links a:not(.nav__cta)::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px; background: var(--or); transition: width 0.4s var(--ease); }
.nav__links a:not(.nav__cta):hover { color: var(--or); }
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta { border: 1px solid var(--or); padding: 0.7rem 1.4rem; color: var(--or); transition: background 0.4s var(--ease), color 0.4s var(--ease); }
.nav__cta:hover { background: var(--or); color: var(--noir); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__burger span { width: 26px; height: 1.5px; background: var(--ivoire); transition: all 0.4s var(--ease); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ----------------------- Curseur ------------------------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; border-radius: 50%; opacity: 0; }
.cursor { width: 36px; height: 36px; border: 1px solid var(--or); transform: translate(-50%, -50%); transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease), opacity 0.3s; }
.cursor-dot { width: 5px; height: 5px; background: var(--or); transform: translate(-50%, -50%); transition: opacity 0.3s; }
.cursor.is-active { width: 56px; height: 56px; background: rgba(198,164,92,0.12); }
body.has-cursor, body.has-cursor a, body.has-cursor button, body.has-cursor input, body.has-cursor label { cursor: none; }

/* ----------------------- Layout -------------------------- */
.auth { display: grid; grid-template-columns: 1fr; min-height: 100vh; }

/* Volet visuel */
.auth__aside { position: relative; overflow: hidden; display: flex; }
.auth__aside-bg { position: absolute; inset: -6%; z-index: 0; }
.auth__aside-bg img { filter: grayscale(1) contrast(1.1) brightness(0.45); }
.auth__aside::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(120deg, rgba(11,11,11,0.55), rgba(11,11,11,0.25) 45%, rgba(11,11,11,0.7)); }
.auth__aside-content { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 4vw, 3.5rem); width: 100%; }
.auth__brand { font-family: var(--ff-display); font-size: 1.6rem; font-weight: 500; letter-spacing: 0.06em; }
.auth__brand span { color: var(--or); }
.auth__quote p { font-family: var(--ff-display); font-style: italic; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.15; }
.auth__quote cite { display: block; margin-top: 1.4rem; font-style: normal; font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--or); }

/* Volet formulaire */
.auth__panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(2.5rem, 6vw, 5rem); background: var(--noir); }
.auth__box { width: 100%; max-width: 400px; background: rgba(11, 11, 11, 0.95); border: 1px solid rgba(198, 164, 92, 0.12); border-radius: 2rem; box-shadow: 0 32px 90px rgba(0, 0, 0, 0.25); padding: clamp(2rem, 3vw, 3.5rem); }
.auth__eyebrow { font-size: 0.7rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--or); margin-bottom: 1.2rem; }
.auth__title { font-family: var(--ff-display); font-weight: 400; font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1.02; margin-bottom: 1rem; }
.auth__sub { color: var(--gris-clair); font-size: 0.96rem; margin-bottom: 2.2rem; max-width: 38ch; }

/* Alertes */
.auth__alert { border: 1px solid rgba(217,138,138,0.5); background: rgba(217,138,138,0.08); color: var(--rouge); font-size: 0.88rem; padding: 0.9rem 1.1rem; margin-bottom: 1.6rem; }
.auth__alert--ok { border-color: rgba(198,164,92,0.6); background: rgba(198,164,92,0.1); color: var(--or-clair); }

/* ----------------------- Champs -------------------------- */
.auth__form { display: flex; flex-direction: column; gap: 1.4rem; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--or); margin-bottom: 0.6rem; }
.field input { background: transparent; border: none; border-bottom: 1px solid rgba(198,164,92,0.4); color: var(--ivoire); font-family: var(--ff-body); font-size: 1rem; font-weight: 300; padding: 0.7rem 0.1rem; width: 100%; transition: border-color 0.4s var(--ease); }
.field input:focus { outline: none; border-color: var(--or-clair); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--ivoire); transition: background-color 9999s ease-in-out 0s; }
.field.is-invalid input { border-color: var(--rouge); }
.field__error { color: var(--rouge); font-size: 0.74rem; margin-top: 0.4rem; min-height: 1rem; }

/* Mot de passe + œil */
.field__pwd { position: relative; display: flex; align-items: center; }
.field__pwd input { padding-right: 2.4rem; }
.field__toggle { position: absolute; right: 0; bottom: 0.5rem; background: none; border: none; cursor: pointer; padding: 4px; display: flex; }
.eye { display: block; width: 22px; height: 14px; border-radius: 0 0 60% 60% / 0 0 100% 100%; border: 1.5px solid var(--or); border-top: none; position: relative; transition: opacity 0.3s; }
.eye::before { content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; background: var(--or); border-radius: 50%; transform: translate(-50%, -40%); }
.field__toggle.is-on .eye::after { content: ""; position: absolute; top: 50%; left: -2px; width: 26px; height: 1.5px; background: var(--or); transform: rotate(-35deg); transform-origin: center; }

/* ----------------------- Ligne options ------------------- */
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: -0.2rem; }
.remember { display: flex; align-items: center; gap: 0.55rem; font-size: 0.84rem; color: var(--gris-clair); }
.remember input { accent-color: var(--or); width: 15px; height: 15px; }
.auth__link { font-size: 0.84rem; color: var(--or); position: relative; }
.auth__link::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px; background: var(--or); transition: width 0.35s var(--ease); }
.auth__link:hover::after { width: 100%; }

/* ----------------------- Bouton -------------------------- */
.btn { position: relative; display: inline-block; font-family: var(--ff-body); font-weight: 400; font-size: 0.78rem; letter-spacing: 0.24em; text-transform: uppercase; padding: 1.1rem 2.4rem; cursor: pointer; border: 1px solid transparent; overflow: hidden; transition: all 0.45s var(--ease); }
.btn--gold { background: linear-gradient(120deg, var(--or) 0%, var(--or-clair) 50%, var(--or) 100%); background-size: 200% 100%; color: var(--noir); border: none; }
.btn--gold:hover { background-position: 100% 0; }
.btn--gold::after { content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent); transform: skewX(-20deg); transition: left 0.7s var(--ease); }
.btn--gold:hover::after { left: 140%; }
.auth__submit { width: 100%; margin-top: 0.6rem; }
.auth__submit.is-loading { opacity: 0.7; pointer-events: none; }
.auth__submit.is-loading span { visibility: hidden; }
.auth__submit.is-loading::before { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid rgba(11,11,11,0.35); border-top-color: var(--noir); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth__foot { margin-top: 2rem; font-size: 0.9rem; color: var(--gris-clair); }
.auth__foot .auth__link { font-size: 0.9rem; }
.auth__back { position: absolute; top: clamp(1.5rem, 4vw, 2.5rem); right: clamp(1.5rem, 4vw, 2.5rem); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gris); }
.auth__back a { transition: color 0.3s var(--ease); }
.auth__back a:hover { color: var(--or); }

/* ----------------------- Reveal -------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; }

/* ----------------------- Responsive ---------------------- */
@media (min-width: 861px) {
  /* === PC v2 — formulaire centré épuré, sans visuel === */
  .auth__aside { display: none !important; }
  .auth {
    display: grid !important;
    grid-template-columns: 1fr !important;
    place-items: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% -10%, #181818, var(--noir) 72%);
    padding: 3rem 1.5rem;
  }
  .auth__panel { width: 100%; max-width: 440px; padding: 0; background: transparent; }
  .auth__box {
    width: 100%; max-width: 100%; background: transparent; border: none;
    border-radius: 0; box-shadow: none; padding: 0;
  }
  .auth__box::before {
    content: "Fenris Wedding"; display: block; font-family: var(--ff-display);
    font-size: 1.3rem; font-weight: 500; letter-spacing: 0.1em; color: var(--ivoire);
    padding-bottom: 1.6rem; margin-bottom: 1.9rem;
    border-bottom: 1px solid rgba(198,164,92,0.16);
  }
  .auth__title { font-size: clamp(2.6rem, 3.6vw, 3.4rem); }
  .auth__sub { font-size: 1rem; margin-bottom: 2.6rem; }
  .auth__form { gap: 1.7rem; }
  .field input { font-size: 1.05rem; padding: 0.9rem 0.1rem; }
  .auth__foot { margin-top: 2.4rem; }
  .auth__back { position: static; display: block; text-align: center; margin-top: 2.6rem; }
}
@media (max-width: 860px) {
  .nav__burger { display: flex; z-index: 1003; }
  .nav__links { position: fixed; inset: 0; height: 100vh; z-index: 1002; flex-direction: column; justify-content: center; gap: 2rem; background: rgba(11,11,11,0.97); backdrop-filter: blur(10px); transform: translateX(100%); transition: transform 0.55s var(--ease); padding: 2rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .nav__links.is-open { transform: translateX(0); }
  .nav__links a { font-size: 1rem; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { min-height: 38vh; }
  .auth__back { color: var(--gris-clair); }
}
@media (max-width: 480px) {
  .auth__aside { min-height: 30vh; }
  .auth__quote p { font-size: 1.8rem; }
}

/* ----------------------- Reduced motion ------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor, .cursor-dot { display: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}