/* ══════════════════════════════════════════════════════════════
   Sol-matched theme for the auth flow (login / 2FA / OAuth consent
   / OAuth error). Design tokens mirror sol.fresonate.com
   (services/tasks/client/src/index.css). Standalone — no Pico.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg-canvas: #0d1117;
  --bg-default: #161b22;
  --bg-subtle: #21262d;
  --bg-emphasis: #30363d;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --btn-primary: #238636;
  --btn-primary-border: #2ea043;
  --btn-primary-hover: #2ea043;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--bg-emphasis); border-radius: 4px; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* ── Layout: centered auth card ─────────────────────────────── */
.auth-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.auth-brand .auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  color: #0d1117;
  font-weight: 800;
  font-size: 16px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-default);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}
.auth-card--wide { max-width: 460px; }

.auth-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  text-align: center;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

/* ── Forms ──────────────────────────────────────────────────── */
form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span,
label.field-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--text-muted); }
input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
}

/* Checkbox row (e.g. "Trust this browser") */
.check-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* ── Buttons ────────────────────────────────────────────────── */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--btn-primary-border);
  background: var(--btn-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
button:hover,
.btn:hover { background: var(--btn-primary-hover); text-decoration: none; }
button:disabled { opacity: 0.65; cursor: default; }

.btn-secondary,
button.secondary {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover,
button.secondary:hover { background: var(--bg-emphasis); }

.btn-danger {
  background: #da3633;
  border-color: var(--accent-red);
  color: #fff;
}
.btn-danger:hover { background: var(--accent-red); }

/* Google / OAuth provider button */
.btn-oauth {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-oauth:hover { background: var(--bg-emphasis); }

.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ── Messages ───────────────────────────────────────────────── */
.error {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: #ff9a92;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.success {
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--accent-green);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 6px;
}

/* ── Misc helpers ───────────────────────────────────────────── */
.muted-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 2px 0;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* One-time-code input (2FA) */
input.otp-code {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 22px;
  padding: 12px;
}
input.backup-code {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ── OAuth consent ──────────────────────────────────────────── */
.consent-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.consent-app-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--accent-blue);
}
.consent-app-name { font-size: 16px; font-weight: 600; }
.consent-lead { font-size: 13px; color: var(--text-secondary); text-align: center; }

.scope-list {
  list-style: none;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  margin: 4px 0 2px;
}
.scope-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
}
.scope-list li + li { border-top: 1px solid var(--border); }
.scope-list li::before {
  content: "✓";
  color: var(--accent-green);
  font-weight: 700;
  font-size: 13px;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 18px;
}
