/*
 * ════════════════════════════════════════════════
 *  VARIABLES — modifie ici pour changer le design
 * ════════════════════════════════════════════════
 */
:root {
  --color-primary:    #003189;   /* bleu RF — header, boutons */
  --color-accent:     #c8102e;   /* rouge — accents */
  --color-bg:         #f5f4f1;   /* fond général */
  --color-surface:    #ffffff;   /* fond cartes */
  --color-border:     #e0ddd7;   /* bordures */
  --color-text:       #1a1918;   /* texte principal */
  --color-muted:      #6b6760;   /* texte secondaire */
  --font-display:     'Libre Baskerville', Georgia, serif;
  --font-body:        'DM Sans', system-ui, sans-serif;
  --radius:           8px;
  --radius-lg:        16px;
  --shadow:           0 2px 8px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg:        0 8px 32px rgba(0,0,0,.11), 0 2px 8px rgba(0,0,0,.06);
  --header-bg:        #ffffff;
  --header-h:         64px;
  --footer-bg:        #1a1918;
  --footer-text:      #9a9590;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family:      var(--font-body);
  background:       var(--color-bg);
  color:            var(--color-text);
  line-height:      1.6;
  min-height:       100vh;
  display:          flex;
  flex-direction:   column;
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  background:    var(--header-bg);
  border-bottom: 1px solid var(--color-border);
  height:        var(--header-h);
  position:      sticky;
  top:           0;
  z-index:       100;
  box-shadow:    0 1px 4px rgba(0,0,0,.06);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 32px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo { text-decoration: none; display: flex; flex-direction: column; line-height: 1.2; }
.logo-lf {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--color-primary); letter-spacing: -.5px;
}
.logo-tag { font-size: 11px; color: var(--color-muted); }
.header-nav { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 13px; color: var(--color-muted); }
.btn-logout {
  background: none; border: none; color: var(--color-muted); font-size: 13px;
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius);
  font-family: var(--font-body); transition: background .15s;
}
.btn-logout:hover { background: rgba(0,0,0,.05); }

/* ── Main / Footer ─────────────────────────────────────────────── */
.site-main { flex: 1; padding: 48px 32px; }
.site-footer {
  background: var(--footer-bg); color: var(--footer-text);
  padding: 20px 32px; font-size: 13px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.footer-sep { opacity: .4; }
.site-footer a { color: var(--footer-text); text-decoration: underline; text-underline-offset: 2px; }

/* ── Page wrap ─────────────────────────────────────────────────── */
.page-wrap { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

/* ── Cartes étapes ─────────────────────────────────────────────── */
.step-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; gap: 20px; box-shadow: var(--shadow);
}
.step-num {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-body { flex: 1; min-width: 0; }
.step-body h2 {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  margin-bottom: 6px;
}
.step-hint { font-size: 13px; color: var(--color-muted); margin-bottom: 16px; line-height: 1.5; }

/* ── URL row ───────────────────────────────────────────────────── */
.url-row { display: flex; gap: 10px; }
.url-row input {
  flex: 1; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 10px 14px; font-family: var(--font-body); font-size: 13px;
  color: var(--color-text); background: #fff; transition: border-color .15s;
}
.url-row input:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,49,137,.1);
}

