/**
 * Styles pour la page de login/inscription/mot de passe oublie
 * Fichier : assets/css/login.css
 */

:root {
  --yidp-primary: #2d2d86;
  --yidp-primary-dark: #2a3d9e;
  --yidp-secondary: #344bc1;
  --yidp-sub: #ffd700;
  --yidp-success: #10b981;
  --yidp-muted: #64748b;
  --yidp-light: #f8fafc;
  --yidp-border: #e2e8f0;
  --yidp-text: #1a1a2e;
  --yidp-site-bg: #fff9f3;
}

/* ========================================
   LAYOUT — split screen
   Gauche : panneau decoratif (via ::before)
   Droite : formulaire
======================================== */
body.login {
  background: #fff;
  color: var(--yidp-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body.login::before {
  content: "";
  display: block;
  width: 45%;
  min-height: 100vh;
  flex-shrink: 0;
  position: relative;
  /* Base gradient */
  background-color: var(--yidp-primary);
  background-image:
    /* Grain / noise via SVG inline */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E"),
    /* Diagonales fines — hachures presse */
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.04) 8px,
      rgba(255, 255, 255, 0.04) 9px
    ),
    /* Diagonales croisees */
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 14px,
      rgba(255, 255, 255, 0.025) 14px,
      rgba(255, 255, 255, 0.025) 15px
    ),
    /* Gradient de fond */
    linear-gradient(
      160deg,
      var(--yidp-primary) 0%,
      var(--yidp-primary-dark) 50%,
      var(--yidp-secondary) 100%
    );
}

body.login::after {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  width: 45%;
  height: 100vh;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 520' fill='none'%3E%3C!-- Journal page --%3E%3Crect x='60' y='40' width='280' height='380' rx='2' fill='white' fill-opacity='0.07'/%3E%3Crect x='60' y='40' width='280' height='380' rx='2' stroke='white' stroke-opacity='0.12' stroke-width='1.5'/%3E%3C!-- Masthead --%3E%3Crect x='80' y='60' width='240' height='2' fill='white' fill-opacity='0.15'/%3E%3Crect x='120' y='72' width='160' height='14' rx='1' fill='white' fill-opacity='0.12'/%3E%3Crect x='155' y='92' width='90' height='6' rx='1' fill='white' fill-opacity='0.06'/%3E%3Crect x='80' y='106' width='240' height='1' fill='white' fill-opacity='0.1'/%3E%3C!-- Headline --%3E%3Crect x='80' y='120' width='240' height='10' rx='1' fill='white' fill-opacity='0.13'/%3E%3Crect x='80' y='136' width='200' height='10' rx='1' fill='white' fill-opacity='0.13'/%3E%3C!-- Subtitle --%3E%3Crect x='80' y='156' width='180' height='5' rx='1' fill='white' fill-opacity='0.07'/%3E%3C!-- Image placeholder --%3E%3Crect x='80' y='174' width='240' height='90' rx='1' fill='white' fill-opacity='0.05'/%3E%3Cpath d='M175 219 L195 199 L215 224 L230 212 L250 234 H150Z' fill='white' fill-opacity='0.06'/%3E%3Ccircle cx='260' cy='196' r='12' fill='white' fill-opacity='0.06'/%3E%3C!-- Two columns of text --%3E%3Crect x='80' y='278' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='288' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='298' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='308' width='90' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='318' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='328' width='100' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='338' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='348' width='75' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='278' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='288' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='298' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='308' width='95' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='318' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='328' width='80' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='338' width='112' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3Crect x='208' y='348' width='100' height='4' rx='0.5' fill='white' fill-opacity='0.08'/%3E%3C!-- Column separator --%3E%3Crect x='199' y='278' width='1' height='76' fill='white' fill-opacity='0.06'/%3E%3C!-- Bottom rule --%3E%3Crect x='80' y='366' width='240' height='1' fill='white' fill-opacity='0.08'/%3E%3Crect x='80' y='376' width='150' height='5' rx='0.5' fill='white' fill-opacity='0.06'/%3E%3Crect x='80' y='388' width='240' height='4' rx='0.5' fill='white' fill-opacity='0.05'/%3E%3Crect x='80' y='398' width='200' height='4' rx='0.5' fill='white' fill-opacity='0.05'/%3E%3C!-- Lock overlay --%3E%3Ccircle cx='200' cy='450' r='18' fill='white' fill-opacity='0.08'/%3E%3Crect x='191' y='448' width='18' height='14' rx='2' stroke='white' stroke-opacity='0.15' stroke-width='1.5' fill='none'/%3E%3Cpath d='M194 448 V443 A6 6 0 0 1 206 443 V448' stroke='white' stroke-opacity='0.15' stroke-width='1.5' fill='none'/%3E%3C!-- Second page behind (offset) --%3E%3Crect x='72' y='50' width='280' height='380' rx='2' fill='none' stroke='white' stroke-opacity='0.04' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% auto;
}

/* Conteneur principal — pousse a droite */
#login {
  width: 55%;
  max-width: none;
  margin: 0;
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

/* ========================================
   LOGO / HEADER
======================================== */
.login h1 {
  margin: 0 0 8px;
}

