/* My Assess — Account (phase C). UI EN, thème clair, pas de framework. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #d9dce3;
  --text: #1c2430;
  --muted: #5b6675;
  --accent: #2f5fd7;
  --accent-strong: #24499f;
  --danger: #b3261e;
  --success: #1b6e3d;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.app-root { min-height: 100vh; display: flex; flex-direction: column; }

h1 { font-size: 1.45rem; margin: 0 0 .4rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }

/* --------------------------- Header / nav --------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 860px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}

.brand {
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  text-decoration: none; letter-spacing: .2px;
}

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }

.nav-link {
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--bg); }
.nav-link.active { color: var(--accent-strong); background: #e8edfa; }

.header-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-email { font-size: .85rem; }

/* ----------------------------- Layout ------------------------------- */

.page {
  width: 100%; max-width: 860px; margin: 0 auto; padding: 28px 20px 60px;
  display: flex; flex-direction: column; gap: 18px;
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}

/* ------------------------------ Login ------------------------------- */

.login-page {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: 40px 20px; gap: 14px;
}

.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin-bottom: 0; }

.login-separator { color: var(--muted); font-size: .85rem; }

.code-input { text-align: center; font-size: 1.5rem; letter-spacing: .5em; }

/* ------------------------------ Forms ------------------------------- */

.form-card { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
.field-label { font-weight: 600; font-size: .9rem; }
.field-help { color: var(--muted); font-size: .82rem; }

.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; background: var(--surface); color: var(--text);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.input:disabled { background: var(--bg); color: var(--muted); }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; }
.range-value { min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.form-actions { display: flex; justify-content: flex-end; }

/* ----------------------------- Buttons ------------------------------ */

.btn {
  padding: 9px 18px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .55; cursor: default; }

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

.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg); }

.btn-google {
  width: 100%; max-width: 380px; display: flex; justify-content: center;
  background: var(--surface);
}
.btn-google::before { content: "G"; font-weight: 700; color: var(--accent); margin-right: 8px; }

.btn-link {
  border: none; background: none; color: var(--accent); cursor: pointer;
  font: inherit; padding: 4px 0; align-self: flex-start;
}

/* ------------------------------ Status ------------------------------ */

.status { margin: 0; padding: 9px 12px; border-radius: 8px; font-size: .9rem; }
.status.success { background: #e6f4ea; color: var(--success); }
.status.error { background: #fbeae9; color: var(--danger); }
.hidden { display: none; }

.skeleton { font-style: italic; }

/* ----------------------------- Balance ------------------------------ */

.balance-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 28px;
}
.balance-value { font-size: 3rem; font-weight: 700; line-height: 1; }
.balance-label { color: var(--muted); font-weight: 500; }

/* ------------------------------ Tables ------------------------------ */

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .delta.positive { color: var(--success); font-weight: 600; }
.table .delta.negative { color: var(--danger); font-weight: 600; }
.lot-empty td { color: var(--muted); }

/* ---------------------------- Buy cards ----------------------------- */

.buy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 10px 0; }

.buy-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); background: var(--surface);
}
.buy-card:hover { border-color: var(--accent); }
.buy-label { font-weight: 700; }
.buy-price { color: var(--muted); font-size: .9rem; }
.buy-cta { color: var(--accent); font-weight: 600; margin-top: auto; }

/* ------------------------------ Small ------------------------------- */

@media (max-width: 560px) {
  .header-inner { gap: 10px; }
  .header-user { margin-left: 0; width: 100%; justify-content: space-between; }
}
