:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1a2332;
  --muted: #5c6b7a;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #eef2ff 0%, var(--bg) 45%, #f8fafc 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-link:hover h1,
.brand-link:focus-visible h1 {
  color: var(--accent);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.brand .brand-name {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 650;
}

.alert {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid #fecaca;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.72rem 0.85rem;
  font-size: 1rem;
  background: #fafbfc;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}

.actions {
  margin-top: 1.5rem;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

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

.btn-primary:active {
  transform: translateY(1px);
}

.mfa-code-input {
  letter-spacing: 0.2em;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.mfa-back-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.btn-secondary-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0.72rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.btn-secondary-login:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-secondary-login:active {
  transform: translateY(1px);
}

.footer-note {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--muted);
}

.footer-note-line {
  display: block;
}

.footer-note-session {
  margin-top: 0.55rem;
}

.login-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1rem;
  color: #94a3b8;
  font-size: 0.75rem;
}

.login-legal-links a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.login-legal-links a:hover,
.login-legal-links a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.request-access-shell {
  max-width: 560px;
}

.request-intro {
  margin: -0.5rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.request-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field textarea {
  width: 100%;
  resize: vertical;
  min-height: 6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  line-height: 1.45;
  background: #fafbfc;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}

.field-help {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.label-optional {
  color: var(--muted);
  font-weight: 400;
}

.request-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  cursor: pointer;
}

.request-consent input {
  margin: 0.18rem 0 0;
  flex: 0 0 auto;
}

.request-consent a,
.request-signin-link a {
  color: var(--accent);
}

.request-turnstile {
  min-height: 65px;
  margin: 1.75rem 0 0.35rem;
  display: flex;
  justify-content: flex-start;
}

.request-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.request-signin-link {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.request-success {
  padding: 0.25rem 0 0;
  text-align: center;
}

.request-success-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
  font-size: 1.35rem;
  font-weight: 700;
}

.request-success h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.request-success p {
  margin: 0 auto 1.5rem;
  max-width: 390px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.request-back-link {
  text-decoration: none;
}

@media (max-width: 540px) {
  .request-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
