.auth-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}

.brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0f172a;
  color: #fff;
  padding: 56px 52px;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at left top, rgba(59,130,246,0.5), transparent 36%), radial-gradient(circle at right bottom, rgba(168,85,247,0.35), transparent 38%);
  opacity: 0.9;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.08;
}

.brand-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.brand-kicker::before {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.4);
}

.brand-title {
  font-size: clamp(2.3rem, 3vw, 4rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.brand-title .accent {
  background: linear-gradient(90deg, #93c5fd, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-copy {
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  line-height: 1.7;
  max-width: 460px;
}

.brand-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 28px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

.brand-links a:hover {
  color: #fff;
}

.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fff;
}

.auth-card {
  width: min(100%, 420px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #111827;
  letter-spacing: -0.03em;
}

.auth-sub {
  color: var(--muted-text);
  margin-bottom: 18px;
  font-size: 14px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 15px;
  color: #111827;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input[type="password"]::-ms-reveal,
.login-form input[type="password"]::-ms-clear {
  display: none;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.muted-link {
  color: var(--muted-text);
  font-size: 14px;
}

.muted-link:hover {
  color: var(--primary);
}

.submit-btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--primary);
  border: 2px solid var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

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

.helper-text {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted-text);
}

.helper-text a {
  color: #111827;
  font-weight: 600;
}

.helper-text a:hover {
  color: var(--primary);
}

.form-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, .22);
  border-radius: 9px;
  background: rgba(220, 38, 38, .06);
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.5;
}

.form-alert.is-success {
  border-color: rgba(37, 99, 235, .22);
  background: rgba(37, 99, 235, .06);
  color: #1d4ed8;
}

.form-alert[hidden] {
  display: none !important;
}

.turnstile-slot {
  display: flex;
  justify-content: center;
  min-height: 66px;
  margin: 12px 0;
}

.turnstile-test-skip {
  align-self: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--muted);
  color: var(--muted-text);
  cursor: pointer;
  font-size: 12px;
}

.turnstile-test-skip:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.turnstile-test-skip:disabled {
  cursor: default;
  opacity: .7;
}

.turnstile-slot.turnstile-unavailable {
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-text);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.recovery-help {
  margin: -5px 0 10px;
  color: var(--muted-text);
  font-size: 12px;
}

.recovery-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  text-align: center;
  text-decoration: none;
}

.submit-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.password-field {
  position: relative;
  margin-bottom: 14px;
}

.password-field input {
  padding-right: 84px;
}

.password-field .password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted-text);
  cursor: pointer;
  font-size: 12px;
}

.login-password-field {
  position: relative;
  display: block;
}

.login-password-field input {
  padding-right: 78px;
}

.login-password-field .password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted-text);
  cursor: pointer;
  font-size: 12px;
}

.password-field + label {
  display: block;
  margin: 12px 0 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

#recovery-form label,
#reset-password-form > label {
  display: block;
  margin: 12px 0 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

#recovery-form input,
#reset-password-form input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
}

#recovery-form input:focus,
#reset-password-form input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

#recovery-success a,
#reset-success a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-card > section[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: none;
  }

  .form-panel {
    padding-top: 40px;
    padding-bottom: 40px;
  }
}

@media (max-width: 600px) {
  .auth-card {
    margin: 0 16px;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .submit-btn {
    width: 100%;
  }
}
