/* ── Variables (aliases → global.css)
   Requires global.css to be loaded first ────────────── */
:root {
  --or:   var(--duck-orange);
  --or2:  var(--duck-orange-dark);
  --gr:   var(--duck-green);
  --bl:   var(--duck-blue);
  --rd:   var(--duck-red);
  --wh:   var(--white);
  --tx:   var(--text-main);
  --tx2:  var(--text-light);
  --bd:   var(--border-light);
  --r-md: 14px;
  --r-lg: 22px;
  --sh:   0 20px 50px rgba(0,0,0,.12);
}

/* ── Auth page body override (no navbar, centered layout) ─ */
body {
  padding-top: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative;
  min-height: 100vh;
}

/* ── Fond ──────────────────────────────────────────────── */
.bg-deco {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,140,50,.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(44,196,131,.07) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M30,50 Q40,35 50,50 Q40,65 30,50' fill='none' stroke='%23ff8c32' stroke-width='1' opacity='.04'/%3E%3C/svg%3E") repeat;
  background-size: auto, auto, 80px 80px;
}

/* ── Container ─────────────────────────────────────────── */
.ctn {
  width: 100%; max-width: 680px;
  position: relative; z-index: 1;
  animation: fu .55s ease;
}
@keyframes fu { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:none; } }

/* ── Progress ──────────────────────────────────────────── */
.progress {
  display: flex; justify-content: space-between;
  margin-bottom: 28px; position: relative;
}
.progress::before {
  content: ''; position: absolute; top: 16px; left: 0; right: 0;
  height: 3px; background: #e2e8f0; z-index: 1;
}
.step {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .82rem;
  color: var(--tx2); border: 3px solid #e2e8f0;
  background: var(--wh); position: relative; z-index: 2;
  transition: all .3s;
}
.step.active { border-color: var(--or); color: var(--or); }
.step.done   { background: var(--or); border-color: var(--or); color: #fff; }

/* ── Card ──────────────────────────────────────────────── */
.card {
  background: var(--wh);
  padding: 38px 42px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  border: 1px solid rgba(0,0,0,.05);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--or), var(--or2), var(--gr));
}

/* ── Header ────────────────────────────────────────────── */
.hdr { text-align: center; margin-bottom: 28px; }
.logo-box {
  width: 90px; height: 90px; border-radius: 22px; overflow: hidden;
  background: rgba(255,140,50,.08);
  box-shadow: 0 8px 22px rgba(255,140,50,.25);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.hdr h2 { font-size: 1.7rem; font-weight: 800; color: var(--tx); margin-bottom: 6px; }
.hdr p  { font-size: .9rem; color: var(--tx2); }

/* ── Sections ──────────────────────────────────────────── */
.sec        { display: block; }
.sec.hidden { display: none; }

.sec-ttl {
  font-size: .95rem; font-weight: 800; color: var(--or);
  margin: 0 0 18px; padding-bottom: 6px;
  border-bottom: 2px solid var(--bd);
}
.sec-ttl small { font-weight: 500; font-size: .8rem; color: var(--tx2); }

/* ── Formulaire ────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fg    { margin-bottom: 16px; }
.fg label {
  display: block; font-size: .8rem; font-weight: 700;
  color: var(--tx2); margin-bottom: 6px;
}
.req { color: var(--rd); margin-left: 2px; }

.fg input, .fg select, .fg textarea {
  width: 100%; padding: 11px 14px;
  border: 2px solid var(--bd); border-radius: var(--r-md);
  font-family: inherit; font-size: .92rem; outline: none;
  background: #fafafa; color: var(--tx);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--or); background: var(--wh);
  box-shadow: 0 0 0 4px rgba(255,140,50,.1);
}
.fg input[readonly] { background: #f0f0f0; cursor: not-allowed; }
.fg textarea        { resize: vertical; min-height: 90px; }

.hint {
  font-size: .75rem; color: var(--tx2);
  text-align: center; margin-bottom: 12px;
}

/* ── Alertes inline ────────────────────────────────────── */
.alert {
  display: none; align-items: center; gap: 8px;
  padding: 11px 14px; border-radius: 10px;
  font-size: .83rem; font-weight: 700;
  margin-bottom: 14px;
  animation: aIn .25s ease;
}
.alert.show { display: flex; }
.alert.err  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert.ok   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }
@keyframes aIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

/* ── Boutons ───────────────────────────────────────────── */
.btn-or, .btn-sec {
  padding: 14px; border: none; border-radius: var(--r-md);
  font-weight: 800; font-size: .97rem;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .3s;
}
.btn-or {
  width: 100%;
  background: linear-gradient(135deg, var(--or), var(--or2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,140,50,.3);
}
.btn-or:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(255,140,50,.4); }
.btn-or:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-sec {
  background: var(--bd); color: var(--tx2);
}
.btn-sec:hover { background: #e2e8f0; transform: translateY(-1px); }

.btn-row {
  display: flex; gap: 10px; margin-top: 4px;
}
.btn-row .btn-sec { flex: 0 0 120px; }
.btn-row .btn-or  { flex: 1; }

.link-row {
  text-align: center; margin-top: 18px; font-size: .88rem;
}
.link-row a { color: var(--or); text-decoration: none; font-weight: 600; }
.link-row a:hover { text-decoration: underline; }

/* ── Spinner ───────────────────────────────────────────── */
.spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: rot .6s linear infinite;
  display: none; flex-shrink: 0;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ── Modal ─────────────────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  align-items: center; justify-content: center;
  z-index: 5000; padding: 20px;
}
.modal.open { display: flex; }

.mbox {
  background: var(--wh); border-radius: var(--r-lg);
  padding: 28px; max-width: 480px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--sh);
  animation: fu .3s ease;
}
.mbox h3 {
  color: var(--or); font-size: 1.1rem;
  margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 2px solid var(--bd);
}

.irow {
  padding: 8px 10px; background: #f8fafc;
  border-radius: 8px; font-size: .88rem; margin-bottom: 6px;
}
.irow strong { color: #334155; display: inline-block; min-width: 120px; }

.mact { display: flex; gap: 12px; margin-top: 22px; }
.mbtn {
  flex: 1; padding: 12px; border: none; border-radius: 12px;
  font-weight: 700; cursor: pointer; font-family: inherit;
  font-size: .9rem; transition: .2s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.mbtn-or  { background: var(--or); color: #fff; }
.mbtn-or:hover  { background: var(--or2); }
.mbtn-sec { background: var(--bd); color: #334155; }
.mbtn-sec:hover { background: #e2e8f0; }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1e293b; color: #fff;
  padding: 11px 24px; border-radius: 30px;
  font-size: .87rem; font-weight: 600;
  z-index: 9999; opacity: 0;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--gr); }
.toast.error   { background: var(--rd); }
/* Legacy aliases kept for backward compat — remove once JS updated */
.toast.ok  { background: var(--gr); }
.toast.err { background: var(--rd); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .card  { padding: 28px 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .hdr h2 { font-size: 1.35rem; }
  .logo-box { width: 72px; height: 72px; border-radius: 18px; }
}
