:root {
  --page: #ffffff;
  --surface: #f3f3f4;
  --surface-hover: #e9e9eb;
  --text: #17171a;
  --muted: #5f6068;
  --line: #d7d7da;
  --accent: #e9185b;
  --accent-hover: #cf0d4c;
  --link: #3157e8;
  --danger: #c8273d;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { font-family: Arial, Helvetica, sans-serif; background: var(--page); color: var(--text); }

body { margin: 0; min-width: 320px; min-height: 100dvh; }

button, input, select { font: inherit; }

button, a, select { -webkit-tap-highlight-color: transparent; }

a { color: var(--link); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
.mode-switch { border: 0; background: none; padding: 0; color: var(--link); font-weight: 700; cursor: pointer; }
.mode-switch:hover { text-decoration: underline; }

.page-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.auth-card { width: min(100%, 660px); margin: 0 auto; padding: 42px 24px 54px; }

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-icon { display: block; flex: 0 0 30px; width: 30px; height: 36px; object-fit: contain; }
.brand-text { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; line-height: 1; }
.brand-strong { font-size: 27px; font-weight: 900; letter-spacing: -1.5px; }
.brand-light { font-size: 20px; font-weight: 400; letter-spacing: -.6px; }

.intro { margin-top: 68px; }
h1 { margin: 0; max-width: 560px; font-size: clamp(36px, 7vw, 54px); line-height: 1.08; letter-spacing: -2px; }
h1 span { color: var(--accent); }
.intro > p:first-of-type { max-width: 570px; margin: 32px 0 0; color: #303036; font-size: 21px; line-height: 1.5; }
.account-prompt { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 24px 0 0; font-size: 17px; }

.method-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 54px; border-bottom: 1px solid var(--line); }
.method-tab { position: relative; border: 0; background: none; padding: 0 0 15px; color: var(--muted); font-weight: 700; cursor: pointer; }
.method-tab::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; }
.method-tab.is-active { color: var(--text); }
.method-tab.is-active::after { background: var(--accent); }

form { margin-top: 28px; }
label { display: inline-block; margin-bottom: 12px; font-size: 18px; font-weight: 700; }
input { width: 100%; height: 62px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); padding: 0 18px; color: var(--text); font-size: 17px; outline: none; transition: border-color .2s, background-color .2s; }
input::placeholder { color: #777980; opacity: 1; }
input:hover { background: var(--surface-hover); }
input:focus { border-color: var(--text); background: var(--page); }
input[aria-invalid="true"] { border-color: var(--danger); }

.field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 28px; }
.field-heading label { margin: 0 0 12px; }
.field-heading a { white-space: nowrap; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 92px; }
.password-toggle { position: absolute; top: 50%; right: 14px; border: 0; background: none; color: var(--muted); padding: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transform: translateY(-50%); }

.form-message { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 14px; }
.form-message.success { color: #087b52; }
.social-message { margin-top: 12px; text-align: center; }

.primary-button, .social-button { width: 100%; min-height: 62px; border: 0; border-radius: var(--radius); cursor: pointer; transition: background-color .2s, transform .12s; }
.primary-button:active, .social-button:active { transform: scale(.99); }
.primary-button { margin-top: 8px; background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled { cursor: wait; opacity: .65; }

.separator { display: flex; align-items: center; gap: 18px; margin: 34px 0; color: #777980; }
.separator::before, .separator::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.social-button { display: flex; align-items: center; justify-content: center; gap: 10px; background: #101017; color: #f9f9fb; font-size: 19px; line-height: 1; }
.social-button:hover { background: #24242d; }
.social-icon { display: block; flex: 0 0 30px; width: 30px; height: 30px; object-fit: contain; }
.social-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1; }
.help-link { display: inline-block; margin-top: 38px; font-size: 17px; }

.page-footer { margin-top: auto; background: #f7f7f8; padding: 58px 24px; }
.page-footer select { display: block; width: min(100%, 612px); height: 58px; margin: 0 auto; border: 0; border-radius: var(--radius); background: #fff; padding: 0 18px; color: var(--text); font-weight: 700; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  .auth-card { padding: 32px 20px 46px; }
  .brand-icon { flex-basis: 27px; width: 27px; height: 32px; }
  .brand-strong { font-size: 23px; }
  .brand-light { font-size: 17px; }
  .intro { margin-top: 54px; }
  h1 { font-size: 39px; }
  .intro > p:first-of-type { font-size: 18px; }
  .method-tabs { margin-top: 44px; }
}

@media (max-width: 390px) {
  .field-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .field-heading a { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
