:root {
  --bg: #0c1117;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: #101820;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.75);
  --muted: rgba(255, 255, 255, 0.55);
  --accent: #3d9cf5;
  --max: 620px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(61, 156, 245, 0.14), transparent 32rem), var(--bg);
  color: var(--text);
  line-height: 1.35;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.site-header .wrap.nav {
  max-width: 1160px;
}

header { border-bottom: 1px solid var(--border); background: rgba(12, 17, 23, 0.92); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.logo {
  color: inherit;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: 0;
  text-decoration: none;
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

main {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: start center;
  padding: 3rem 0;
}

.card {
  width: min(100%, 560px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

form { padding: 1.75rem; }
.field { margin-bottom: 1.1rem; }

.security-check-field { margin-top: 1.85rem; }

.choice-fieldset {
  padding: 0;
  border: 0;
  background: transparent;
}

label,
legend {
  display: block;
  margin-bottom: 0.45rem;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 400;
}

legend {
  padding: 0;
  letter-spacing: 0;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid rgba(61, 156, 245, 0.42);
  outline-offset: 2px;
  border-color: var(--accent);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--surface-2) inset;
  border-color: var(--accent);
  transition: background-color 9999s ease-out;
}

.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0.28rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

.option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.62rem 2.5rem 0.62rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.option input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.option:has(input:focus-visible) {
  outline: 2px solid rgba(61, 156, 245, 0.42);
  outline-offset: 2px;
}

.option:has(input:checked) {
  background: rgba(255, 255, 255, 0.105);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  color: var(--text);
  transform: scale(1.006);
}

.selection-check {
  align-items: center;
  background: #34d399;
  border-radius: 999px;
  color: #06101c;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  opacity: 0;
  position: absolute;
  right: 0.85rem;
  transform: scale(0.82);
  transition: opacity 160ms ease, transform 160ms ease;
  width: 20px;
}

.option:has(input:checked) .selection-check {
  opacity: 1;
  transform: scale(1);
}

.hidden { display: none !important; }

.login-fields {
  inline-size: 100%;
  margin-top: 1.7rem;
  min-inline-size: 0;
  position: relative;
  overflow: hidden;
  transition: height 180ms ease;
}

.login-field-panel {
  inline-size: 100%;
  left: 0;
  min-inline-size: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translateY(5px);
  transition: opacity 160ms ease, transform 160ms ease;
  width: 100%;
}

.login-field-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  position: absolute;
  transform: translateY(0);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  min-inline-size: 0;
}

@media (min-width: 620px) {
  .form-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@keyframes field-panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.captcha-box {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  overflow: hidden;
}

.captcha-fallback {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-soft);
  font-weight: 400;
  line-height: 1.2;
}

.captcha-fallback input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--accent);
  transition: transform 140ms ease;
}

.cf-turnstile:has(iframe) .captcha-fallback { display: none; }

.captcha-fallback input:checked { transform: scale(1.05); }

.security-status {
  align-items: center;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  text-align: center;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.security-status[hidden] { display: none !important; }

.security-spinner {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: security-spin 800ms linear infinite;
}

.security-status:not([data-state="loading"]) .security-spinner { display: none; }
.security-status[data-state="complete"] {
  animation: security-status-in 220ms ease-out;
  background: rgba(52, 211, 153, 0.1);
  color: rgba(167, 243, 208, 0.9);
}
.security-status[data-state="complete"]::before {
  align-items: center;
  background: rgba(52, 211, 153, 0.9);
  border-radius: 999px;
  color: #06101c;
  content: "\2713";
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 800;
  height: 0.95rem;
  justify-content: center;
  width: 0.95rem;
}
.security-status[data-state="error"] { color: rgba(248, 113, 113, 0.92); }
.security-status[data-state="challenge"] {
  color: var(--text-soft);
  font-weight: 500;
}

@keyframes security-spin {
  to { transform: rotate(360deg); }
}

@keyframes security-status-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 1.2rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #06101c;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.btn-primary { background: var(--accent); color: #06101c; }
.btn:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 7px 16px rgba(0, 0, 0, 0.3); }
.btn:active { transform: translateY(0) scale(0.995); }
.btn-primary:hover { background: #5eb0ff; color: #06101c; text-decoration: none; }
.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}
form.is-busy { cursor: wait; }
.btn-compact { width: auto; min-height: auto; padding: 0.5rem 1rem; }

.form-actions-button { margin-top: 1.35rem; }

form .form-actions-button {
  width: 100%;
  max-width: none;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.35rem 1.35rem 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(61, 156, 245, 0.1);
  color: var(--text);
}

.alert img,
.field-helper img { flex: 0 0 auto; }

.alert-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
}

.muted {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 400;
}

.trust-note {
  align-items: flex-start;
  display: inline-flex;
  gap: 0.55rem;
  justify-content: center;
  margin: 0.25rem auto 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: left;
}

