:root {
  /* Palette reprise de ChantierFlow-v9-Atlas-IA.html pour la continuité visuelle. */
  --accent: #1f6f5f;
  --accent2: #184f45;
  --accent-soft: #eef7f4;
  --gris-texte: #6b7280;
  --gris-bordure: #e5e7eb;
  --gris-fond: #f4f6f8;
  --blanc: #ffffff;
  --texte: #17202a;
  --rouge-erreur: #b91c1c;
  --vert-succes: #166534;
  --avertissement: #d97706;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texte);
  background: var(--gris-fond);
}

/* ---------- Écrans d'authentification (login, signup, callback) ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--accent2) 0%, var(--accent) 65%, #7dd3b0 220%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(24, 79, 69, 0.3);
  padding: 40px 36px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-brand .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blanc);
  font-weight: 700;
  font-size: 18px;
}

.auth-brand .logo-text {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.auth-card h1 {
  font-size: 22px;
  margin: 0 0 6px;
}

.auth-card p.subtitle {
  color: var(--gris-texte);
  margin: 0 0 26px;
  font-size: 14.5px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-of-type {
  margin-top: 0;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--gris-bordure);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: var(--accent);
}

.btn-primary {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--blanc);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--accent2);
}

button.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.auth-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--gris-texte);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

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

.message {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  display: none;
}

.message.show {
  display: block;
}

.message.error {
  background: #fdecea;
  color: var(--rouge-erreur);
}

.message.success {
  background: #e9f7ea;
  color: var(--vert-succes);
}

.message.info {
  background: #eaf1fb;
  color: var(--accent2);
}

.install-card {
  width: 100%;
  max-width: 420px;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--blanc);
  text-align: center;
}

.install-card-title {
  font-weight: 700;
  font-size: 15.5px;
  margin-bottom: 4px;
}

.install-card-text {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 12px;
  opacity: 0.92;
}

.install-card .btn-primary {
  width: auto;
  margin-top: 0;
  padding: 10px 20px;
  background: var(--blanc);
  color: var(--accent2);
}

.install-card .btn-primary:hover {
  background: #eef7f4;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--gris-texte);
  font-size: 12.5px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gris-bordure);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: var(--blanc);
  border-radius: 50%;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Écran applicatif (dashboard placeholder) ---------- */

.app-topbar {
  background: var(--accent2);
  color: var(--blanc);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
}

.app-topbar .logo-text {
  font-weight: 700;
  font-size: 18px;
}

.app-topbar button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--blanc);
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
}

.app-topbar button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.app-content {
  max-width: 780px;
  margin: 48px auto;
  padding: 0 24px;
}

.app-content .card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: 0 2px 10px rgba(16, 35, 61, 0.08);
}

.app-content h1 {
  margin-top: 0;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #eef1f5;
  color: var(--accent2);
}

.badge.admin {
  background: #fdeee0;
  color: var(--accent2);
}

.center-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gris-texte);
  font-size: 14.5px;
}

/* ---------- Facturation ---------- */

.app-content.wide {
  max-width: 980px;
}

.badge.suspendu {
  background: #fdecea;
  color: var(--rouge-erreur);
}

.badge.actif {
  background: #e9f7ea;
  color: var(--vert-succes);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.plan-card {
  border: 1px solid var(--gris-bordure);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-card.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.plan-card h3 {
  margin: 0;
  font-size: 18px;
}

.plan-card .plan-desc {
  color: var(--gris-texte);
  font-size: 13.5px;
  line-height: 1.5;
  flex: 1;
}

.plan-card a.btn-primary {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  width: 100%;
  margin-top: 0;
}
