:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --ink: #0f172a;
  --muted: #5b6074;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.1), transparent 40%),
              radial-gradient(circle at 80% 0%, rgba(15, 118, 110, 0.08), transparent 45%),
              #f4f6fb;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  overflow-y: auto;
}

.alert-box {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 18px;
  border-radius: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 320px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  z-index: 10;
}

.alert-success { background: rgba(16, 185, 129, 0.18); color: #065f46; }
.alert-error { background: rgba(239, 68, 68, 0.18); color: #7f1d1d; }
.alert-icon { font-size: 22px; line-height: 1; }
.alert-title { font-weight: 600; text-transform: uppercase; font-size: 0.78rem; }
.alert-message { font-size: 0.85rem; }
.alert-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: inherit;
  cursor: pointer;
}

.auth-page {
  width: min(520px, 92vw);
}

.auth-wrapper {
  background: #fff;
  border-radius: 20px;
  padding: 18px 28px;
  box-shadow: 0 30px 55px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-card__logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-card__logo img {
  width: 140px;
}

.auth-tagline {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: var(--muted);
}

.auth-pill {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.65rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--ink);
}

.auth-subtitle {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

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

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

.auth-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #161b31;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.58rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(244, 247, 252, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-shell:focus-within {
  border-color: rgba(37, 99, 235, 0.6);
  background: #fff;
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.15);
}

.input-shell i {
  color: rgba(37, 99, 235, 0.8);
}

.input-shell input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.94rem;
  color: var(--ink);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-graphic {
  min-width: 100px;
  height: 45px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-graphic img {
  max-height: 100%;
}

.captcha-refresh {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  border: none;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.2s ease;
}

.captcha-refresh:hover {
  transform: rotate(180deg);
  background: rgba(37, 99, 235, 0.2);
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-options .remember {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-options a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.primary-btn {
  border: none;
  border-radius: 14px;
  padding: 0.7rem 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 24px 40px rgba(37, 99, 235, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 28px 45px rgba(37, 99, 235, 0.3);
}

.auth-divider {
  position: relative;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.5);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 34%;
  height: 1px;
  background: rgba(15, 23, 42, 0.1);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.quick-access {
  display: flex;
  gap: 8px;
}

.quick-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(245, 247, 251, 0.9);
  color: rgba(15, 23, 42, 0.8);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.quick-btn:hover {
  background: rgba(37, 99, 235, 0.12);
}

.auth-footer {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
  text-align: center;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

footer.auth-footer-bar {
  margin-top: 24px;
  font-size: 0.82rem;
  color: rgba(15, 23, 42, 0.55);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 18px 32px;
  border-radius: 18px;
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.04);
  width: min(100%, 960px);
}

.footer-links {
  gap: 16px;
  justify-content: flex-start;
  display: flex;
  margin: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.footer-links a {
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: #4c5570;
  position: relative;
  padding-right: 14px;
}

.footer-links a::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  background: rgba(99, 102, 241, 0.5);
  transform: translateY(-50%);
  border-radius: 50%;
}

.footer-links a:last-child::after {
  display: none;
}

.footer-links a:hover {
  color: var(--primary);
}

p.text-footer-inner {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: #4c5570;
  white-space: nowrap;
}

.recovery-shell {
  width: min(460px, 92vw);
  margin: 8vh auto 20px;
  background: #fff;
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 30px 55px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.recovery-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.recovery-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.recovery-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recovery-pill {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.recovery-header h2 {
  font-size: 1.7rem;
  color: var(--ink);
}

.recovery-header p {
  color: var(--muted);
  line-height: 1.5;
}

.recovery-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recovery-form label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f2937;
}

.recovery-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.recovery-foot a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 520px) {
  body {
    padding: 18px;
    overflow: auto;
  }

  .auth-wrapper {
    padding: 22px;
  }

  .captcha-row {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-access {
    flex-direction: column;
  }

  footer.auth-footer-bar {
    flex-direction: column;
    text-align: center;
    width: 100%;
    padding: 18px 20px;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    white-space: normal;
  }
  .recovery-shell {
    margin: 4vh auto 16px;
    padding: 22px;
  }
}
