/* Atelier IA — base styles
   Inspired by brilliant.com: dark, focused, generous spacing, vivid accents.
*/

:root {
  --bg: #0c1224;
  --bg-elev-1: #141b33;
  --bg-elev-2: #1c2545;
  --bg-card: #ffffff;
  --bg-card-soft: #f6f7fb;
  --ink: #0e1428;
  --ink-soft: #4a5072;
  --ink-mute: #8a92ab;
  --line: #e6e8f1;
  --line-strong: #d2d6e3;

  --accent: #38e0c2;       /* teal */
  --accent-strong: #14c2a3;
  --accent-ink: #052b25;

  --coral: #ff6b6b;
  --amber: #ffb547;
  --indigo: #7c5cff;
  --violet: #b588ff;
  --green: #2ecc71;
  --red: #ff4d4f;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(8,12,30,.06), 0 8px 24px rgba(8,12,30,.08);
  --shadow-pop: 0 4px 12px rgba(8,12,30,.12), 0 16px 40px rgba(8,12,30,.18);

  --max-w: 720px;
  --t-fast: 120ms ease;
  --t: 220ms cubic-bezier(.2,.8,.2,1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  /* keep dark; this is a dark-first product */
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

img, svg { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; color: var(--ink); }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 .8em; }

/* Utility buttons */
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 14px 22px;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 6px 16px rgba(56, 224, 194, 0.25);
  min-width: 160px;
}
.primary-button:hover { background: var(--accent-strong); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled {
  background: var(--line); color: var(--ink-mute); box-shadow: none;
  cursor: not-allowed; transform: none;
}

.ghost-button {
  display: inline-flex; align-items: center; gap: .4em;
  padding: 10px 16px;
  background: transparent;
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast);
}
.ghost-button:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.4); }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .95rem;
}
.alert.error { background: #ffe6e7; color: #8b1a1a; border: 1px solid #ffb5b8; }
.alert.ok    { background: #def7e9; color: #0f5132; border: 1px solid #a3e0bb; }

.brand-mark {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 12px;
  font-weight: 800; letter-spacing: .5px;
  font-size: 1rem;
}
.brand-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.brand-row h1 { font-size: 1.2rem; margin: 0; color: var(--ink); }
.brand-sub { color: var(--ink-mute); font-size: .9rem; margin: 0; }

/* ========== AUTH PAGES ========== */
body.auth-page {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(800px 500px at 10% 110%, rgba(56,224,194,.18), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-pop);
}

.auth-card h2 { font-size: 1.4rem; margin: 16px 0 8px; }
.auth-lead { color: var(--ink-soft); font-size: .95rem; }
.auth-hint { color: var(--ink-mute); font-size: .85rem; margin-top: 18px; text-align: center; }

.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.auth-card label { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.auth-card input {
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  background: #fff; color: var(--ink);
}
.auth-card input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(56,224,194,.2);
}
.auth-card .otp-input {
  text-align: center;
  letter-spacing: 16px;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--mono);
}
.auth-card button[type=submit] { margin-top: 8px; align-self: stretch; }

/* ========== ERROR PAGES ========== */
.error-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.error-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 40px;
  max-width: 480px; text-align: center; box-shadow: var(--shadow-pop);
}
.error-card h1 { font-size: 1.6rem; margin-bottom: 12px; }
.error-card p { color: var(--ink-soft); margin-bottom: 24px; }
