/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg:        #1a1a2e;
  --surface:   #16213e;
  --surface2:  #0f1f3d;
  --border:    #1e3a6e;
  --accent:    #e94560;
  --accent2:   #0f3460;
  --text:      #e2e8f0;
  --muted:     #7a8599;
  --success:   #4ade80;
  --radius:    8px;
  --radius-lg: 12px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ── Boutons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .18s, opacity .18s, transform .1s;
}
.btn:active       { transform: scale(.97); }
.btn:disabled     { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary      { background: var(--accent);   color: #fff; }
.btn-primary:hover{ background: #c73652; }

.btn-secondary    { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-danger       { background: rgba(233,69,96,.15); color: var(--accent); border: 1px solid rgba(233,69,96,.3); }
.btn-danger:hover { background: rgba(233,69,96,.25); }

.btn-icon         { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-icon:hover   { background: var(--border); }

.btn-full         { width: 100%; }

/* ── Inputs / textarea ──────────────────────────────────────────────────── */
input, textarea, select {
  font-family: inherit;
  font-size: .9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,.15);
}
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ── Labels ─────────────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 6px;
}

/* ── Titres de section ──────────────────────────────────────────────────── */
.section-title {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ── Indicateur clé API ─────────────────────────────────────────────────── */
.api-key-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
}
.dot              { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok           { background: var(--success); }
.dot-miss         { background: var(--accent); }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.modal-box h3  { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.modal-box > p { font-size: .83rem; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }

.input-with-toggle { position: relative; }
.input-with-toggle input { width: 100%; padding: 12px 44px 12px 14px; }
.toggle-vis {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px;
  font-size: .85rem;
}

.modal-actions    { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; padding: 11px; }

.modal-msg        { font-size: .82rem; margin-top: 12px; min-height: 18px; text-align: center; }
.msg-ok           { color: var(--success); }
.msg-err          { color: var(--accent); }

/* ── Formulaire (erreur) ────────────────────────────────────────────────── */
.form-error {
  background: rgba(233,69,96,.12);
  border: 1px solid rgba(233,69,96,.35);
  border-radius: var(--radius);
  padding: 11px 15px;
  font-size: .83rem;
  color: var(--accent);
  margin-top: 16px;
  text-align: center;
}
