/* ═══════════════════════════════════════════════════════════
   WP Auth Shortcodes — v2.0 (email/phone login + social sign-in)
   Style aligned with the "Mon compte" wireframe: bordered inputs,
   social buttons, newsletter box. Vertical "-ou-" separator between
   the two columns is handled by the theme, not this plugin.
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --wpas-bg:            #f8f8f6;
  --wpas-surface:       #ffffff;
  --wpas-border:        #e2e2df;
  --wpas-border-b:      rgba(0, 0, 0, 0.18);
  --wpas-border-hover:  #b9b9b4;
  --wpas-border-focus:  #1a1a1a;
  --wpas-text:          #1a1a1a;
  --wpas-text-muted:    #6b6b6b;
  --wpas-text-faint:    #a5a5a0;
  --wpas-primary:       #3a3a3a;
  --wpas-primary-h:     #1f1f1f;
  --wpas-error:         #b91c1c;
  --wpas-error-bg:      #fef2f2;
  --wpas-success:       #15803d;
  --wpas-success-bg:    #f0fdf4;
  --wpas-newsletter-bg: #f6f6f4;
  --wpas-transition:    160ms cubic-bezier(0.16, 1, 0.3, 1);

  --wpas-str-1: #ef4444;
  --wpas-str-2: #f97316;
  --wpas-str-3: #eab308;
  --wpas-str-4: #22c55e;
  --wpas-str-5: #16a34a;
}

/* ── Wrapper ───────────────────────────────────────────────── */
.wpas-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Card: flat, transparent — sits inside the theme's account layout */
.wpas-card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0;
  width: 100%;
  max-width: 420px;
}

/* ── Column head (icon lives in the theme; here: title + subtitle) ── */
.wpas-col-head {
  text-align: center;
  margin-bottom: 26px;
}

.wpas-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--wpas-text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.wpas-subtitle {
  font-size: 14px;
  color: var(--wpas-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Notices ───────────────────────────────────────────────── */
.wpas-messages:empty { display: none; }

.wpas-notice {
  font-size: 14px;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.45;
}
.wpas-notice--error   { background: var(--wpas-error-bg);   color: var(--wpas-error);   font-weight: 500; }
.wpas-notice--success { background: var(--wpas-success-bg); color: var(--wpas-success); }

/* ── Form ──────────────────────────────────────────────────── */
.wpas-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wpas-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wpas-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--wpas-text);
  letter-spacing: 0.005em;
}

/* ── Inputs — bordered box (matches the wireframe) ─────────── */
.wpas-input {
  width: 100% !important;
  height: 44px !important;
  padding: 0 14px !important;
  font-size: 15px !important;
  color: var(--wpas-text) !important;
  background: var(--wpas-surface) !important;
  border: 1px solid var(--wpas-border) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color var(--wpas-transition), box-shadow var(--wpas-transition) !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
}

.wpas-input::placeholder { color: var(--wpas-text-faint) !important; }

.wpas-input:hover { border-color: var(--wpas-border-hover) !important; }

.wpas-input:focus,
.wpas-input:focus-visible {
  border-color: var(--wpas-border-focus) !important;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08) !important;
}

/* ── Input + icon wrapper (password) ───────────────────────── */
.wpas-input-icon { position: relative; }
.wpas-input-icon .wpas-input { padding-right: 46px !important; }

.wpas-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 0 !important;
  transition: opacity var(--wpas-transition);
  opacity: 0.45;
  color: var(--wpas-text);
}
.wpas-pw-toggle:hover { opacity: 1; }
.wpas-pw-toggle:focus-visible {
  outline: 2px solid var(--wpas-primary);
  outline-offset: 2px;
}
.wpas-eye-open,
.wpas-eye-closed {
  stroke: currentColor !important;
  fill: transparent !important;
}

/* ── Select ("Vous êtes") ──────────────────────────────────── */
.wpas-select-wrap { position: relative; }
.wpas-select {
  padding-right: 40px !important;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
}

