/* ============================================
   ESPACE CLIENT — AUTH + DASHBOARD
   FacBTP | W2K-Digital 2026
   ============================================ */

/* ── Variables ── */
:root {
  --auth-navy: #1E3A5F;
  --auth-blue: #2d5a8e;
  --auth-gold: #F5A623;
  --auth-radius: 16px;
  --auth-shadow: 0 8px 40px rgba(30,58,95,0.12);
}

/* ============================================
   AUTH PAGES — Hero compact
   ============================================ */
.auth-hero {
  background: linear-gradient(135deg, var(--auth-navy) 0%, var(--auth-blue) 100%),
              url('../images/hero/hero-auth.webp') center/cover no-repeat;
  background-blend-mode: multiply;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.auth-hero__inner {
  max-width: 480px;
  margin: 0 auto;
}
.auth-hero__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.auth-hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
}
.auth-hero p {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  margin: 0;
}

/* ── Section wrapper ── */
.auth-section {
  min-height: 60vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.5rem 4rem;
  background: #f8fafc;
}

/* ── Card formulaire ── */
.auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--auth-shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
}
.auth-card-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-card-logo .auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 2px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem;
}
.auth-card-logo h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--auth-navy);
  margin: 0;
}

/* ── Champs ── */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 1rem;
}
.auth-field label {
  font-size: 0.83rem;
  font-weight: 600;
  color: #374151;
  font-family: 'Inter', sans-serif;
}
.auth-field input,
.auth-field select {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: #111827;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--auth-navy);
  background: #fff;
}
.auth-field input::placeholder { color: #9ca3af; }

/* ── Options (remember + forgot) ── */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  cursor: pointer;
}
.auth-forgot {
  color: var(--auth-blue);
  font-weight: 600;
  text-decoration: none;
}
.auth-forgot:hover { text-decoration: underline; }

/* ── Bouton principal ── */
.auth-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--auth-navy), var(--auth-blue));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}
.auth-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Message erreur / succès ── */
.auth-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-family: 'Inter', sans-serif;
  margin: 0.5rem 0;
}
.auth-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-family: 'Inter', sans-serif;
  margin: 0.5rem 0;
}

/* ── Lien bas de carte ── */
.auth-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: #6b7280;
  font-family: 'Inter', sans-serif;
}
.auth-link a {
  color: var(--auth-navy);
  font-weight: 700;
  text-decoration: none;
}
.auth-link a:hover { text-decoration: underline; }

/* ── Séparateur ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.25rem 0;
  color: #d1d5db;
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* ============================================
   ESPACE CLIENT — NAVBAR
   ============================================ */
.ec-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}
.ec-nav__logo img { height: 36px; width: auto; }
.ec-nav__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--auth-navy);
  font-family: 'Inter', sans-serif;
}
.ec-nav__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--auth-navy), var(--auth-blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ec-nav__logout {
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  color: #374151;
  transition: background 0.2s;
}
.ec-nav__logout:hover { background: #e5e7eb; }

/* ============================================
   ESPACE CLIENT — MAIN LAYOUT
   ============================================ */
.ec-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.ec-page-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--auth-navy);
  margin: 0 0 0.25rem;
}
.ec-page-sub {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0 0 2rem;
  font-family: 'Inter', sans-serif;
}

/* ── Stats cards ── */
.ec-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.ec-stat-card {
  background: #fff;
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ec-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.ec-stat-number {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--auth-navy);
  font-family: 'Montserrat', sans-serif;
  line-height: 1;
}
.ec-stat-label {
  font-size: 0.8rem;
  color: #6b7280;
  font-family: 'Inter', sans-serif;
  margin-top: 3px;
}

/* ── CTA nouveau document ── */
.ec-cta {
  margin-bottom: 2rem;
}
.ec-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--auth-navy), var(--auth-blue));
  color: #fff;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.95rem;
  font-family: 'Montserrat', sans-serif;
  transition: opacity 0.2s, transform 0.15s;
}
.ec-cta__btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Section historique ── */
.ec-historique h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--auth-navy);
  margin: 0 0 1.25rem;
}

/* ── Grille documents ── */
.ec-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ── Carte document ── */
.ec-doc-card {
  background: #fff;
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ec-doc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(30,58,95,0.15);
}
.ec-doc-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ec-doc-type {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}
.ec-doc-type--devis   { background: #dbeafe; color: #1e40af; }
.ec-doc-type--facture { background: #dcfce7; color: #166534; }
.ec-doc-type--bc      { background: #fef3c7; color: #92400e; }
.ec-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
}
.ec-badge--ok  { background: #dcfce7; color: #15803d; }
.ec-badge--exp { background: #fee2e2; color: #dc2626; }
.ec-doc-num {
  font-weight: 700;
  color: var(--auth-navy);
  font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
}
.ec-doc-client {
  color: #374151;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ec-doc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}
.ec-doc-date {
  color: #9ca3af;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
}
.ec-doc-montant {
  font-weight: 700;
  color: #111827;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
}
.ec-doc-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--auth-navy), var(--auth-blue));
  color: #fff;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s;
}
.ec-doc-card__btn:hover { opacity: 0.88; }
.ec-doc-expired-msg {
  color: #9ca3af;
  font-size: 0.78rem;
  margin-top: 10px;
  font-style: italic;
  font-family: 'Inter', sans-serif;
}

/* ── État vide ── */
.ec-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  font-family: 'Inter', sans-serif;
}
.ec-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.ec-empty p { margin: 0 0 1rem; font-size: 0.95rem; }
.ec-empty a {
  display: inline-block;
  background: linear-gradient(135deg, var(--auth-navy), var(--auth-blue));
  color: #fff;
  padding: 11px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
}

/* ── Loader ── */
.ec-loader {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
  .auth-card { padding: 2rem 1.25rem; }
  .ec-nav { padding: 0.85rem 1rem; }
  .ec-nav__user span { display: none; }
  .ec-main { padding: 1.5rem 1rem 3rem; }
  .ec-stats { grid-template-columns: 1fr 1fr; }
  .ec-docs-grid { grid-template-columns: 1fr; }
  .auth-hero h1 { font-size: 1.3rem; }
}