form .trust-note { display: flex; width: fit-content; }

.trust-note img { flex: 0 0 auto; margin-top: 0.18rem; opacity: 0.78; }
.trust-note a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 0.12em; }

.alternate-action {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.alternate-action a {
  color: var(--text);
  font-weight: 650;
}

.field-helper {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.8rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.phone-helper { grid-column: 1 / -1; }

.security-summary {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .option,
  .selection-check,
  .security-status,
  .captcha-fallback input {
    transition: none;
  }
  .btn:hover,
  .btn:active,
  .option:has(input:checked) {
    transform: none;
  }
  .security-spinner,
  .security-status[data-state="complete"] {
    animation: none;
  }
}


.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* Homepage-aligned login typography and rhythm */
form {
  padding: 1.75rem;
  text-align: left;
}

.field {
  margin-bottom: 1.25rem;
}

.choice-fieldset {
  margin: 0;
}

.choice-fieldset legend {
  margin-bottom: 1.5rem;
  color: var(--text-soft);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.2;
}

label,
legend {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25;
}

input,
select {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
}

.radio-grid {
  margin-bottom: 0;
}

.option {
  min-height: 48px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

.login-fields {
  margin-top: 1.25rem;
}

.security-check-field {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.captcha-box {
  min-height: 78px;
}

.security-status,
.field-helper,
.security-summary,
.trust-note,
.alternate-action,
.muted {
  color: rgba(255, 255, 255, 0.58);
  font-weight: 400;
  line-height: 1.35;
}

.security-status,
.field-helper,
.security-summary,
.trust-note {
  font-size: 0.85rem;
}

.form-actions-button {
  margin-top: 1.5rem;
}

/* Shared auth polish aligned with the homepage system */
.choice-fieldset legend {
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.2;
}

.radio-grid {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.option {
  min-height: 48px;
  padding: 0.65rem 2.4rem 0.65rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-weight: 500;
}

.option:has(input:checked) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.login-fields {
  margin-top: 1.25rem;
}

.field-helper,
.security-summary,
.trust-note {
  font-size: 0.85rem;
  line-height: 1.3;
}

.security-summary {
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.56);
}

.trust-note {
  margin-top: 0.6rem;
  color: rgba(255, 255, 255, 0.56);
}

.alternate-action {
  margin-top: 1.75rem;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.95rem;
  line-height: 1.3;
}

.captcha-box a {
  opacity: 0.82;
}

.security-status[data-state="error"] {
  color: rgba(248, 113, 113, 0.9);
}

form .btn {
  min-height: 52px;
  padding: 0.9rem 1.4rem;
  border-radius: 8px;
  background: var(--accent);
  color: #06101c;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.1;
  box-shadow: 0 12px 34px rgba(61, 156, 245, 0.22);
}

form .btn:hover {
  box-shadow: 0 14px 34px rgba(61, 156, 245, 0.26);
}


.security-summary {
  margin: 1rem 0 0;
  text-align: left;
}

.trust-note {
  margin: 0.55rem 0 0;
  opacity: 0.82;
}

.trust-note a {
  color: rgba(255, 255, 255, 0.78);
}

.alternate-action {
  margin: 1.75rem 0 0;
  font-size: 0.95rem;
  text-align: left;
}

.alternate-action a {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}
form .trust-note {
  width: auto;
  margin-right: 0;
  margin-left: 0;
}
/* Subtle inline Turnstile treatment */
.security-check-field {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.captcha-box {
  min-height: 0;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.5rem;
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.cf-turnstile {
  max-width: 100%;
  line-height: 1.3;
  transform-origin: left center;
}

.cf-turnstile iframe {
  max-width: 100%;
  border-radius: 8px;
}

.captcha-fallback {
  gap: 0.55rem;
  padding: 0.4rem 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.3;
}

.captcha-fallback input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.security-status {
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.25rem 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
}

.security-status[data-state="complete"] {
  background: transparent;
  color: rgba(167, 243, 208, 0.88);
}

.security-status[data-state="complete"]::before {
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.68rem;
}

.security-status[data-state="challenge"] {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 400;
}

.form-actions-button {
  margin-top: 1.5rem;
}

/* Final auth rhythm overrides */
.security-summary {
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: left;
}

.trust-note {
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: left;
}

.alternate-action {
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: left;
}

.alternate-action a {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 500;
}

/* Auth bottom alignment rail */
form .security-summary,
form .trust-note,
form .alternate-action {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
  padding-right: 0;
  padding-left: 0;
  text-align: left;
}

form .trust-note {
  justify-content: flex-start;
}

form .alternate-action a {
  display: inline;
  margin: 0;
  padding: 0;
}

/* Let the shared footer follow the sign-in card naturally */
main {
  min-height: auto;
  padding: 3rem 0 2.75rem;
}
