/* Styles dédiés portail M&D — Espace client + Admin */

.auth-main {
  min-height: calc(100vh - 100px);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.auth-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 60px 56px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 24px 80px -40px rgba(27, 42, 82, .18);
}

.auth-tag {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tomato);
  margin-bottom: 22px;
}

.auth-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink);
  margin: 0 0 24px;
}

.auth-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--tomato);
}

.auth-lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  opacity: .8;
  margin: 0 0 36px;
  max-width: 44ch;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

.auth-input {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  padding: 16px 20px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
  outline: none;
  transition: border-color .2s, background .2s;
}

.auth-input:focus {
  border-color: var(--tomato);
  background: #fff;
}

.auth-submit {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--tomato);
  color: #fff;
  border: none;
  padding: 18px 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  transition: background .25s, transform .15s;
}

.auth-submit:hover:not(:disabled) {
  background: var(--ink);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.auth-arrow {
  font-size: 18px;
  margin-left: 14px;
}

.auth-msg {
  font-size: 14px;
  padding: 12px 16px;
  border-left: 3px solid transparent;
  margin-top: 8px;
  min-height: 0;
  display: none;
  line-height: 1.5;
}

.auth-msg:not(:empty) {
  display: block;
}

.auth-msg-ok {
  border-color: #2D8050;
  background: #E6F0EA;
  color: #1B4D2E;
}

.auth-msg-err {
  border-color: #C0392B;
  background: #FBE7E4;
  color: #8E1F12;
}

.auth-foot {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink);
  opacity: .85;
}

.auth-foot a {
  color: var(--tomato);
  text-decoration: none;
  font-weight: 600;
  margin-left: 6px;
}

.auth-foot a:hover { text-decoration: underline; }

/* ----- Dashboard layouts ----- */
.dash-shell {
  min-height: 100vh;
  background: var(--cream);
}

.dash-topbar {
  background: var(--ink);
  color: var(--cream);
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2A3D6B;
}

.dash-topbar .logo img { height: 36px; display: block; }

.dash-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.dash-user .role-badge {
  background: var(--tomato);
  color: #fff;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.dash-logout {
  background: transparent;
  border: 1px solid #4A5B82;
  color: var(--cream);
  padding: 8px 16px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.dash-logout:hover {
  background: var(--tomato);
  border-color: var(--tomato);
}

.dash-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

.dash-hero {
  margin-bottom: 48px;
}

.dash-hero-tag {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tomato);
  margin-bottom: 10px;
}

.dash-hero-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink);
  margin: 0 0 14px;
}

.dash-hero-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--tomato);
}

.dash-hero-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  opacity: .8;
  max-width: 60ch;
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin-bottom: 48px;
}

.kpi-card {
  background: var(--paper);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 28px 24px;
  transition: background .25s;
}

.kpi-card:hover { background: var(--cream); }

.kpi-label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .65;
  margin-bottom: 10px;
}

.kpi-value {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3vw, 40px);
  color: var(--ink);
  line-height: 1;
  letter-spacing: -.02em;
}

.kpi-value em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--tomato);
  font-size: .65em;
  margin-left: 4px;
}

.kpi-card.kpi-highlight { background: var(--ink); color: var(--cream); }
.kpi-card.kpi-highlight .kpi-label,
.kpi-card.kpi-highlight .kpi-value { color: var(--cream); opacity: 1; }
.kpi-card.kpi-highlight .kpi-value em { color: var(--butter); }

/* Sections */
.dash-section {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 40px;
  margin-bottom: 32px;
}

.dash-section-h {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-section-h em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--tomato);
}

.dash-section-h .count {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  opacity: .55;
  text-transform: none;
  letter-spacing: 0;
}

/* Tables */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dash-table th {
  text-align: left;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .65;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
}

.dash-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

.dash-table tr:hover td { background: rgba(232, 139, 44, .05); }

.dash-table .pill {
  display: inline-block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.pill-active { background: #E6F0EA; color: #1B4D2E; }
.pill-trial  { background: #FFF4D9; color: #8A5A00; }
.pill-canceled { background: #FBE7E4; color: #8E1F12; }
.pill-paid   { background: #E6F0EA; color: #1B4D2E; }
.pill-open   { background: #FFF4D9; color: #8A5A00; }
.pill-customer { background: var(--cream); color: var(--ink); border: 1px solid var(--rule); }
.pill-admin  { background: var(--tomato); color: #fff; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink);
  opacity: .55;
  font-size: 15px;
}

.empty-state em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--tomato);
  opacity: 1;
}

/* Status banner (system check) */
.status-banner {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 20px 28px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  color: var(--ink);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: #2D8050; }
.status-dot.red { background: #C0392B; }
.status-dot.amber { background: #E88B2C; }

/* Loading state */
.dash-loading {
  text-align: center;
  padding: 80px 20px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  opacity: .55;
}

/* Responsive */
@media (max-width: 900px) {
  .dash-main { padding: 32px 20px; }
  .dash-topbar { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .dash-section { padding: 24px 20px; }
  .dash-table { font-size: 13px; }
  .dash-table th, .dash-table td { padding: 10px 8px; }
  .auth-card { padding: 40px 28px; }
}
