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

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  width: min(100%, 1180px);
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  margin-inline: auto;
  padding: 96px var(--pad) 72px;
}

.auth-brand-panel {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}

.auth-brand-panel h1 {
  max-width: 620px;
  font-size: clamp(34px, 9vw, 42px);
}

.auth-logo { min-height: 42px; margin: 18px 0 28px; }
.auth-logo .company-icon { max-width: 170px; max-height: 64px; }
.auth-logo .company-wordmark { font-size: 28px; font-weight: 750; }
.auth-facts { display: none; gap: 14px; padding: 0; list-style: none; color: var(--muted); }
.auth-facts li::before { margin-right: 10px; color: var(--blue); content: '—'; }

.auth-card {
  padding: clamp(18px, 5vw, 24px);
  border: 1px solid var(--line);
  background: var(--white);
}

.auth-card h2 { margin-bottom: 24px; font-size: clamp(28px, 7vw, 34px); }
.auth-card .form { max-width: none; }
.auth-card input, .auth-card select { width: 100%; min-height: 48px; font-size: 16px; }
.auth-card select { appearance: none; padding: 10px 44px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); cursor: pointer; }
.auth-card select:focus { border-color: var(--blue); outline: 3px solid color-mix(in srgb, var(--blue) 22%, transparent); outline-offset: 0; }
.select-wrap { display: block; }
.auth-links { margin: 22px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.auth-links a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.auth-form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.auth-form-actions .text-link { color: var(--blue); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.notice, .form-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  background: var(--soft);
  font-size: 14px;
}

.notice strong, .form-error strong { display: block; overflow-wrap: anywhere; }
.form-error { border-left-color: #b42318; }
.password-wrap { position: relative; display: block; width: 100%; min-width: 0; }
.password-wrap input { padding-right: 64px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #656a73;
  cursor: pointer;
}
.password-toggle svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle:hover { background: #f1f3f5; color: #17191c; }
.password-toggle:focus-visible { outline: 2px solid #17191c; outline-offset: 2px; }
.password-toggle .password-eye-off { display: none; }
.password-toggle.is-visible .password-eye-open { display: none; }
.password-toggle.is-visible .password-eye-off { display: block; }
.password-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.password-checklist span { display: flex; align-items: flex-start; gap: 7px; }
.password-checklist span::before { content: '○'; flex: 0 0 auto; color: var(--muted); font-size: 15px; line-height: 1.1; }
.password-checklist span[data-valid="true"] { color: #26734d; }
.password-checklist span[data-valid="true"]::before { content: '✓'; color: #26734d; font-weight: 700; }
.auth-card meter { display: block; margin-top: 4px; }
.consent-group { display: grid; gap: 14px; margin-top: 2px; }
.form label.checkbox { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.checkbox input { width: 18px; min-height: 18px; margin-top: 3px; flex: 0 0 auto; }
.checkbox a { color: var(--blue); text-decoration: underline; }
.form-note { margin: 0; padding: 12px 14px; border-left: 3px solid #d99a18; background: #fff8e8; color: #63501f; font-size: 13px; line-height: 1.5; }
.form-note strong { color: #4c3b12; }
meter { width: 100%; height: 8px; }
.submit-spinner { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .submit-spinner { display: inline-block; }
.is-loading [data-submit-label] { opacity: .7; }

@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: clamp(40px, 9vw, 140px);
    padding-top: 104px;
  }
  .auth-brand-panel { padding: 28px 0 28px 32px; border-bottom: 0; border-left: 3px solid var(--blue); }
  .auth-brand-panel h1 { font-size: clamp(38px, 5vw, 66px); }
  .auth-card { padding: 32px; }
  .auth-card h2 { font-size: 34px; }
  .auth-facts { display: grid; }
}

@media (max-width: 520px) {
  .password-checklist { grid-template-columns: 1fr; }
}

/* Authentication form layout. */
body.page-login, body.page-signup { --header-h: 64px; }
body.page-login .site-header, body.page-signup .site-header { height: 64px; background: #fff; border-bottom-color: #eceef0; }
body.page-login .site-nav, body.page-signup .site-nav,
body.page-login .support-button, body.page-signup .support-button,
body.page-login .menu-toggle, body.page-signup .menu-toggle { display: none !important; }
body.page-login .header-actions, body.page-signup .header-actions { margin-left: auto; }
.auth-region-caption { display: none; }
body.page-login .globe-button, body.page-signup .globe-button { display: inline-flex; width: auto; min-width: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 1px solid #e2e5e8; border-radius: 999px; background: #fff; }
body.page-login .auth-region-caption, body.page-signup .auth-region-caption { display: inline; color: #373b40; font-size: 12px; font-weight: 600; }

body.page-login .auth-flow-page, body.page-signup .auth-flow-page {
  display: flex;
  width: min(calc(100% - 2 * var(--pad)), 560px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: calc(100svh - var(--header-h));
  margin-inline: auto;
  padding: calc(var(--header-h) + clamp(28px, 6vh, 64px)) 0 56px;
}
body.page-signup .auth-flow-page { justify-content: flex-start; padding-top: calc(var(--header-h) + clamp(24px, 4vh, 42px)); }
body.page-login .auth-flow-page > .auth-card, body.page-signup .auth-flow-page > .auth-card {
  width: 100%;
  max-width: 480px;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid #e3e6e9;
  border-radius: 14px;
  background: #fff;
}
.auth-title { margin: 0 0 24px; color: #15171a; font-size: clamp(32px, 6vw, 40px); font-weight: 550; letter-spacing: -.045em; line-height: 1.08; }
.auth-form { width: 100%; min-width: 0; max-width: none; gap: 18px; }
.auth-card .auth-form label:not(.checkbox) { width: 100%; min-width: 0; gap: 8px; color: #373b40; font-size: 13px; font-weight: 600; }
.auth-card .auth-form input:not([type="checkbox"]), .auth-card .auth-form select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 15px;
  border: 1px solid #d6dade;
  border-radius: 6px;
  background-color: #fff;
  color: #17191c;
  font-size: 15px;
  line-height: 1.25;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.auth-card .auth-form input:not([type="checkbox"]):hover, .auth-card .auth-form select:hover { border-color: #aeb4ba; }
.auth-card .auth-form input:not([type="checkbox"]):focus-visible, .auth-card .auth-form select:focus-visible { border-color: #aeb4ba; outline: 2px solid rgb(23 25 28 / 8%); outline-offset: 1px; }
.auth-card .auth-form select { appearance: none; padding: 0 48px 0 15px; cursor: pointer; }
.select-wrap { position: relative; display: block; width: 100%; min-width: 0; }
.select-chevron { position: absolute; top: 50%; right: 15px; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: #565b62; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.auth-country-field { display: grid; width: 100%; min-width: 0; gap: 8px; }
.auth-field-label { color: #373b40; font-size: 13px; font-weight: 600; }
.country-picker-custom { position: relative; width: 100%; min-width: 0; }
.country-trigger { display: flex; width: 100%; height: 48px; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border: 1px solid #d6dade; border-radius: 6px; background: #fff; color: #17191c; font: inherit; font-size: 15px; text-align: left; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.country-trigger:hover { border-color: #aeb4ba; }
.country-trigger:focus-visible, .country-search:focus-visible { border-color: #aeb4ba; outline: 2px solid rgb(23 25 28 / 8%); outline-offset: 1px; }
.country-trigger-chevron { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: #565b62; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.country-menu { position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 80; padding: 8px; border: 1px solid #d6dade; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgb(17 24 39 / 14%); }
.auth-card .auth-form input.country-search { height: 40px; min-height: 40px; margin: 0 0 8px; padding: 0 12px; border-radius: 5px; }
.country-option-list { max-height: min(320px, 52svh); overflow-y: auto; overscroll-behavior: contain; }
.country-option-list [hidden], .country-empty[hidden] { display: none !important; }
.country-option { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 0; border-radius: 4px; background: transparent; color: #25282c; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.country-option:hover, .country-option:focus-visible { outline: none; background: #f2f4f6; }
.country-option[aria-selected="true"] { background: #f2f4f6; font-weight: 650; }
.country-option[aria-selected="true"]::after { color: #17191c; content: '✓'; }
.country-empty { margin: 4px 2px 2px; padding: 8px; color: #747a82; font-size: 13px; }
.member-name-fields { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.auth-card .password-wrap { position: relative; display: block; width: 100%; min-width: 0; }
.auth-card .password-wrap input { padding-right: 64px !important; }
.auth-card .password-toggle { right: 5px; }
.password-toggle:hover { background: #f1f3f5; color: #17191c; }
.field-hint { color: #747a82; font-size: 12px; line-height: 1.45; }
.auth-form-actions { display: grid; gap: 14px; }
.auth-form-actions .text-link, .auth-links a, .auth-card .text-link { color: #24272b; font-size: 13px; font-weight: 650; text-decoration: underline; text-decoration-color: #aeb3ba; text-underline-offset: 3px; }
.auth-form-actions .text-link { justify-self: center; }
.auth-card .auth-submit-button, .auth-card .auth-next-button {
  width: 100%;
  min-height: 54px;
  border: 1px solid #17191c;
  border-radius: 6px;
  background: #17191c;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
}
.auth-card .auth-submit-button:hover, .auth-card .auth-next-button:hover { border-color: #34383d; background: #34383d; color: #fff; }
.auth-card .auth-submit-button:disabled { cursor: wait; opacity: .72; }
.auth-links { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid #eceef0; color: #656a73; font-size: 13px; text-align: center; }
.auth-links a { margin-left: 3px; }
.auth-email-field { display: grid; gap: 18px; }
.auth-email-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 11px 14px; border: 1px solid #e0e3e6; border-radius: 6px; background: #f7f8f9; }
.auth-email-summary-copy { display: grid; min-width: 0; gap: 2px; overflow: hidden; }
.auth-email-summary-label { color: #747a82; font-size: 11px; }
.auth-email-summary strong { overflow: hidden; color: #23262a; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.auth-edit-email { flex: 0 0 auto; border: 0; background: transparent; cursor: pointer; }
.auth-password-stage { display: grid; gap: 18px; }
.auth-flow-page [hidden], body.page-login [hidden], body.page-signup [hidden] { display: none !important; }
.consent-group { gap: 12px; margin-top: 2px; }
.form label.checkbox { color: #535960; font-size: 13px; }
.checkbox input { accent-color: #17191c; }
.checkbox a { color: #24272b; text-underline-offset: 3px; }
body.page-login .site-footer, body.page-signup .site-footer { padding: 18px var(--pad) 14px; background: transparent; }
body.page-login .footer-bottom, body.page-signup .footer-bottom { padding-top: 0; border-top: 0; text-align: center; }

@media (max-width: 520px) {
  body.page-login .auth-flow-page, body.page-signup .auth-flow-page { width: calc(100% - 32px); gap: 14px; padding-bottom: 36px; }
  body.page-login .auth-flow-page > .auth-card, body.page-signup .auth-flow-page > .auth-card { padding: 23px 20px; border-radius: 12px; }
  .member-name-fields { grid-template-columns: 1fr; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card .auth-form input, .auth-card .auth-form select, .auth-card .auth-submit-button, .auth-card .auth-next-button { transition: none; }
}

/* Login and signup cards use the page surface without an enclosing rule. */
body.page-login .auth-card,
body.page-signup .auth-card,
body.page-login .auth-flow-page > .auth-card,
body.page-signup .auth-flow-page > .auth-card { border: 0; }
