/* Shared styling for the server-rendered auth screens (/login,
   /register, /forgot-password, /reset-password, /login/2fa,
   /account/security). Kept dependency-free and visually neutral,
   loosely matching the console's palette. */

:root {
  --accent: #2d6cdf;
  --accent-dark: #1f4fa8;
  --text: #1c2430;
  --muted: #5b6675;
  --border: #d7dde6;
  --bg: #f3f5f8;
  --error-bg: #fdecec;
  --error-border: #e5a3a3;
  --error-text: #8a1f1f;
  --notice-bg: #e9f4ec;
  --notice-border: #a3cfae;
  --notice-text: #1f5c2d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 24px;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(28, 36, 48, 0.08);
}

/* Multi-section pages (e.g. /account/security) need room for their tables;
   login/register keep the narrow form width above. Still fluid on mobile
   (width:100% caps it below the viewport). */
.auth-card.wide {
  max-width: 760px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-brand h1 { font-size: 18px; margin: 0; font-weight: 600; }

h2 { font-size: 20px; margin: 0 0 16px; }

.auth-form { display: flex; flex-direction: column; gap: 6px; }

.auth-form label { font-weight: 600; font-size: 13px; margin-top: 10px; }
.auth-form label small { font-weight: 400; color: var(--muted); }

.auth-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}

.auth-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

button.primary {
  margin-top: 18px;
  padding: 11px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover { background: var(--accent-dark); }

.auth-error {
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 6px;
  color: var(--error-text);
  font-size: 14px;
}

.auth-notice {
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 6px;
  color: var(--notice-text);
  font-size: 14px;
}

.auth-links {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

/* Social login buttons + divider (rendered when providers are configured) */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.auth-social { display: flex; flex-direction: column; gap: 8px; }

.auth-social a {
  display: block;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.auth-social a:hover { background: var(--bg); }

button.secondary {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary:hover { background: var(--bg); }

/* Security page tables (passkeys, linked accounts, API keys) */
.auth-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.auth-table th, .auth-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.auth-table th { color: var(--muted); font-weight: 600; font-size: 13px; }

code.auth-code {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
}
