/* main.css — shared styles + design tokens for Doppelbot.
   No framework. CSS variables drive theming; dark mode via prefers-color-scheme. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --text: #1a1d29;
  --text-muted: #5b6072;
  --border: #e3e6ef;
  --primary: #5b53ff;
  --primary-700: #463edb;
  --primary-contrast: #ffffff;
  --success: #1c8a5a;
  --warn: #b8730a;
  --error: #c4344b;
  --info: #2b6cb0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(20, 22, 40, 0.08);
  --maxw: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #171a23;
    --surface-2: #1f2330;
    --text: #eef0f7;
    --text-muted: #9aa0b4;
    --border: #2a2f3d;
    --primary: #7b73ff;
    --primary-700: #6a62f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
.muted { color: var(--text-muted); }
small.field-hint { display: block; color: var(--text-muted); margin-top: 4px; font-size: .82rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; cursor: pointer; border: 1px solid transparent;
  padding: .7rem 1.1rem; border-radius: var(--radius-sm); font: inherit;
  font-weight: 600; text-align: center; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-700); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }

/* ---- Forms ---- */
.form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .92rem; }
.form input, .form select, .form textarea {
  width: 100%; margin-top: .35rem; padding: .65rem .75rem; font: inherit;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.slug-field { display: flex; align-items: stretch; margin-top: .35rem; }
.slug-field input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.slug-suffix {
  display: flex; align-items: center; padding: 0 .75rem; white-space: nowrap;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .9rem;
}
.field-hint.is-ok { color: var(--success); }
.field-hint.is-bad { color: var(--error); }

/* ---- Banners ---- */
.banner { padding: .75rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1rem; font-size: .92rem; }
.banner-error   { background: color-mix(in srgb, var(--error) 12%, var(--surface)); color: var(--error); }
.banner-success { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.banner-warn    { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.banner-info    { background: color-mix(in srgb, var(--info) 12%, var(--surface)); color: var(--info); }

/* ---- Brand wordmark ---- */
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--text); display: inline-block; margin-bottom: 1rem; }
.brand span { color: var(--primary); }
.brand:hover { text-decoration: none; }

/* ---- Auth / centered card layout ---- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.auth-card.center { text-align: center; }
.auth-alt { margin-top: 1.2rem; font-size: .92rem; color: var(--text-muted); }
