/* ============================================================
   GéoDyn — feuille de style des pages "chrome standard"
   (login, aide, configuration). L'éditeur lui-même a sa propre
   feuille de style (assets/editeur/css/style.css, crème/corail) —
   volontairement séparée, ce n'est pas une page de ce type.
   Base reprise telle quelle du template Hello World v0.1 / du
   testeur Python (mêmes variables, même système de carte/menu).
   ============================================================ */

:root {
  --bg-page: #f0f4f8;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-accent-soft: #e7f0f9;

  --text-primary: #0b2a3c;
  --text-secondary: #335f77;
  --text-muted: #7d93a3;

  --border: #dce5ed;

  --brand: #1a5f7a;
  --brand-hover: #0f4a62;
  --brand-light: #3b8cbf;
  --brand-tint: rgba(26, 95, 122, 0.08);
  --on-brand: #ffffff;

  --danger: #b33333;
  --danger-bg: #fbeaea;
  --on-danger: #ffffff;
  --success-text: #0f6e56;
  --success-bg: #dff3e6;
}

[data-theme="dark"] {
  --bg-page: #0f1720;
  --bg-card: #16212c;
  --bg-card-alt: #1a2733;
  --bg-accent-soft: #1c2e3a;

  --text-primary: #e2e8ee;
  --text-secondary: #9fb3c2;
  --text-muted: #7f97a8;

  --border: #2a3742;

  --brand: #4a9fc0;
  --brand-hover: #6cb6d4;
  --brand-light: #4a9fc0;
  --brand-tint: rgba(74, 159, 192, 0.14);
  --on-brand: #0f1720;

  --danger: #e6716f;
  --danger-bg: #3a1f1f;
  --on-danger: #1a0a0a;
  --success-text: #7fd9a0;
  --success-bg: #1e3d2c;
}

* { box-sizing: border-box; font-family: system-ui, 'Segoe UI', Roboto, sans-serif; }

body { background: var(--bg-page); margin: 0; padding: 20px; color: var(--text-primary); }

.app {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 32px;
  padding: 28px 26px 32px;
  box-shadow: 0 20px 40px rgba(0, 20, 40, 0.12);
}
.app.app-large { max-width: 900px; }

h1 { font-weight: 700; font-size: 1.5rem; margin: 0 0 18px 0; color: var(--text-primary); }

form { display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px 16px; margin-bottom: 16px; }
legend { padding: 0 8px; font-weight: 600; color: var(--brand); font-size: 0.85rem; }

label { font-weight: 600; font-size: 0.82rem; color: var(--text-secondary); display: block; margin-bottom: 4px; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border);
  font-size: 0.9rem; background: var(--bg-card-alt); color: var(--text-primary);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-light); background: var(--bg-card); }

.field { display: flex; flex-direction: column; gap: 2px; }

.btn {
  background: var(--brand); border: 1px solid var(--brand); color: var(--on-brand);
  font-weight: 600; padding: 10px 20px; border-radius: 30px; font-size: 0.88rem;
  cursor: pointer; transition: 0.15s; text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; }

.alert { padding: 10px 14px; border-radius: 12px; font-size: 0.85rem; margin-bottom: 4px; }
.alert-erreur { background: var(--danger-bg); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-info { background: var(--bg-accent-soft); color: var(--brand); border-left: 4px solid var(--brand-light); }

.topnav {
  position: sticky; top: 12px; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px;
  box-shadow: 0 12px 28px rgba(0, 20, 40, 0.10);
  max-width: 1400px; width: 97%; margin: 12px auto 20px;
}
.topnav-inner { display: flex; align-items: center; gap: 20px; padding: 10px 16px; flex-wrap: wrap; }
.topnav-brand { font-weight: 700; font-size: 1.02rem; color: var(--brand); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.topnav-links { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.topnav-link {
  padding: 8px 14px; border-radius: 10px; color: var(--text-secondary); text-decoration: none;
  font-weight: 600; font-size: 0.84rem; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease;
}
.topnav-link:hover { background: var(--bg-accent-soft); color: var(--brand); }
.topnav-link.active { background: var(--brand-tint); color: var(--brand); }
.topnav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topnav-who { background: var(--bg-accent-soft); padding: 6px 14px; border-radius: 30px; font-size: 0.82rem; color: var(--brand); font-weight: 600; white-space: nowrap; }

.theme-toggle {
  background: var(--bg-card-alt); border: 1px solid var(--border); border-radius: 30px;
  width: 34px; height: 34px; font-size: 1rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--bg-accent-soft); }

kbd {
  background: var(--bg-card-alt); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: 0.78rem; font-family: ui-monospace, Consolas, monospace;
}

pre.bloc-code {
  background: var(--bg-card-alt); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; overflow-x: auto; font-size: 0.8rem; line-height: 1.5;
}
