/* ============================================================
   style.css — 4ème RGPH/RGAE Touboro
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --green:    #007A5E;
  --green-dk: #005c47;
  --green-lt: #e8f5f1;
  --red:      #CE1126;
  --red-lt:   #fdf0f2;
  --orange:   #E87722;
  --yellow:   #FCD116;
  --blue:     #00467A;
  --blue-lt:  #e8f0f7;
  --gray-50:  #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-400: #ced4da;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 16px rgba(0,0,0,.08);
  --radius:    12px;
  --radius-sm: 8px;
  --font:      'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* ── HEADER ── */
.site-header {
  background: var(--green);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-flag {
  display: flex;
  height: 28px;
  width: 60px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.3);
}
.header-flag span { flex: 1; }
.flag-g { background: #007A5E; }
.flag-r { background: #CE1126; }
.flag-y { background: #FCD116; }
.header-text h1 { font-size: 15px; font-weight: 700; line-height: 1.2; }
.header-text p  { font-size: 12px; opacity: .85; }
.header-badge {
  margin-left: auto;
  background: rgba(255,255,255,.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
}

/* ── MAIN CONTAINER ── */
.container {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.step-node { display: flex; flex-direction: column; align-items: center; }
.step-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gray-400);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-600);
  transition: all .3s;
  position: relative;
  z-index: 1;
}
.step-dot.active { border-color: var(--green); color: var(--green); background: var(--green-lt); }
.step-dot.done   { border-color: var(--green); background: var(--green); color: #fff; }
.step-dot.done::after { content: '✓'; }
.step-dot.done span  { display: none; }
.step-label { font-size: 11px; color: var(--gray-600); margin-top: 5px; white-space: nowrap; text-align: center; }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin-top: 17px;
  transition: background .3s;
}
.step-line.done { background: var(--green); }

/* ── CARD ── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  margin-bottom: 1rem;
  animation: fadeUp .25s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-600);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.badge-green  { background: var(--green-lt); color: var(--green); }
.badge-blue   { background: var(--blue-lt);  color: var(--blue);  }
.badge-orange { background: #fef3e8; color: var(--orange); }
.badge-red    { background: var(--red-lt); color: var(--red); }
.badge-count  { background: var(--gray-100); color: var(--gray-600); margin-left:auto; }

/* ── STATUT SELECTOR ── */
.statut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.statut-opt {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
  position: relative;
}
.statut-opt:hover { border-color: var(--gray-400); }
.statut-opt.selected { border-color: var(--green); background: var(--green-lt); }
.statut-opt .s-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  margin-bottom: .75rem;
}
.s-icon-p { background: var(--green-lt); color: var(--green); }
.s-icon-a { background: var(--blue-lt);  color: var(--blue);  }
.statut-opt .s-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.statut-opt .s-desc { font-size: 12px; color: var(--gray-600); }
.statut-opt .s-check {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: all .2s;
}
.statut-opt.selected .s-check { background: var(--green); border-color: var(--green); color: #fff; }

/* ── FORM FIELDS ── */
.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-control, .form-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--gray-400);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
  color: var(--gray-800);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,122,94,.12);
}
.form-control:disabled, .form-select:disabled {
  background: var(--gray-100);
  opacity: .7;
  cursor: not-allowed;
}
.form-control.is-invalid, .form-select.is-invalid {
  border-color: var(--red);
}
.form-hint { font-size: 12px; color: var(--gray-600); margin-top: 5px; }
.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 4px;
}
.form-error.show { display: flex; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── CNI FIELD ── */
.cni-info {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: .65rem .875rem;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-top: .5rem;
}
.cni-info strong { color: var(--gray-800); }
.name-changed-tag {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--orange);
  font-weight: 600;
  margin-top: 6px;
  padding: 4px 8px;
  background: #fef3e8;
  border-radius: 6px;
}
.name-changed-tag.show { display: flex; }