/* ── Boutons ───────────────────────────────────────────────────── */
.btn-primary {
  background: var(--color-primary); color: #fff; border: none;
  border-radius: var(--radius); padding: 10px 20px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .1s;
  white-space: nowrap; text-decoration: none; display: inline-block;
}
.btn-primary:hover  { background: #002575; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--color-primary);
  border: 1px solid var(--color-primary); border-radius: var(--radius);
  padding: 8px 16px; font-family: var(--font-body); font-size: 13px;
  font-weight: 500; cursor: pointer; transition: background .15s;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { background: rgba(0,49,137,.06); }
.btn-full   { width: 100%; text-align: center; }
.btn-launch { margin-top: 8px; padding: 14px 28px; font-size: 15px; }
.btn-sm     { padding: 4px 10px !important; font-size: 12px !important; }

/* ── Champs ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; }
.field input, input[type="email"], input[type="text"],
input[type="password"], input[type="url"] {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 10px 14px; font-family: var(--font-body); font-size: 14px;
  color: var(--color-text); background: #fff; transition: border-color .15s; width: 100%;
}
input:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,49,137,.1);
}
.form-error {
  color: #c62828; font-size: 13px; padding: 8px 12px;
  background: #fdecea; border-radius: var(--radius); margin-top: 8px;
}

/* ── Login ─────────────────────────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - var(--header-h) - 80px);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 48px 40px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.login-brand { margin-bottom: 32px; text-align: center; }
.rf-mini { font-size: 12px; color: var(--color-muted); margin-bottom: 10px; }
.login-logo {
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  color: var(--color-primary); letter-spacing: -.5px;
}
.login-subtitle { font-size: 13px; color: var(--color-muted); margin-top: 4px; }

/* ── Sélection ─────────────────────────────────────────────────── */
.sel-group { margin-bottom: 20px; }
.sel-group-title {
  font-size: 11px; font-weight: 600; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--color-border);
}
.sel-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 0; cursor: pointer; font-size: 13px; line-height: 1.4;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.sel-item:last-child { border-bottom: none; }
.sel-item input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--color-primary); }
.sel-tree { list-style: none; }
.sel-tree li { border-bottom: 1px solid rgba(0,0,0,.04); }
.direct-badge {
  display: inline-block; padding: 8px 16px;
  background: #e6f4ea; color: #1e7e34; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
}

/* ── Progression ───────────────────────────────────────────────── */
.progress-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 48px 40px;
  max-width: 640px; margin: 0 auto; box-shadow: var(--shadow-lg); text-align: center;
}
.progress-header { margin-bottom: 32px; }
.progress-icon {
  font-size: 48px; margin-bottom: 16px; display: block;
  animation: spin 1.5s linear infinite;
}
.progress-icon.done  { animation: none; }
.progress-icon.error { animation: none; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.prog-bar-wrap { margin: 24px 0; }
.prog-bar-track {
  background: var(--color-border); border-radius: 100px; height: 10px; overflow: hidden;
}
.prog-bar-fill {
  background: linear-gradient(90deg, var(--color-primary), #1a6fd4);
  height: 100%; border-radius: 100px; transition: width .5s ease;
}
.prog-bar-labels {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 13px; color: var(--color-muted); font-weight: 500;
}
.prog-step { font-size: 14px; color: var(--color-text); margin: 16px 0; font-style: italic; }
.prog-stats {
  display: flex; justify-content: center; gap: 32px; margin: 20px 0;
  padding: 16px; background: var(--color-bg); border-radius: var(--radius);
}
.stat { text-align: center; }
.stat-label {
  display: block; font-size: 11px; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px;
}
.stat-val { font-size: 20px; font-family: var(--font-display); font-weight: 700; color: var(--color-primary); }
.prog-done  { background: #e6f4ea; padding: 24px; border-radius: var(--radius); margin-top: 24px; }
.prog-error { background: #fdecea; padding: 24px; border-radius: var(--radius); margin-top: 24px; }
.done-icon, .error-icon { font-size: 32px; margin-bottom: 12px; }
.done-files { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.download-btn { padding: 12px 20px !important; font-size: 14px; }
.done-email-note { font-size: 13px; color: var(--color-muted); margin-top: 8px; }

/* ── Loading ───────────────────────────────────────────────────── */
.loading-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-muted); }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--color-border);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin .8s linear infinite; flex-shrink: 0;
}

/* ── Admin ─────────────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 32px; }
.admin-table th {
  text-align: left; padding: 8px 12px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted);
  border-bottom: 2px solid var(--color-border);
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.admin-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-form input { width: auto !important; flex: 1; min-width: 140px; }

/* ── Badges ────────────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px; white-space: nowrap; }
.badge-green  { background: #e6f4ea; color: #1e7e34; border: 1px solid #b7dfbe; }
.badge-orange { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.badge-red    { background: #fdecea; color: #c62828; border: 1px solid #f5c6cb; }
.badge-grey   { background: #f1f3f4; color: #5f6368; border: 1px solid #dadce0; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-main  { padding: 24px 16px; }
  .step-card  { padding: 24px 20px; flex-direction: column; }
  .url-row    { flex-direction: column; }
  .prog-stats { gap: 16px; }
  .login-card { padding: 32px 24px; }
  .admin-form { flex-direction: column; }
}
