.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
}

.auth-topbar,
.auth-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.auth-topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.auth-topbar .brand {
  margin: 0;
}

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

.auth-layout {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
  align-items: center;
  gap: clamp(60px, 9vw, 130px);
  padding: 70px 0;
}

.auth-intro {
  max-width: 650px;
}

.auth-kicker,
.section-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
}

.auth-intro h1 {
  max-width: 620px;
  margin: 18px 0 20px;
  color: var(--text);
  font-size: clamp(45px, 6vw, 74px);
  font-weight: 690;
  letter-spacing: -.065em;
  line-height: .98;
}

.auth-intro > p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.auth-facts {
  display: grid;
  gap: 0;
  margin: 48px 0 0;
  border-top: 1px solid var(--line);
}

.auth-facts > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.auth-facts dt {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.auth-facts dd {
  margin: 0;
}

.auth-facts strong,
.auth-facts span {
  display: block;
}

.auth-facts strong {
  color: var(--text-soft);
  font-size: 14px;
}

.auth-facts span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.auth-free-note {
  margin-top: 20px !important;
  color: var(--text-soft) !important;
  font-size: 13px !important;
}

.auth-panel {
  width: 100%;
}

.auth-card {
  width: 100%;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.auth-tab {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.auth-tab:hover {
  color: var(--text-soft);
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}

.auth-heading {
  margin: 28px 0 22px;
}

.auth-heading h2 {
  margin: 7px 0 5px;
  color: var(--text);
  font-size: 24px;
  font-weight: 690;
  letter-spacing: -.04em;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.auth-form .field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-form .field input {
  width: 100%;
  height: 43px;
  min-height: 43px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.auth-form .field input::placeholder {
  color: color-mix(in srgb, var(--muted) 65%, transparent);
}

.auth-form .field input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.auth-form .field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-field {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.check-field input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent-strong);
}

.auth-card .button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.auth-card .button svg {
  width: 15px;
  height: 15px;
}

.auth-card .button--primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #11142b;
}

html[data-theme="light"] .auth-card .button--primary {
  color: white;
}

.auth-card .button--primary:hover {
  background: var(--accent-strong);
}

.auth-card .button--secondary {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text-soft);
}

.auth-card .button:disabled {
  cursor: wait;
  opacity: .58;
}

.link-button,
.back-button {
  width: max-content;
  max-width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.link-button {
  margin: 0 auto;
}

.link-button:hover,
.back-button:hover {
  color: var(--accent);
}

.notice {
  margin-bottom: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}

.notice.is-success {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.notice.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-footnote {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.auth-footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .auth-top-note,
  .auth-intro {
    display: none;
  }

  .auth-layout {
    grid-template-columns: minmax(0, 430px);
    justify-content: center;
    padding: 42px 0;
  }
}

@media (max-width: 540px) {
  .auth-topbar,
  .auth-layout,
  .auth-footer {
    width: min(100% - 24px, 430px);
  }

  .auth-topbar {
    min-height: 66px;
  }

  .auth-layout {
    padding: 24px 0;
  }

  .auth-card {
    padding: 19px;
    box-shadow: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .auth-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }
}

/* Auth layout stays within the viewport when the design pack increases typography. */
.auth-page { overflow-x: clip; }
.auth-layout { min-width: 0; grid-template-columns: minmax(0,1fr) minmax(340px,430px); gap: clamp(28px,6vw,90px); }
.auth-intro, .auth-panel { min-width: 0; }
.auth-intro h1 { overflow-wrap: normal; font-size: clamp(2.3rem,4.6vw,4rem); }
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: minmax(0,430px); }
}
@media (max-width: 540px) {
  .auth-layout { grid-template-columns: minmax(0,1fr); }
}