.login h1 a {
  background-image: none !important;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--yidp-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ========================================
   FORM BOX
======================================== */
.login form {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin-top: 0;
  padding: 0;
}

/* Titre implicite via le label du premier champ */
.login form p:first-child {
  margin-top: 0;
}

/* Labels */
.login label {
  color: var(--yidp-text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.login form .forgetmenot label {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 10px;
}

/* Inputs */
.login form input[type="text"],
.login form input[type="email"],
.login form input[type="password"] {
  background: var(--yidp-site-bg);
  border: 2px solid transparent;
  border-radius: 0;
  color: var(--yidp-text);
  font-size: 15px;
  padding: 12px 16px;
  box-shadow: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  margin-top: 6px;
}

.login form input[type="text"]:focus,
.login form input[type="email"]:focus,
.login form input[type="password"]:focus {
  border-color: var(--yidp-primary);
  background: #fff;
  box-shadow: none;
  outline: none;
}

/* Password wrapper — eye icon alignment */
.login .wp-pwd {
  position: relative;
}

/* ========================================
   SUBMIT BUTTON
======================================== */
.login form .submit {
  margin-top: 8px;
}

.login form .submit .button-primary,
.login form .submit input[type="submit"],
.login .wp-core-ui .button-primary {
  background: var(--yidp-primary) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 28px;
  height: auto;
  line-height: 1;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.login form .submit .button-primary:hover,
.login form .submit input[type="submit"]:hover,
.login .wp-core-ui .button-primary:hover {
  background: var(--yidp-primary-dark) !important;
}

.login form .submit .button-primary:active,
.login form .submit input[type="submit"]:active {
  transform: translateY(1px);
}

.login form .submit .button-primary:focus,
.login form .submit input[type="submit"]:focus,
.login .wp-core-ui .button-primary:focus {
  background: var(--yidp-primary) !important;
  box-shadow: none !important;
  outline: 2px solid var(--yidp-secondary);
  outline-offset: 2px;
}

/* ========================================
   MESSAGES (erreurs, infos)
======================================== */
#login_error,
.login .message,
.login .success {
  border: none;
  border-left: 4px solid var(--yidp-border);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--yidp-text);
  background: var(--yidp-site-bg);
  margin: 0 0 20px;
}

#login_error {
  border-left-color: #dc2626;
  background: #fef2f2;
}

#login_error a {
  color: #dc2626;
  font-weight: 600;
}

.login .message {
  border-left-color: var(--yidp-secondary);
  background: #eef2ff;
}

.login .success {
  border-left-color: var(--yidp-success);
  background: #ecfdf5;
}

/* ========================================
   LINKS (nav, back to blog)
======================================== */
.login #nav,
.login #backtoblog {
  text-align: left;
  padding: 0;
  margin: 12px 0 0;
}

.login #nav a,
.login #backtoblog a {
  color: var(--yidp-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.login #nav a:hover,
.login #backtoblog a:hover {
  color: var(--yidp-primary);
}

/* Separateur entre les liens nav */
.login #nav {
  font-size: 13px;
  color: var(--yidp-border);
}

/* ========================================
   PRIVACY POLICY LINK
======================================== */
.login .privacy-policy-page-link {
  margin-top: 24px;
  text-align: left;
}

.login .privacy-policy-page-link a {
  color: var(--yidp-muted);
  font-size: 12px;
}

.login .privacy-policy-page-link a:hover {
  color: var(--yidp-primary);
}

/* ========================================
   LANGUAGE SWITCHER (WP 5.9+)
======================================== */
.language-switcher {
  border: 2px solid var(--yidp-site-bg);
  border-radius: 0;
  background: var(--yidp-site-bg);
  box-shadow: none;
}

/* ========================================
   PASSWORD VISIBILITY TOGGLE
======================================== */
.login .button.wp-hide-pw {
  color: var(--yidp-muted);
  border: none;
  background: none;
  box-shadow: none;
  height: auto;
  top: 0;
  right: 0;
  padding: 12px 14px;
}

.login .button.wp-hide-pw:hover {
  color: var(--yidp-primary);
  background: none;
}

.login .button.wp-hide-pw:focus {
  color: var(--yidp-primary);
  box-shadow: none;
  outline: none;
}

/* ========================================
   CHECKBOX (Remember me)
======================================== */
.login input[type="checkbox"] {
  border-radius: 0;
  border: 2px solid var(--yidp-border);
  box-shadow: none;
}

.login input[type="checkbox"]:checked {
  background: var(--yidp-primary);
  border-color: var(--yidp-primary);
}

.login input[type="checkbox"]:focus {
  border-color: var(--yidp-primary);
  box-shadow: none;
  outline: none;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 960px) {
  body.login::before {
    width: 35%;
  }

  body.login::after {
    width: 35%;
    font-size: 32px;
  }

  #login {
    width: 65%;
    padding: 40px 48px;
  }
}

@media (max-width: 680px) {
  body.login::before,
  body.login::after {
    display: none;
  }

  #login {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 24px;
  }

  .login h1 a {
    text-align: center;
    display: block;
  }

  .login #nav,
  .login #backtoblog {
    text-align: center;
  }

  .login .privacy-policy-page-link {
    text-align: center;
  }
}

/* ========================================
   INTERIM LOGIN (modal) — reset split
======================================== */
.interim-login {
  display: block !important;
  background: var(--yidp-site-bg) !important;
}

.interim-login::before,
.interim-login::after {
  display: none !important;
}

.interim-login #login {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 24px;
}

.interim-login #login_error,
.interim-login .message {
  margin-bottom: 16px;
}
