/* ══════════════════════════════════════════════
   AUTH & DASHBOARD STYLES — Cash Explorer
══════════════════════════════════════════════ */

/* ── Auth pages (signup, login, reset) ── */
.auth-page {
  min-height: calc(100vh - var(--header-h) - 80px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
}
.auth-card h1 {
  font-size: 24px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 6px; text-align: center;
}
.auth-card .auth-subtitle {
  font-size: 13px; color: var(--muted2); text-align: center; margin-bottom: 28px;
}
.auth-card .form-row { gap: 12px; }
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .form-group label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted2); margin-bottom: 6px; display: block;
}
.auth-card .form-group input,
.auth-card .form-group select {
  width: 100%; padding: 12px 14px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; color: #fff; font-size: 14px;
  transition: border-color .2s;
}
.auth-card .form-group input:focus { border-color: var(--green); outline: none; }

/* Bouton principal auth */
.auth-submit {
  width: 100%; padding: 14px;
  background: var(--green); color: #fff;
  font-size: 14px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; border: none; border-radius: 10px;
  cursor: pointer; transition: background .2s, transform .1s;
  margin-top: 8px;
}
.auth-submit:hover { background: var(--green-l); transform: translateY(-1px); }
.auth-submit:disabled { background: var(--card2); color: var(--muted); cursor: not-allowed; transform: none; }

.auth-link { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted2); }
.auth-link a { color: var(--green-l); font-weight: 700; }
.auth-link a:hover { text-decoration: underline; }

.auth-error {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  color: #f87171; font-size: 13px; font-weight: 600;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 16px;
  display: none;
}
.auth-success {
  background: rgba(22,163,74,.1); border: 1px solid rgba(22,163,74,.3);
  color: var(--green-l); font-size: 13px; font-weight: 600;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 16px;
  display: none; text-align: center;
}

