:root {
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

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

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

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

/* ── Logo ── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.logo:hover { text-decoration: none; }
.logo svg { width: 32px; height: 32px; flex-shrink: 0; }
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }

/* ── Auth layout ── */
.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-container { width: 100%; max-width: 400px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header .logo { justify-content: center; margin-bottom: 1.5rem; }
.auth-header h1 { font-size: 1.5rem; font-weight: 600; }
.auth-header p { color: var(--text-secondary); margin-top: .5rem; font-size: 13px; }

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  border: 1px solid var(--border);
}

/* ── Form ── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79 70 229 / .12);
}
.form-input::placeholder { color: var(--text-muted); }

.password-wrapper { position: relative; }
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
}
.password-toggle:hover { color: var(--text-secondary); }

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background-color .15s, opacity .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-page); }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.divider::before,
.divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 13px;
}

/* ── Alert ── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  display: none;
}
.alert.show { display: block; }
.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}
.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255 255 255 / .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 12px;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text-secondary); }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: .5rem;
}
.footer-sep { color: var(--border); }

/* ── Content pages (terms, privacy, status) ── */
.content-page { flex: 1; padding: 2rem 1rem; }
.content-header { text-align: center; padding: 1.5rem 0; }
.content-header .logo { justify-content: center; }

.content-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 2.5rem;
}
.content-card h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: .5rem; }
.content-card .meta { font-size: 13px; color: var(--text-muted); margin-bottom: 2rem; }
.content-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: .75rem;
}
.content-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}
.content-card ul {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  line-height: 1.7;
}
.content-card li { margin-bottom: .35rem; }

/* ── Status page ── */
.status-card { max-width: 560px; }
.status-banner {
  text-align: center;
  padding: 1.25rem;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}
.status-banner h2 {
  color: var(--success);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green { background: var(--success); }

.status-list { list-style: none; }
.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .875rem 0;
  border-bottom: 1px solid var(--border);
}
.status-item:last-child { border-bottom: none; }
.status-item-name { font-weight: 500; font-size: 14px; }
.status-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
}
.status-item-badge .dot { width: 8px; height: 8px; }
.status-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-card, .content-card { padding: 1.5rem; }
  .auth-header h1, .content-card h1 { font-size: 1.25rem; }
}
