/* ============================================================
   auth.css — Olive Pro — Style épuré mobile-first
   ============================================================ */

   :root {
    --green:       #3a6147;
    --green-dark:  #2d4f39;
    --gold:        #C8A951;
    --bg:          #F0EDE6;
    --white:       #FFFFFF;
    --text:        #1a1a1a;
    --muted:       #777;
    --border:      rgba(58,97,71,0.20);
    --radius-lg:   20px;
    --radius-md:   14px;
    --radius-sm:   10px;
    --shadow:      0 8px 32px rgba(58,97,71,0.12);
    --font:        'Inter', sans-serif;
    --font-ar:     'Tajawal', sans-serif;
  }
  
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  
  html, body {
    height: 100%;
    background: var(--bg);
    font-family: var(--font);
    color: var(--text);
    overflow-x: clip;
  }
  
  [dir="rtl"] * { font-family: var(--font-ar); }
  
  /* ── BOUTON LANGUE ── */
  .lang-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999;
    background: var(--white);
    color: var(--green);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
  }
  [dir="rtl"] .lang-btn { right: auto; left: 16px; }
  
  /* ── ÉCRANS ── */
  .screen {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .screen.active { display: flex; }
  
  /* ── ÉCRAN ACCUEIL ── */
  .home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 380px;
    width: 100%;
    gap: 0;
    padding: 40px 24px 32px;
  }
  
  .logo-wrap {
    margin-bottom: 24px;
  }
  
  .logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
  }
  
  .logo-emoji {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 0;
  }
  
  .app-name {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text);
    margin-bottom: 10px;
  }
  
  .app-tagline {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 280px;
  }
  
  .home-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
  }
  
  /* ── BOUTONS ── */
  .btn-solid {
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s ease;
    letter-spacing: 0.3px;
  }
  .btn-solid:hover { background: var(--green-dark); transform: translateY(-1px); }
  .btn-solid:active { transform: translateY(0); }
  .btn-solid.full { width: 100%; }
  .btn-solid:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
  
  .btn-outline {
    background: transparent;
    color: var(--green);
    border: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s ease;
  }
  .btn-outline:hover { background: rgba(200,169,81,0.08); }
  
  /* ── POINTS DE STATUT ── */
  .status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
  }
  .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
  }
  .dot:first-child { margin-left: 0; }
  .dot.green  { background: #4CAF50; }
  .dot.grey   { background: #aaa; }
  .dot.gold   { background: var(--gold); }
  
  .home-footer {
    font-size: 13px;
    color: #bbb;
    font-style: italic;
  }
  
  /* ── FORMULAIRE CONNEXION ── */
  .form-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
  }
  
  .btn-back {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    padding: 0;
    font-family: inherit;
    width: fit-content;
  }
  .btn-back:hover { color: var(--green); }
  
  .logo-small {
    font-size: 40px;
    text-align: center;
  }
  
  .form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
  }
  
  .form-sub {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin-top: -8px;
  }
  
  /* ── ONGLETS ── */
  .tabs {
    display: flex;
    background: #f5f2ec;
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
  }
  .tab {
    flex: 1;
    padding: 9px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--muted);
    cursor: pointer;
    transition: 0.2s;
  }
  .tab.active {
    background: var(--white);
    color: var(--green);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }
  
  /* ── CHAMPS ── */
  .form-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .field {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e8e3da;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #faf9f6;
    outline: none;
    transition: 0.2s;
  }
  .field:focus {
    border-color: var(--green);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(58,97,71,0.10);
  }
  
  .otp-field {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 12px;
    color: var(--green);
  }
  
  /* ── MESSAGE ── */
  .msg {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
  }
  .msg.error   { background: #FEE2E2; color: #DC2626; }
  .msg.success { background: #e8f0e9; color: var(--green-dark); }
  
  .link-center {
    text-align: center;
    font-size: 13px;
    color: var(--green);
    text-decoration: none;
  }
  .link-center:hover { text-decoration: underline; }
  /* ── AJOUTS NOUVEAUX ÉCRANS ── */
.scrollable {
    max-height: 92vh;
    overflow-y: auto;
  }
  
  .input-group {
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .input-prefix {
    position: absolute;
    left: 14px;
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
  }
  
  [dir="rtl"] .input-prefix { left: auto; right: 14px; }
  
  .field.with-prefix { padding-left: 42px; }
  [dir="rtl"] .field.with-prefix { padding-left: 14px; padding-right: 42px; }
  
  .input-row {
    display: flex;
    gap: 10px;
  }
  .input-row .field { flex: 1; }
  
  .select-field {
    cursor: pointer;
    color: #555;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
  }
  
  .btn-outline.full { width: 100%; }
  
  .pending-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #FEF9EC;
    border: 1px solid #C8A951;
    border-radius: 10px;
    padding: 14px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
  }
  
  .pending-info span { font-size: 20px; flex-shrink: 0; }
  .link-btn {
    background: none;
    border: none;
    color: var(--green);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: 4px;
    text-decoration: underline;
  }
  .link-btn:hover { color: var(--green-dark); }
  
  textarea.field {
    padding: 12px 16px;
    line-height: 1.5;
    font-family: inherit;
  }
  
/* ════════════════════════════════════════════════════════════
   RTL — Support arabe (auth.css)
   Fix langue arabe v1
   ════════════════════════════════════════════════════════════ */

[dir="rtl"],
[dir="rtl"] * {
  font-family: 'Tajawal', 'Inter', sans-serif !important;
}

/* Bouton langue — position miroir */
[dir="rtl"] .lang-btn {
  right: auto;
  left: 16px;
}

/* Formulaires */
[dir="rtl"] .form-container { direction: rtl; text-align: right; }
[dir="rtl"] .field           { text-align: right; direction: rtl; }
[dir="rtl"] .form-title      { text-align: right; }
[dir="rtl"] .form-sub        { text-align: right; }
[dir="rtl"] .btn-back        { text-align: right; }

/* Input avec préfixe — inverser position */
[dir="rtl"] .input-prefix          { left: auto; right: 14px; }
[dir="rtl"] .field.with-prefix     { padding-left: 14px; padding-right: 42px; }

/* Input row */
[dir="rtl"] .input-row { flex-direction: row-reverse; }

/* Liens */
[dir="rtl"] .link-center { text-align: center; }

/* Pending info */
[dir="rtl"] .pending-info { flex-direction: row-reverse; text-align: right; }

/* Boutons */
[dir="rtl"] .btn-solid,
[dir="rtl"] .btn-outline { direction: rtl; }

/* Select — chevron côté gauche en RTL */
[dir="rtl"] .select-field {
  background-position: left 14px center;
  padding-left: 36px;
  padding-right: 16px;
}

/* Écran accueil */
[dir="rtl"] .home-container { direction: rtl; }
[dir="rtl"] .status-row     { flex-direction: row-reverse; justify-content: center; }

/* Messages */
[dir="rtl"] .msg { direction: rtl; text-align: right; }

/* Accessibilité — labels sr-only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