/* ── Password strength meter ── */
.pwd-meter { margin-top: 8px; }
.pwd-meter-bar {
  height: 4px; border-radius: 2px; background: var(--card2);
  overflow: hidden; margin-bottom: 6px;
}
.pwd-meter-fill {
  height: 100%; border-radius: 2px; width: 0;
  transition: width .3s, background .3s;
}
.pwd-meter-label { font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.pwd-str-0 .pwd-meter-fill { width: 0%; background: transparent; }
.pwd-str-1 .pwd-meter-fill { width: 20%; background: #ef4444; }
.pwd-str-1 .pwd-meter-label { color: #ef4444; }
.pwd-str-2 .pwd-meter-fill { width: 40%; background: #f97316; }
.pwd-str-2 .pwd-meter-label { color: #f97316; }
.pwd-str-3 .pwd-meter-fill { width: 60%; background: #eab308; }
.pwd-str-3 .pwd-meter-label { color: #eab308; }
.pwd-str-4 .pwd-meter-fill { width: 80%; background: #84cc16; }
.pwd-str-4 .pwd-meter-label { color: #84cc16; }
.pwd-str-5 .pwd-meter-fill { width: 100%; background: var(--green-l); }
.pwd-str-5 .pwd-meter-label { color: var(--green-l); }

/* ── Toggle password visibility ── */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px; }
.pwd-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 4px; font-size: 16px;
}
.pwd-toggle:hover { color: var(--green-l); }

/* ── Checkboxes ── */
.auth-check {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px; cursor: pointer;
}
.auth-check input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--green);
}
.auth-check span { font-size: 12px; color: var(--muted2); line-height: 1.5; }
.auth-check a { color: var(--green-l); text-decoration: underline; }

/* ── Nav user btn ── */
.nav-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted2); padding: 8px 14px; border-radius: 10px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; cursor: pointer; transition: border-color .2s, color .2s;
  text-decoration: none;
}
.nav-user-btn:hover { border-color: var(--green); color: var(--green-l); }
.nav-user-btn svg { width: 16px; height: 16px; stroke: currentColor; }

/* ══════════════════════════════════════════════
   DASHBOARD — account.html
══════════════════════════════════════════════ */
.dash-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 0;
  min-height: calc(100vh - var(--header-h) - 80px);
}
.dash-sidebar {
  background: var(--card); border-right: 1px solid var(--border);
  padding: 32px 0;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
/* Mobile header hidden on desktop */
.dash-mob-header { display: none; }
/* Overlay hidden on desktop */
.dash-overlay { display: none; }
.dash-user-info {
  padding: 0 24px 24px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.dash-user-avatar {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--green-dim); color: var(--green-l);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; margin-bottom: 12px;
}
.dash-user-name { font-size: 14px; font-weight: 800; }
.dash-user-email { font-size: 11px; color: var(--muted); margin-top: 2px; word-break: break-all; }

.dash-nav { display: flex; flex-direction: column; }
.dash-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; font-size: 13px; font-weight: 600;
  color: var(--muted2); cursor: pointer; border: none;
  background: none; text-align: left; transition: background .2s, color .2s;
  text-decoration: none;
}
.dash-nav-item:hover { background: var(--card2); color: #fff; }
.dash-nav-item.active { color: var(--green-l); background: var(--green-dim); border-right: 3px solid var(--green); }
.dash-nav-item svg { width: 18px; height: 18px; stroke: currentColor; flex-shrink: 0; }
.dash-nav-sep { height: 1px; background: var(--border); margin: 8px 24px; }
.dash-nav-item.danger { color: #ef4444; }
.dash-nav-item.danger:hover { background: rgba(239,68,68,.08); }

.dash-content { padding: 32px 40px; min-width: 0; overflow-x: hidden; }
.dash-section { display: none; }
.dash-section.active { display: block; }
.dash-section-title { font-size: 22px; font-weight: 900; text-transform: uppercase; margin-bottom: 8px; }
.dash-section-sub { font-size: 13px; color: var(--muted2); margin-bottom: 28px; }

/* ── Profile form ── */
.dash-form { max-width: 560px; }
.dash-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-form .form-group { margin-bottom: 16px; }
.dash-form .form-group label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted2); margin-bottom: 6px; display: block;
}
.dash-form .form-group input {
  width: 100%; padding: 12px 14px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; color: #fff; font-size: 14px;
  transition: border-color .2s;
}
.dash-form .form-group input:focus { border-color: var(--green); outline: none; }
.dash-form .form-group input:disabled { color: var(--muted); cursor: not-allowed; }

.dash-save {
  padding: 12px 28px; background: var(--green); color: #fff;
  font-size: 13px; font-weight: 700; border: none; border-radius: 10px;
  cursor: pointer; transition: background .2s;
}
.dash-save:hover { background: var(--green-l); }

/* ── Tables dashboard ── */
.dash-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dash-table {
  width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px;
}
.dash-table th {
  text-align: left; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dash-table td {
  padding: 14px; border-bottom: 1px solid var(--border2);
  color: var(--muted2); vertical-align: middle;
}
.dash-table tr:hover td { background: var(--card2); }

.dash-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; padding: 4px 10px; border-radius: 20px;
  display: inline-block;
}
.dash-status-nouveau   { background: rgba(59,130,246,.15); color: #60a5fa; }
.dash-status-en_cours  { background: rgba(234,179,8,.15); color: #eab308; }
.dash-status-confirme  { background: rgba(22,163,74,.15); color: var(--green-l); }
.dash-status-en_preparation { background: rgba(168,85,247,.15); color: #a855f7; }
.dash-status-expedie   { background: rgba(14,165,233,.15); color: #0ea5e9; }
.dash-status-livre     { background: rgba(22,163,74,.15); color: var(--green-l); }
.dash-status-termine   { background: rgba(22,163,74,.15); color: var(--green-l); }
.dash-status-resolu    { background: rgba(22,163,74,.15); color: var(--green-l); }
.dash-status-annule    { background: rgba(239,68,68,.15); color: #f87171; }
.dash-status-refuse    { background: rgba(239,68,68,.15); color: #f87171; }
.dash-status-rembourse { background: rgba(168,85,247,.15); color: #a855f7; }
.dash-status-ferme     { background: rgba(107,114,128,.15); color: #9ca3af; }
.dash-status-en_attente { background: rgba(234,179,8,.15); color: #eab308; }

.dash-empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.dash-empty-icon { font-size: 40px; margin-bottom: 12px; }
.dash-empty-text { font-size: 14px; }

/* ── Claim form ── */
.claim-form { max-width: 560px; margin-top: 24px; }
.claim-form textarea {
  width: 100%; padding: 12px; background: var(--card2);
  border: 1px solid var(--border); border-radius: 10px;
  color: #fff; font-size: 14px; height: 100px; resize: none;
  font-family: inherit;
}
.claim-form textarea:focus { border-color: var(--green); outline: none; }

/* ── RGPD section ── */
.rgpd-actions { display: flex; flex-direction: column; gap: 16px; max-width: 500px; }
.rgpd-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.rgpd-card-title { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.rgpd-card-desc { font-size: 12px; color: var(--muted2); line-height: 1.6; margin-bottom: 14px; }
.rgpd-btn {
  padding: 10px 20px; font-size: 12px; font-weight: 700;
  border: none; border-radius: 8px; cursor: pointer;
  transition: background .2s;
}
.rgpd-btn-export { background: var(--green-dim); color: var(--green-l); }
.rgpd-btn-export:hover { background: var(--green); color: #fff; }
.rgpd-btn-delete { background: rgba(239,68,68,.1); color: #f87171; }
.rgpd-btn-delete:hover { background: #ef4444; color: #fff; }

/* ── Modal confirmation ── */
.dash-modal {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7); align-items: center; justify-content: center;
}
.dash-modal.show { display: flex; }
.dash-modal-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; max-width: 400px; width: 90%;
  text-align: center;
}
.dash-modal-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.dash-modal-desc { font-size: 13px; color: var(--muted2); line-height: 1.6; margin-bottom: 24px; }
.dash-modal-actions { display: flex; gap: 10px; justify-content: center; }
.dash-modal-cancel {
  padding: 10px 20px; background: var(--card2); color: var(--muted2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.dash-modal-confirm {
  padding: 10px 20px; background: #ef4444; color: #fff;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  /* Nav auth button compact on mobile — icon only */
  .nav-user-btn span { display: none; }
  .nav-user-btn { padding: 8px; border-radius: 10px; }

  .dash-layout { grid-template-columns: 1fr; }

  /* Mobile: sidebar = slide-in drawer from left */
  .dash-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 310;
    width: 280px; height: auto;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    border-right: 1px solid var(--border);
    border-top: none;
    padding: 32px 0;
    display: flex; flex-direction: column;
    background: var(--card);
    overflow-y: auto;
  }
  .dash-sidebar.open { transform: translateX(0); }

  .dash-user-info { display: block; }
  .dash-nav { flex-direction: column; width: 100%; }
  .dash-nav-sep { display: block; }
  .dash-nav-item {
    flex-direction: row; gap: 12px; padding: 12px 24px;
    font-size: 13px; white-space: normal; min-width: 0;
    border-right: none;
  }
  .dash-nav-item.active { border-right: 3px solid var(--green); border-top: none; }

  /* Overlay behind drawer */
  .dash-overlay {
    display: none; position: fixed; inset: 0; z-index: 305;
    background: rgba(0,0,0,.6);
    transition: opacity .3s;
  }
  .dash-overlay.show { display: block; }

  /* Current tab header with menu button */
  .dash-mob-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 0; margin-bottom: 8px;
  }
  .dash-menu-btn {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--card); border: 1px solid var(--border);
    color: var(--muted2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .2s, color .2s; flex-shrink: 0;
  }
  .dash-menu-btn:hover { border-color: var(--green); color: var(--green-l); }
  .dash-menu-btn svg { width: 20px; height: 20px; stroke: currentColor; }
  .dash-mob-tab-name {
    font-size: 16px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .5px;
  }

  .dash-content { padding: 16px 16px 100px; }
  .dash-form .form-row { grid-template-columns: 1fr; }

  /* Hide section titles on mobile (shown in header) */
  .dash-section-title { display: none; }
}

@media (max-width: 480px) {
  .auth-card { padding: 24px; }
}
