/*
 * Pont wp-login.php ⇄ charte myDYCAST
 * ────────────────────────────────────
 * WordPress rend une page de connexion à structure fixée
 * (`body.login > #login > h1 + form#loginform + p#nav + p#backtoblog`).
 * On la reformate pour épouser la mise en page de my.dycast.fr :
 *   - split-screen avec volet gauche `.dy-auth` (posé par le mu-plugin via
 *     `login_footer`), carte à droite ;
 *   - fond ambiant `.ambient-bg .orb` ;
 *   - carte `.auth-card` autour de `#login`, champs et bouton restylés en
 *     `.form-control` / `.btn.btn-primary.btn-lg`.
 * Les tokens (couleurs, radius, ombres, polices) viennent de main.css et
 * charte.css, servis à côté par le mu-plugin — ce fichier ne fait que poser
 * les règles propres à WordPress.
 */

/* ── Reset des débords WordPress ─────────────────────────────────────── */
html { background: transparent !important; }
body.login {
  background: var(--bg-page, #fafaf8) !important;
  color: var(--text, #0c0c0b);
  font-family: 'Inter', 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}
body.login #login { padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; }
body.login #login_error, body.login .message, body.login .success {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 14px;
  box-shadow: none;
  background: color-mix(in oklab, var(--danger, #d94a4a) 8%, transparent);
  color: var(--danger, #d94a4a);
  border-left: 3px solid var(--danger, #d94a4a);
}
body.login .message, body.login .success {
  background: color-mix(in oklab, var(--success, #2f855a) 8%, transparent);
  color: var(--success, #2f855a);
  border-left-color: var(--success, #2f855a);
}

/* ── Mise en page : split-screen ≥ 980 px ───────────────────────────── */
body.login {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  position: relative;
}
body.login > .dy-auth {
  position: fixed;
  inset: 0 auto 0 0;
  width: 50%;
  max-width: 640px;
  z-index: 1;
}
body.login > .ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
body.login > .ambient-bg .orb {
  position: absolute;
  right: 12%;
  top: 30%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, color-mix(in oklab, var(--accent, #ff5c1f) 22%, transparent), transparent 60%);
  filter: blur(60px);
  animation: dy-orb 14s ease-in-out infinite alternate;
}
@keyframes dy-orb { to { transform: translate(-40px, 30px) scale(1.08); } }

body.login #login {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: 0 auto !important;
  padding: 48px 24px !important;
  align-self: center;
}

@media (min-width: 980px) {
  body.login #login {
    margin-left: max(50%, 640px) !important;
    margin-right: auto !important;
    padding: 64px 48px !important;
  }
}
@media (max-width: 979px) {
  body.login > .dy-auth { display: none; }
  body.login > .ambient-bg .orb { right: -30%; top: 10%; width: 380px; height: 380px; }
}

/* ── Carte de connexion : #login devient .auth-card ─────────────────── */
body.login #login {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, rgba(12, 12, 11, 0.08));
  border-radius: 20px;
  box-shadow: 0 10px 40px -12px rgba(12, 12, 11, 0.12), 0 2px 8px -4px rgba(12, 12, 11, 0.06);
  padding: 40px 36px !important;
  max-width: 440px !important;
}
@media (min-width: 980px) {
  body.login #login {
    margin-left: calc(50% + 32px) !important;
    padding: 48px 44px !important;
  }
}

/* ── En-tête : logo + baseline (posé par login_message) ─────────────── */
body.login #login h1 { text-align: center; margin: 0 0 8px; }
body.login #login h1 a {
  background-image: none !important;
  text-indent: 0 !important;
  overflow: visible !important;
  height: auto !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Sans', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--text, #0c0c0b) !important;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;
}
body.login #login h1 a img.dy-site-logo {
  max-width: 200px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}
body.login .dy-login-baseline {
  text-align: center;
  color: var(--text-muted, #6a6a63);
  font-size: 13px;
  margin: 6px 0 26px;
}

/* ── Formulaire ─────────────────────────────────────────────────────── */
body.login form {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.login form p { margin: 0 0 14px; }
body.login form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft, #45453f);
  margin: 0 0 6px;
}
body.login form .input,
body.login form input[type="text"],
body.login form input[type="email"],
body.login form input[type="password"],
body.login form input[type="tel"],
body.login form input[type="url"],
body.login form input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(12, 12, 11, 0.12));
  border-radius: 10px;
  background: var(--input-bg, #fafaf8);
  color: var(--text, #0c0c0b);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
  box-shadow: none;
}
body.login form input:focus {
  outline: none;
  border-color: var(--accent, #ff5c1f);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #ff5c1f) 20%, transparent);
}
body.login .forgetmenot { display: flex; align-items: center; gap: 8px; margin: 16px 0 20px; font-size: 13px; color: var(--text-soft); }
body.login .forgetmenot input { margin: 0; }

/* ── Bouton principal ────────────────────────────────────────────────── */
body.login .submit { text-align: center; margin: 0; }
body.login input[type="submit"],
body.login .button-primary {
  width: 100%;
  min-height: 46px;
  padding: 12px 20px !important;
  background: var(--accent, #ff5c1f) !important;
  color: #fff !important;
  border: 1px solid var(--accent, #ff5c1f) !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  cursor: pointer;
  text-transform: none !important;
  text-shadow: none !important;
  box-shadow: 0 1px 3px rgba(255, 92, 31, 0.15) !important;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
  line-height: 1.2 !important;
  height: auto !important;
}
body.login input[type="submit"]:hover,
body.login .button-primary:hover { filter: brightness(1.05); box-shadow: 0 2px 8px rgba(255, 92, 31, 0.25) !important; }
body.login input[type="submit"]:active { transform: translateY(1px); }

/* ── Liens sous le formulaire ───────────────────────────────────────── */
body.login #nav, body.login #backtoblog {
  text-align: center;
  margin: 20px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--text-soft, #45453f);
}
body.login #nav a, body.login #backtoblog a {
  color: var(--text-soft, #45453f) !important;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
body.login #nav a:hover, body.login #backtoblog a:hover { border-bottom-color: currentColor; }

body.login .dy-footer-credit {
  text-align: center;
  margin: 32px 0 0;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--text-muted, #6a6a63);
  text-transform: uppercase;
}
body.login .dy-footer-credit a {
  color: inherit !important;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* ── Turnstile : centré et discret ──────────────────────────────────── */
body.login .dycast-turnstile,
body.login .cf-turnstile { margin: 6px 0 14px; display: flex; justify-content: center; }

/* ── Écran de sombre : suit le système, comme my.dycast.fr ──────────── */
@media (prefers-color-scheme: dark) {
  body.login:not([data-theme="light"]) {
    background: var(--bg-page-dark, #0c0c0b);
    color: var(--text-dark, #eeeee6);
  }
  body.login:not([data-theme="light"]) #login {
    background: var(--surface-dark, #151513);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.5);
  }
  body.login:not([data-theme="light"]) form input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-dark, #eeeee6);
  }
  body.login:not([data-theme="light"]) #nav a,
  body.login:not([data-theme="light"]) #backtoblog a { color: rgba(238, 238, 230, 0.7) !important; }
}

/* ── Cache le lien de langue et autres résidus du chrome WP ─────────── */
body.login .language-switcher { display: none; }
body.login .privacy-policy-page-link { text-align: center; margin-top: 12px; font-size: 12px; }
