:root {
  --bg-1: #edf2ff;
  --bg-2: #f6fbff;
  --card: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe4f0;
  --primary: #0a84ff;
  --primary-hover: #006ad7;
  --danger: #d70015;
  --radius-xl: 22px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-card: 0 24px 56px rgba(15, 23, 42, 0.14), 0 8px 20px rgba(15, 23, 42, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(860px 420px at -10% -10%, #d9e8ff 0%, rgba(217, 232, 255, 0) 60%),
    radial-gradient(760px 360px at 110% -20%, #dcf4ee 0%, rgba(220, 244, 238, 0) 58%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 58%, #eef4ff 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  padding: 20px;
  overflow: hidden;
  contain: layout paint style;
  transform: translateZ(0);
}

.hero h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.hero .muted {
  margin: 8px 0 0;
}

.login-type-switch {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fbff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  gap: 4px;
}

.type-btn {
  margin-top: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.type-btn:hover {
  background: #eef4ff;
  color: #1f2937;
}

.type-btn.active {
  background: #fff;
  color: #0b1324;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.type-btn:active {
  transform: none;
}

.login-type-hint {
  margin-top: 8px;
  line-height: 1.4;
}

.mode-switch {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fbff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  gap: 4px;
}

.mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: #fff;
  color: #0b1324;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.factor-switch {
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f8fbff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  gap: 4px;
}

.factor-btn {
  margin-top: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

.factor-btn:hover {
  background: #eef4ff;
  color: #1f2937;
}

.factor-btn.active {
  background: #fff;
  color: #0b1324;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.09);
}

.factor-btn:active {
  transform: none;
}

.factor-input-hidden {
  display: none;
}

.factor-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 2px;
}

.pane-window {
  margin-top: 14px;
  overflow: hidden;
  position: relative;
  contain: content;
}

.pane-track {
  width: 200%;
  display: flex;
  transform: translate3d(0, 0, 0);
  transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
  backface-visibility: hidden;
}

.login-card.is-reset .pane-track {
  transform: translate3d(-50%, 0, 0);
}

.pane {
  width: 50%;
  flex: 0 0 50%;
  padding: 2px 1px 2px;
  contain: layout paint;
}

.form-grid {
  display: grid;
  gap: 8px;
}

.login-form {
  margin-top: 14px;
}

label {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
button {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.3;
  font-family: inherit;
}

input:focus,
select:focus {
  border-color: #a9cfff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.13);
  outline: none;
}

button {
  margin-top: 4px;
  border-color: transparent;
  background: linear-gradient(180deg, #1f8bff, var(--primary));
  color: #fff;
  font-weight: 640;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

button:hover {
  background: var(--primary-hover);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.link-btn {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #1e4f95;
  padding: 6px 2px 2px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.link-btn:hover {
  color: #1b4f96;
  text-decoration: underline;
  background: transparent;
}

.status {
  min-height: 20px;
  margin-top: 6px;
}

.status.error {
  color: var(--danger);
}

.login-help {
  margin-top: 10px;
  line-height: 1.45;
}

.turnstile-wrap {
  margin-top: 4px;
  padding: 8px;
  border: 1px dashed #c9d8ea;
  border-radius: 12px;
  background: #f8fbff;
}

.turnstile-wrap[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .login-card {
    padding: 16px;
    border-radius: 16px;
  }
  .hero h1 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-btn,
  .pane-track,
  button {
    transition: none;
  }
}
