:root {
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --surface: #ffffff;
  --text: #111827;
  --text-secondary: #667085;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --border-strong: #d0d5dd;
  --danger: #b42318;
  --success: #027a48;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 18px 45px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body.auth-page {
  min-width: 0;
  margin: 0;
  background:
    radial-gradient(circle at 14% 10%, rgba(37, 99, 235, 0.08), transparent 20rem),
    var(--bg-soft);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

.auth-shell {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem 1.5rem;
  width: 100%;
}

.auth-logo {
  margin-bottom: 1.25rem;
  text-align: center;
  width: 100%;
}

.auth-logo img {
  display: inline-block;
  height: 42px;
  max-width: min(220px, calc(100vw - 2rem));
  object-fit: contain;
  width: auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  max-width: 440px;
  padding: 1.5rem;
  width: 100%;
}

.auth-card h1 {
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0 0 0.65rem;
}

.auth-card p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.auth-card label {
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-card .form-control {
  border-color: var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  min-height: 46px;
}

.auth-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

.auth-card .btn {
  border-radius: 8px;
  font-weight: 750;
  min-height: 46px;
  white-space: normal;
}

.auth-card .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.auth-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
  color: var(--primary-hover);
  text-decoration: underline;
}

.auth-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
}

.auth-legal-notice {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 0.9rem;
  overflow-wrap: anywhere;
  text-align: center;
}

.auth-terms-check {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.auth-terms-check .form-check-input {
  flex: 0 0 auto;
  margin-left: 0;
  margin-top: 0.25rem;
}

.auth-terms-check .form-check-label {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.auth-legal-links {
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 0.9rem;
}

.auth-legal-links a {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.auth-legal-links a:hover,
.auth-legal-links a:focus {
  color: var(--primary);
  text-decoration: underline;
}

.auth-recaptcha {
  min-height: 78px;
  overflow: hidden;
}

.auth-card .alert {
  border-radius: 8px;
  font-size: 0.95rem;
}

.auth-card .alert-danger {
  background: #fff4f2;
  border-color: #fecdca;
  color: var(--danger);
}

.auth-card .alert-success {
  background: #ecfdf3;
  border-color: #abefc6;
  color: var(--success);
}

@media (max-width: 575.98px) {
  .auth-shell {
    justify-content: flex-start;
    padding: 1.25rem 0.75rem 1rem;
  }

  .auth-logo {
    margin-bottom: 0.75rem;
  }

  .auth-logo img {
    height: 32px;
  }

  .auth-card {
    padding: 1rem;
  }

  .auth-card h1 {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
  }

  .auth-card .mb-4 {
    margin-bottom: 1rem !important;
  }

  .auth-card .mb-3 {
    margin-bottom: 0.75rem !important;
  }

  .auth-card .mt-4 {
    margin-top: 1rem !important;
  }

  .auth-card .form-control,
  .auth-card .btn {
    min-height: 44px;
  }
}

@media (max-width: 359.98px) {
  .auth-shell {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .auth-card {
    padding: 1rem;
  }

  .auth-recaptcha {
    height: 68px;
    min-height: 68px;
    transform: scale(0.86);
    transform-origin: left top;
    width: 100%;
  }
}
