.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-logo-link {
  display: block;
  margin-bottom: 32px;
}

.auth-logo {
  height: 68px;
  display: block;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: #f1f2f6;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.form-field input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Password field with a show/hide ("eye") toggle pinned to its right edge. */
.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--primary);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.revealed .icon-eye {
  display: none;
}

.password-toggle.revealed .icon-eye-off {
  display: block;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.auth-error {
  background: var(--failed-bg);
  color: var(--failed);
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-info {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Cloudflare Turnstile widget (sign-up only); its iframe is 300px wide. */
.captcha-box {
  display: flex;
  justify-content: center;
  min-height: 65px;
  margin-bottom: 16px;
}

.auth-legal {
  text-align: center;
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.auth-switch {
  text-align: center;
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.auth-switch .btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin-left: 4px;
}

.hidden {
  display: none !important;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 18px;
}

.btn-google:hover {
  border-color: #c7c9d9;
  background: #fafafa;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 18px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 12px;
}

.tfa-title {
  font-size: 18px;
  margin: 0 0 8px;
  text-align: center;
}

.tfa-sub {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 0 0 22px;
  line-height: 1.5;
}

#twoFactorToken {
  text-align: center;
  letter-spacing: 4px;
  font-size: 18px;
  font-weight: 600;
}

.auth-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #86efac;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.btn-link-a,
.forgot-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.btn-link-a:hover,
.forgot-link:hover {
  text-decoration: underline;
}

.forgot-row {
  text-align: right;
  margin: -8px 0 16px;
}

/* Narrow phones: the Turnstile widget is a fixed 300px-wide iframe, so trim
   the page/card padding to keep it inside the card (375px and 360px phones). */
@media (max-width: 420px) {
  .auth-page {
    padding: 24px 10px;
  }

  .auth-card {
    padding: 20px 14px;
  }
}

/* Very narrow phones (320px): even with trimmed padding the 300px widget
   doesn't fit, so scale it down instead of letting it clip or scroll. */
@media (max-width: 359px) {
  .captcha-box {
    transform: scale(0.85);
    transform-origin: center top;
    margin-bottom: 6px;
  }
}