/* ── Password strength ─────────────────────────────────────── */
.wpas-strength-bar {
  height: 3px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.wpas-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.wpas-strength-fill[data-score="1"] { width: 20%;  background: var(--wpas-str-1); }
.wpas-strength-fill[data-score="2"] { width: 40%;  background: var(--wpas-str-2); }
.wpas-strength-fill[data-score="3"] { width: 65%;  background: var(--wpas-str-3); }
.wpas-strength-fill[data-score="4"] { width: 85%;  background: var(--wpas-str-4); }
.wpas-strength-fill[data-score="5"] { width: 100%; background: var(--wpas-str-5); }

.wpas-strength-label {
  font-size: 12px;
  color: var(--wpas-text-muted);
  margin-top: 4px;
  display: block;
  min-height: 14px;
}

.wpas-pw-match-msg {
  font-size: 12px;
  display: block;
  min-height: 14px;
  margin-top: 2px;
}
.wpas-pw-match-msg.ok  { color: var(--wpas-success); }
.wpas-pw-match-msg.err { color: var(--wpas-error); }

/* ── Inline row: Remember me + Forgot password ─────────────── */
.wpas-field--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wpas-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--wpas-text-muted);
  cursor: pointer;
  user-select: none;
}
.wpas-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--wpas-primary);
  cursor: pointer;
}
.wpas-link-forgot {
  font-size: 14px;
  color: var(--wpas-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  transition: border-color var(--wpas-transition);
}
.wpas-link-forgot:hover { border-color: var(--wpas-text); }

/* ── Newsletter box ────────────────────────────────────────── */
.wpas-newsletter {
  background: var(--wpas-newsletter-bg);
  border: 1px solid var(--wpas-border);
  border-radius: 8px;
  padding: 14px 16px;
}
.wpas-newsletter__label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}
.wpas-newsletter__label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--wpas-primary);
  cursor: pointer;
}
.wpas-newsletter__body {
  display: block;
  font-size: 13px;
  color: var(--wpas-text-muted);
  line-height: 1.5;
}
.wpas-newsletter__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--wpas-text);
  margin-bottom: 4px;
}
.wpas-newsletter__text { display: block; }
.wpas-newsletter__link {
  display: inline-block;
  margin-top: 6px;
  color: var(--wpas-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── reCAPTCHA ─────────────────────────────────────────────── */
.wpas-recaptcha { margin-top: 2px; }

/* ── Primary button ────────────────────────────────────────── */
.wpas-btn {
  display: block;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--wpas-transition), opacity var(--wpas-transition), transform var(--wpas-transition);
  letter-spacing: 0.01em;
  margin-top: 4px;
}
.wpas-btn--primary { background: var(--wpas-primary); color: #ffffff; }
.wpas-btn--primary:hover  { background: var(--wpas-primary-h); }
.wpas-btn--primary:active { transform: translateY(1px); }
.wpas-btn--primary:disabled { opacity: 0.6; cursor: default; transform: none; }
.wpas-btn--primary:focus-visible {
  outline: 2px solid var(--wpas-primary);
  outline-offset: 3px;
}

/* ── "or continue with" separator ──────────────────────────── */
.wpas-social-sep {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--wpas-text-faint);
  font-size: 13px;
}
.wpas-social-sep::before,
.wpas-social-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--wpas-border);
}

/* ── Social buttons ────────────────────────────────────────── */
.wpas-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.wpas-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--wpas-border);
  border-radius: 8px;
  background: var(--wpas-surface);
  color: var(--wpas-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--wpas-transition), background var(--wpas-transition);
}
.wpas-social-btn:hover {
  border-color: var(--wpas-border-hover);
  background: #fafafa;
}
.wpas-social-btn:focus-visible {
  outline: 2px solid var(--wpas-primary);
  outline-offset: 2px;
}
/* Icon pinned left, label optically centered — matches the wireframe */
.wpas-social-btn__icon {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
}
.wpas-social-icon { display: block; }

/* ── Form footer / links (forgot & reset screens) ──────────── */
.wpas-form-footer {
  text-align: center;
  font-size: 14px;
  color: var(--wpas-text-muted);
  margin-top: 10px;
}
.wpas-form-footer a {
  color: var(--wpas-text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  transition: border-color var(--wpas-transition);
}
.wpas-form-footer a:hover { border-color: var(--wpas-text); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 460px) {
  .wpas-field--inline { flex-direction: column; align-items: flex-start; gap: 12px; }
}
