:root {
  --ink: #10202a;
  --body: #4e5d66;
  --muted: #7a8a93;
  --paper: #f7faf9;
  --surface: #ffffff;
  --surface-2: #eef7f4;
  --line: #dce7e4;
  --teal: #12a88a;
  --teal-dark: #087462;
  --navy: #102f4a;
  --danger: #b42318;
  --success: #087462;
  --shadow: 0 28px 80px rgba(16, 32, 42, 0.13);
  --soft-shadow: 0 18px 46px rgba(16, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 14%, rgba(18, 168, 138, 0.14), transparent 28rem),
    radial-gradient(circle at 82% 22%, rgba(38, 120, 217, 0.1), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: clamp(32px, 6vw, 86px);
  align-items: center;
  width: min(1180px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 72px) 0;
}

.auth-shell > *,
.auth-story,
.story-copy,
.security-panel,
.auth-card,
.auth-form {
  min-width: 0;
  max-width: 100%;
}

.auth-story {
  display: grid;
  gap: clamp(34px, 5vw, 64px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.auth-brand img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.auth-brand span {
  display: grid;
  line-height: 1.02;
}

.auth-brand strong {
  font-size: 1.04rem;
  font-weight: 900;
}

.auth-brand small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-copy {
  max-width: 670px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(3rem, 6.4vw, 5.8rem);
  font-weight: 900;
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.55rem);
  font-weight: 900;
  line-height: 1.04;
}

h3 {
  font-size: 1.35rem;
  line-height: 1.18;
}

.story-copy p:not(.eyebrow),
.card-header p,
.security-panel p,
.session-card p {
  color: var(--body);
}

.story-copy p:not(.eyebrow) {
  max-width: 610px;
  margin: 24px 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
}

.security-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.security-panel div,
.auth-card,
.session-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(220, 231, 228, 0.94);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.security-panel div {
  min-height: 178px;
  padding: 20px;
  border-radius: 24px;
}

.security-panel span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 30px;
  margin-bottom: 24px;
  color: var(--teal-dark);
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.security-panel strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}

.security-panel p {
  margin: 10px 0 0;
  font-size: 0.94rem;
}

.auth-card {
  display: grid;
  gap: 22px;
  padding: clamp(24px, 4vw, 34px);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.card-header p {
  margin: 12px 0 0;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: #edf4f2;
  border-radius: 999px;
}

.mode-tab {
  min-height: 44px;
  color: var(--body);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.mode-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(16, 32, 42, 0.09);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.trial-note {
  margin: 0;
  padding: 12px 14px;
  color: var(--teal-dark);
  background: var(--surface-2);
  border: 1px solid rgba(47, 125, 117, 0.22);
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label,
.label-row {
  font-size: 0.9rem;
  font-weight: 900;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: rgba(18, 168, 138, 0.6);
  box-shadow: 0 0 0 4px rgba(18, 168, 138, 0.12);
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--body);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--teal);
}

.checkbox-row a {
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.password-field {
  position: relative;
}

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

.password-toggle,
.text-button {
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  font-weight: 900;
  text-align: right;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  min-height: 38px;
  padding: 8px 10px;
  transform: translateY(-50%);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  width: 100%;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.compact-action {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.recovery-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(238, 247, 244, 0.76);
  border: 1px solid rgba(220, 231, 228, 0.98);
  border-radius: 18px;
}

.recovery-panel[hidden] {
  display: none;
}

.recovery-panel p {
  margin: 0;
  color: var(--body);
  font-size: 0.9rem;
}

.recovery-copy {
  color: var(--muted);
}

.turnstile-field {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 65px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

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

#turnstile-widget {
  width: min(300px, 100%);
}

.turnstile-field iframe {
  max-width: 100%;
}

.primary-action {
  color: #ffffff;
  background: linear-gradient(135deg, var(--ink), var(--navy));
  border: 0;
  box-shadow: 0 16px 32px rgba(16, 32, 42, 0.16);
}

.secondary-action {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(16, 32, 42, 0.12);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
}

/* Live password requirement checklist (account-creation screen only). */
.password-reqs {
  list-style: none;
  margin: 4px 0 2px;
  padding: 14px 16px;
  display: grid;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.password-reqs li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.15s ease;
}

.password-reqs .req-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Met state: label turns teal and the circle fills with a white check. */
.password-reqs li.is-met {
  color: var(--teal);
}

.password-reqs li.is-met .req-mark {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.password-reqs li.is-met .req-mark::after {
  content: "✓";
}

@media (prefers-reduced-motion: reduce) {
  .password-reqs li,
  .password-reqs .req-mark {
    transition: none;
  }
}

.field-hint {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.field-hint.is-success {
  color: var(--teal-dark);
}

.field-hint.is-error {
  color: var(--danger);
}

.auth-status {
  display: none;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 850;
}

.auth-status.is-visible {
  display: block;
}

.auth-status.is-success {
  color: var(--success);
  background: rgba(18, 168, 138, 0.11);
  border: 1px solid rgba(18, 168, 138, 0.22);
}

.auth-status.is-error {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.16);
}

.session-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 22px;
}

.session-card[hidden] {
  display: none;
}

.session-card p {
  margin: 8px 0 0;
}

@media (max-width: 980px) {
  .auth-shell {
    display: flex;
    flex-direction: column;
    align-items: start;
  }

  .auth-story {
    display: contents;
  }

  .auth-brand { order: 0; }
  .auth-card { order: 1; width: 100%; }
  .story-copy { order: 2; margin-top: 34px; }
  .security-panel { order: 3; width: 100%; }

  .security-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    width: min(100% - 28px, 1180px);
    padding: 22px 0;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 3rem);
    line-height: 1;
  }

  .auth-card {
    border-radius: 24px;
  }
}
