:root {
  --auth-blue: #183f90;
  --auth-soft-blue: #e7eff7;
  --auth-muted: #90949a;
}

.auth-page {
  min-height: 100vh;
  color: #090b0e;
  background: linear-gradient(104deg, #fff 0%, #fbfdff 29%, #edf5ff 55%, #c8dcff 100%);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(520px, 670px);
  gap: clamp(70px, 9vw, 180px);
  align-items: center;
  width: min(1660px, calc(100% - 80px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 54px 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(32px, 3vw, 58px);
}

.auth-brand > img { width: clamp(210px, 16vw, 315px); flex: 0 0 auto; }
.auth-brand__copy { min-width: 400px; }
.auth-brand span { font-size: clamp(18px, 1.35vw, 26px); font-weight: 600; }
.auth-brand h1 { margin: 20px 0 40px; font-size: clamp(52px, 4vw, 72px); font-weight: 900; line-height: .92; letter-spacing: -.045em; }
.auth-brand p { margin: 0; font-size: clamp(17px, 1.15vw, 21px); line-height: 1.25; }

.auth-column { width: 100%; }
.auth-card {
  width: 100%;
  padding: 36px 38px 34px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 4px 16px rgba(25, 47, 74, .24);
}

.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 11px; border-radius: 18px; background: var(--auth-soft-blue); }
.auth-tabs a { display: grid; place-items: center; min-height: 59px; padding: 0 16px; border: 0; border-radius: 15px; background: transparent; color: #969696; font: inherit; font-size: 20px; text-decoration: none; }
.auth-tabs a.is-active { background: #fff; color: var(--auth-blue); box-shadow: 0 1px 3px rgba(52, 67, 84, .04); }

.auth-form { display: grid; gap: 14px; margin-top: 36px; }
.auth-form[hidden], .payment-result[hidden] { display: none; }
.auth-heading { margin-bottom: 19px; text-align: center; }
.auth-heading span { color: var(--auth-blue); font-size: 22px; }
.auth-heading h2 { margin: 12px 0 0; font-size: clamp(27px, 2vw, 32px); font-weight: 900; letter-spacing: -.03em; }

.auth-field { display: grid; gap: 6px; font-size: 16px; }
.auth-field > span:first-child { padding-left: 1px; }
.auth-field small { color: var(--auth-muted); font-size: 12px; font-weight: 400; }
.auth-field input { width: 100%; height: 58px; padding: 0 22px; border: 1px solid #d5d5d5; border-radius: 17px; background: #fff; color: #111; box-shadow: inset 0 1px 4px rgba(0, 0, 0, .08); font: inherit; font-size: 16px; outline: none; }
.auth-field input::placeholder { color: #8b8f96; opacity: 1; }
.auth-field input:focus { border-color: #6f91ce; box-shadow: 0 0 0 3px rgba(24, 63, 144, .11), inset 0 1px 4px rgba(0, 0, 0, .05); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 62px; }
.password-toggle { position: absolute; top: 50%; right: 16px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; background: transparent; color: #a0a0a0; transform: translateY(-50%); cursor: pointer; }
.password-toggle:hover { color: var(--auth-blue); }
.password-toggle svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.password-toggle.is-visible svg { fill: rgba(24, 63, 144, .08); }

.renew-link:hover { color: var(--auth-blue); }
.form-message { min-height: 18px; margin: -4px 0; color: #bb5a4f; font-size: 13px; text-align: center; }
.form-message:empty { display: none; }
.form-message.is-success { color: #438256; }

.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 13px; align-items: center; color: #b2b2b2; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: #b8b8b8; }
.google-button, .primary-button { width: 100%; min-height: 59px; border: 0; border-radius: 17px; font: inherit; font-size: 16px; cursor: pointer; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--auth-soft-blue); color: #15171a; }
.google-button:hover { background: #dce8f3; }
.google-button svg { width: 24px; height: 24px; flex: 0 0 auto; }
.primary-button { background: var(--auth-blue); color: #fff; font-weight: 800; }
.primary-button:hover { background: #2350a8; transform: translateY(-1px); box-shadow: 0 7px 16px rgba(24, 63, 144, .19); }
.primary-button:disabled { opacity: .62; cursor: wait; transform: none; }
.renew-link { justify-self: center; color: #858b93; font-size: 13px; text-decoration: none; }

.auth-legal { max-width: 580px; margin: 34px auto 0; color: #7d858d; font-size: 15px; line-height: 1.25; text-align: center; }
.auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--auth-blue); }

.payment-result { display: grid; gap: 17px; margin-top: 36px; }
.payment-result > span { color: var(--auth-blue); font-size: 14px; font-weight: 800; letter-spacing: .11em; text-align: center; }
.payment-result h2 { margin: -8px 0 4px; font-size: 30px; text-align: center; }
.payment-result p { margin: 0; color: #525d68; line-height: 1.5; text-align: center; }
.payment-result dl { display: grid; gap: 8px; margin: 0; }
.payment-result dl div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; border-radius: 13px; background: var(--auth-soft-blue); }
.payment-result dt { color: #667482; }
.payment-result dd { margin: 0; font-weight: 800; text-align: right; }
.payment-result .payment-hint { color: #7d858d; font-size: 13px; }
.payment-link { display: flex; align-items: center; justify-content: center; box-sizing: border-box; text-align: center; text-decoration: none; }

@media (max-width: 1500px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(480px, 570px); gap: 52px; width: min(1320px, calc(100% - 48px)); }
  .auth-brand { gap: 24px; }
  .auth-brand > img { width: 175px; }
  .auth-brand__copy { min-width: 0; }
  .auth-brand h1 { font-size: 48px; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; gap: 30px; width: min(620px, calc(100% - 32px)); padding: 32px 0; }
  .auth-brand { justify-content: center; }
  .auth-brand > img { width: 128px; }
  .auth-brand h1 { margin: 9px 0 0; font-size: 38px; }
  .auth-brand span { font-size: 15px; }
  .auth-brand p { display: none; }
}

@media (max-width: 560px) {
  .auth-page { background: linear-gradient(155deg, #fff 0%, #edf5ff 55%, #c8dcff 100%); }
  .auth-shell { width: min(100% - 24px, 500px); gap: 22px; padding: 22px 0 28px; }
  .auth-brand { gap: 16px; }
  .auth-brand > img { width: 82px; }
  .auth-brand span { font-size: 11px; }
  .auth-brand h1 { font-size: 28px; }
  .auth-card { padding: 18px 16px 23px; border-radius: 17px; }
  .auth-tabs { padding: 7px; border-radius: 14px; }
  .auth-tabs a { min-height: 48px; border-radius: 11px; font-size: 16px; }
  .auth-form { gap: 12px; margin-top: 26px; }
  .auth-heading { margin-bottom: 10px; }
  .auth-heading span { font-size: 18px; }
  .auth-heading h2 { font-size: 23px; }
  .auth-field input { height: 54px; border-radius: 14px; }
  .google-button, .primary-button { min-height: 54px; border-radius: 14px; font-size: 14px; }
  .auth-legal { margin-top: 22px; padding: 0 8px; font-size: 12px; }
}

@media (max-height: 850px) and (min-width: 901px) {
  .auth-shell { padding: 30px 0; }
  .auth-card { padding-top: 26px; padding-bottom: 25px; }
  .auth-form { gap: 10px; margin-top: 24px; }
  .auth-heading { margin-bottom: 10px; }
  .auth-field input { height: 52px; }
  .google-button, .primary-button { min-height: 52px; }
  .auth-legal { margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button:hover { transform: none; }
}
