/* ═══ Drawer FO9 mobile bottom nav ═══ */
@media (max-width: 960px) {

  /* الترتيب: bottom nav (150) < backdrop (9000) < drawer (9100) */
  .nav-backdrop { z-index: 9000 !important; }
  .nav-drawer   { z-index: 9100 !important; }

  /* منين الmenu محلول: الbottom nav كتنزل وكتخفى بأنيميشن */
  .mobile-bottom-nav {
    transition: transform .3s ease, opacity .3s ease;
  }
  body.nav-open .mobile-bottom-nav {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  /* بما أن الbottom bar خفات منين الmenu محلول،
     الdrawer ياخد الطول كامل — نقصو الpadding الزايد */
  body.nav-open .nav-drawer { padding-bottom: 40px; }
}
/* ═══ Flash messages — floating toasts ═══ */
.flash-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(480px, calc(100% - 32px));
    pointer-events: none;
}

.flash-container .alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 14px;
    background: var(--surface, #ffffff);
    box-shadow: 0 10px 34px rgba(15, 23, 42, .16);
    pointer-events: auto;
    animation: flashIn .35s cubic-bezier(.22, 1, .36, 1),
               flashOut .4s ease 5s forwards;
}

/* Icône f cercle */
.flash-container .alert > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Couleurs par type */
.flash-container .alert-success { color: #065f46; border-left: 4px solid #10b981; }
.flash-container .alert-success > span { background: #10b981; }

.flash-container .alert-error   { color: #991b1b; border-left: 4px solid #dc2626; }
.flash-container .alert-error > span   { background: #dc2626; }

.flash-container .alert-warning { color: #92400e; border-left: 4px solid #f59e0b; }
.flash-container .alert-warning > span { background: #f59e0b; }

.flash-container .alert-info    { color: #1e40af; border-left: 4px solid #3b82f6; }
.flash-container .alert-info > span    { background: #3b82f6; }

/* Animations: dkhoul men lfo9 + khoroj automatique moura 5s */
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes flashOut {
    to { opacity: 0; transform: translateY(-10px); visibility: hidden; }
}

/* Dark mode */
[data-theme="dark"] .flash-container .alert {
    background: var(--surface, #1e293b);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .4);
}
[data-theme="dark"] .flash-container .alert-success { color: #6ee7b7; }
[data-theme="dark"] .flash-container .alert-error   { color: #fca5a5; }
[data-theme="dark"] .flash-container .alert-warning { color: #fcd34d; }
[data-theme="dark"] .flash-container .alert-info    { color: #93c5fd; }

/* Mobile */
@media (max-width: 640px) {
    .flash-container { top: 14px; }
    .flash-container .alert { padding: 12px 14px; font-size: .86rem; }
}

/* ═══ Login error alert ═══ */
.auth-box .alert-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    margin: 0 0 18px;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 11px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    animation: alertSlideIn .25s ease;
}

.auth-box .alert-error::before {
    content: '⚠';
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 13px;
    color: #ffffff;
    background: #dc2626;
    border-radius: 50%;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .auth-box .alert-error {
    color: #fca5a5;
    background: rgba(220, 38, 38, .12);
    border-color: rgba(220, 38, 38, .3);
    border-left-color: #dc2626;
}
/* ════════════════════════════════════════════════════════════
   AUTH PAGES — login & register, split-screen design
   Loaded ONLY on /auth/login and /auth/register
   ════════════════════════════════════════════════════════════ */

.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--nav-height) - 40px);
}

/* ── Left panel: teal gradient with feature list ── */
.auth-left {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(500px 400px at 10% 10%, rgba(255,255,255,.12), transparent),
    radial-gradient(400px 350px at 90% 90%, rgba(255,255,255,.08), transparent);
  pointer-events: none;
}
.auth-left-content { position: relative; z-index: 1; max-width: 440px; }
.auth-left-content h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800;
  margin: 0 0 .75rem; line-height: 1.2;
}
.auth-left-content > p {
  font-size: 1rem; opacity: .92; margin: 0 0 2rem; line-height: 1.6;
}

.auth-features { list-style: none; padding: 0; margin: 0 0 2.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.auth-features li {
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .95rem; line-height: 1.5;
}

.trust-badge {
  display: inline-block; font-size: .85rem; font-weight: 600;
  color: rgba(255,255,255,.85);
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.2);
  margin: 0;
}

/* ── Right panel: form card ── */
.auth-right {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem; background: var(--bg);
}
.auth-box { width: 100%; max-width: 440px; }

.auth-back {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .88rem; font-weight: 600; color: var(--text-muted);
  text-decoration: none; margin-bottom: 2rem;
}
.auth-back:hover { color: var(--primary); }

.auth-box h1 { font-size: 1.8rem; font-weight: 800; color: var(--ink); margin: 0 0 .4rem; }
.auth-box > p { color: var(--text-muted); font-size: .95rem; margin: 0 0 1.5rem; }

/* Sign In / Sign Up tab switcher */
.auth-tabs {
  display: flex; background: var(--bg-alt); border-radius: 10px;
  padding: 4px; margin-bottom: 1.75rem;
}
.auth-tab {
  flex: 1; text-align: center; padding: .65rem; border-radius: 8px;
  font-size: .9rem; font-weight: 700; color: var(--text-muted);
  text-decoration: none; border: none; background: transparent;
  cursor: pointer; font-family: var(--font); transition: all .15s ease;
}
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-tab:not(.active):hover { color: var(--text); }

/* Form fields */
.auth-form { display: flex; flex-direction: column; }
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: .85rem; font-weight: 700;
  color: var(--ink); margin-bottom: .4rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: .7rem .9rem; font-size: .92rem; font-family: var(--font);
  background: var(--surface); color: var(--text);
  transition: border-color .15s ease;
}
.form-group input:focus { outline: none; border-color: var(--primary); }
.form-group input::placeholder { color: var(--text-light); }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 2.75rem; width: 100%; }
.toggle-pwd {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--text-light); padding: .4rem; line-height: 1;
}
.toggle-pwd:hover { color: var(--text); }

.form-link {
  display: inline-block; font-size: .82rem; font-weight: 600;
  color: var(--primary); text-decoration: none; margin-top: .4rem;
}
.form-link:hover { text-decoration: underline; }

.form-check { margin-bottom: 1.1rem; }
.form-check label {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .85rem; color: var(--text-muted); cursor: pointer; line-height: 1.5;
}
.form-check input[type="checkbox"] { margin-top: .2rem; accent-color: var(--primary); flex-shrink: 0; }
.form-check a { color: var(--primary); font-weight: 600; }

.g-recaptcha { margin-bottom: 1.1rem; }

.form-alt {
  text-align: center; font-size: .88rem; color: var(--text-muted);
  margin: 1rem 0 0;
}
.form-alt a { color: var(--primary); font-weight: 700; }

/* Divider + Google button */
.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0; color: var(--text-light); font-size: .75rem;
  font-weight: 700; letter-spacing: .04em;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: .92rem;
  padding: .75rem; border-radius: 10px; text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.btn-google:hover { border-color: var(--text-light); box-shadow: var(--shadow-sm); color: var(--text); }
.btn-google img { flex-shrink: 0; }

.auth-legal {
  text-align: center; font-size: .78rem; color: var(--text-light);
  line-height: 1.6; margin: 1.5rem 0 0;
}
.auth-legal a { color: var(--text-muted); text-decoration: underline; }

/* ── Responsive: stack on mobile, hide the teal panel ── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; min-height: auto; }
  .auth-left { display: none; }
  .auth-right { padding: 2rem 1.25rem 3rem; }
  .form-row-2 { grid-template-columns: 1fr; }
}