/* ================================================
   Kroustie — auth.css
   Styles partagés pour toutes les pages d'auth
================================================ */

body.kroustie-auth {
  font-family: 'DM Sans', sans-serif;
  background: var(--fond);
  color: var(--brun);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
}

/* ── Layout ─────────────────────────────────── */

.k-auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
  min-height: 100vh;
}

.k-auth__card {
  background: #fff;
  border-radius: 1.5rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 4px 40px rgba(46, 26, 14, 0.08);
}

/* ── Logo ───────────────────────────────────── */

.k-auth__logo {
  text-align: center;
  margin-bottom: 2rem;
}

.k-auth__logo a {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--terre);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.k-auth__logo a span { color: var(--olive); }

.k-auth__tagline {
  text-align: center;
  font-size: 0.85rem;
  color: #6B5544;
  margin-top: -1.4rem;
  margin-bottom: 2rem;
  font-weight: 300;
}

/* ── Titres ─────────────────────────────────── */

.k-auth__title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brun);
  margin-bottom: 0.4rem;
}

.k-auth__subtitle {
  font-size: 0.9rem;
  color: #6B5544;
  font-weight: 300;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* ── Icône page ─────────────────────────────── */

.k-auth__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(90, 106, 58, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
}

/* ── Formulaire ─────────────────────────────── */

.k-form-group {
  margin-bottom: 1rem;
}

.k-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brun);
  margin-bottom: 0.4rem;
}

.k-form-group input[type="text"],
.k-form-group input[type="email"],
.k-form-group input[type="password"],
.k-form-group input[type="date"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid #E8E4DF;
  border-radius: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--brun);
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
  box-sizing: border-box;
}

.k-form-group input:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(90, 106, 58, 0.08);
}

.k-form-group input.k-input--error {
  border-color: #D93025;
}

.k-field-error {
  font-size: 0.8rem;
  color: #D93025;
  margin-top: 0.3rem;
  display: none;
}

.k-field-error.visible { display: block; }

.k-form-group--password {
  position: relative;
}

.k-form-group--password input {
  padding-right: 3rem;
}

.k-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #ABA6A0;
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

.k-password-toggle:hover { color: var(--olive); }

/* ── Force mot de passe ─────────────────────── */

.k-password-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.k-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #E8E4DF;
  transition: background 0.3s;
}

.k-strength-bar.weak   { background: #D93025; }
.k-strength-bar.medium { background: #F59E0B; }
.k-strength-bar.strong { background: var(--olive); }

/* ── Date de naissance ──────────────────────── */

.k-dob-picker {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid #E8E4DF;
  border-radius: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--brun);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
  outline: none;
  box-sizing: border-box;
  appearance: none;
}

.k-dob-picker:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(90, 106, 58, 0.08);
}

/* ── CGU Checkbox ───────────────────────────── */

.k-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.k-checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--olive);
  margin-top: 2px;
  cursor: pointer;
}

.k-checkbox-group label {
  font-size: 0.88rem;
  color: #6B5544;
  line-height: 1.5;
  cursor: pointer;
}

.k-checkbox-group a {
  color: var(--olive);
  text-decoration: underline;
}

/* ── Boutons ────────────────────────────────── */

.k-auth__btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--olive);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.k-auth__btn:hover { background: var(--brun); }
.k-auth__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.k-auth__btn--google {
  background: #fff;
  color: var(--brun);
  border: 1.5px solid #E8E4DF;
}

.k-auth__btn--google:hover {
  background: #F7F5F2;
  border-color: #d0cbc4;
}

.k-auth__btn--google svg {
  width: 20px;
  height: 20px;
}

/* ── Divider ────────────────────────────────── */

.k-auth__divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  color: #ABA6A0;
  font-size: 0.85rem;
}

.k-auth__divider::before,
.k-auth__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E8E4DF;
}

/* ── Liens ──────────────────────────────────── */

.k-auth__links {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.88rem;
  color: #6B5544;
}

.k-auth__links a {
  color: var(--olive);
  font-weight: 500;
  text-decoration: none;
}

.k-auth__links a:hover { text-decoration: underline; }

.k-auth__forgot {
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.k-auth__forgot a {
  font-size: 0.85rem;
  color: #6B5544;
  text-decoration: none;
}

.k-auth__forgot a:hover { color: var(--olive); }

/* ── Erreur / succès globaux ────────────────── */

.k-alert {
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}

.k-alert--error {
  background: rgba(217, 48, 37, 0.08);
  color: #D93025;
  border: 1px solid rgba(217, 48, 37, 0.2);
}

.k-alert--success {
  background: rgba(90, 106, 58, 0.08);
  color: var(--olive);
  border: 1px solid rgba(90, 106, 58, 0.2);
}

/* ── OTP ────────────────────────────────────── */

.k-otp {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.k-otp__input {
  width: 48px !important;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--olive);
  border: 1.5px solid #E8E4DF;
  border-radius: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  padding: 0 !important;
}

.k-otp__input:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(90, 106, 58, 0.08);
}

/* ── Spinner ────────────────────────────────── */

.k-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: k-spin 0.7s linear infinite;
  display: none;
}

.k-spinner--dark {
  border-color: rgba(90,106,58,0.3);
  border-top-color: var(--olive);
}

@keyframes k-spin { to { transform: rotate(360deg); } }

/* ── Nav auth ───────────────────────────────── */

.k-auth-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(253, 248, 240, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(196, 92, 42, 0.1);
}

.k-auth-nav__logo {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--terre);
  text-decoration: none;
}

.k-auth-nav__logo span { color: var(--olive); }

.k-auth-nav__back {
  font-size: 0.88rem;
  color: #6B5544;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.k-auth-nav__back:hover { color: var(--olive); }

/* ── Responsive ─────────────────────────────── */

@media (max-width: 480px) {
  .k-auth__card {
    padding: 1.8rem 1.4rem;
    border-radius: 1.2rem;
  }
  .k-otp { gap: 0.35rem; }
  .k-otp__input { width: 42px !important; height: 50px; font-size: 1.2rem; }
}