/* ── PAIEMENT ── */
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 1rem; }
.pay-opt {
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  padding: .875rem;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.pay-opt:hover { border-color: var(--gray-400); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.pay-opt.selected-om   { border-color: var(--orange); background: #fef3e8; box-shadow: 0 0 0 3px rgba(255,102,0,.15); }
.pay-opt.selected-momo { border-color: #FFCC00;       background: #fffde8; box-shadow: 0 0 0 3px rgba(255,204,0,.2); }
.pay-logo-wrap {
  width: 100%;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: .625rem;
  background: #000;
}
.pay-name { font-size: 13px; font-weight: 700; color: var(--gray-900); margin-bottom: 3px; }
.pay-sub  { font-size: 11px; color: var(--gray-600); margin-bottom: 4px; }
.pay-check {
  display: none;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 6px;
}
.pay-opt.selected-om   .pay-check { display: inline-block; background: var(--orange); color: #fff; }
.pay-opt.selected-momo .pay-check { display: inline-block; background: #FFCC00; color: #333; }

/* ── ALERT BOXES ── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 1rem;
  display: none;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.alert.show { display: flex; }
.alert-danger { background: var(--red-lt);  border: 1px solid rgba(206,17,38,.2); color: #8b0a1a; }
.alert-warn   { background: #fffde8;        border: 1px solid rgba(252,209,22,.5); color: #6b5900; }
.alert-info   { background: var(--blue-lt); border: 1px solid rgba(0,70,122,.2);  color: var(--blue); }
.alert svg { flex-shrink: 0; margin-top: 1px; }

/* ── BUTTONS ── */
.btn-row { display: flex; gap: 10px; margin-top: 1.5rem; }
.btn {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1.5px solid var(--gray-400);
  background: #fff;
  color: var(--gray-800);
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { background: var(--gray-100); }
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-dk); border-color: var(--green-dk); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ── SCREEN MANAGEMENT ── */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp .25s ease; }

/* ── CONFIRMATION TABLE ── */
.confirm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.confirm-table tr { border-bottom: 1px solid var(--gray-100); }
.confirm-table tr:last-child { border-bottom: none; }
.confirm-table td { padding: 10px 4px; vertical-align: middle; }
.confirm-table td:first-child { color: var(--gray-600); font-size: 13px; width: 45%; }
.confirm-table td:last-child  { font-weight: 600; text-align: right; }
.pay-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.pill-om   { background: #fef3e8; color: var(--orange); }
.pill-momo { background: #fffde8; color: #996600; }
.pill-p    { background: var(--green-lt); color: var(--green); }
.pill-a    { background: var(--blue-lt);  color: var(--blue);  }

/* ── Diplôme pills ── */
.pill-diplome   { background: #F3E6FF; color: #6600CC; }
.pill-bepc      { background: #F1F3F5; color: #495057; }
.pill-bac       { background: #E7F1FF; color: #0D6EFD; }
.pill-licence   { background: #E6F7EE; color: #198754; }
.pill-master    { background: #F3E6FF; color: #7A00E0; }
.pill-doctorat  { background: #FFE6E0; color: #CC3300; }

/* ── SUCCESS / ALREADY ── */
.result-box { text-align: center; padding: 2rem 1rem; }
.result-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}
.icon-success { background: var(--green); }
.icon-error   { background: var(--red-lt); }
.result-box h2 { font-size: 20px; font-weight: 700; margin-bottom: .5rem; }
.result-box p  { font-size: 14px; color: var(--gray-600); }
.result-box .result-sub {
  margin-top: 1rem;
  font-size: 13px;
  color: var(--gray-600);
}

/* ── LOADING SPINNER ── */
.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 560px) {
  .row-2      { grid-template-columns: 1fr; }
  .statut-grid{ grid-template-columns: 1fr; }
  .pay-grid   { grid-template-columns: 1fr; }
  .container  { padding: 0 .75rem; }
  .card       { padding: 1.25rem; }
}
