:root {
  --bg: #f4f6f2;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #667064;
  --line: #dfe6dc;
  --brand: #f4b63e;
  --brand-strong: #d99000;
  --green: #256f45;
  --red: #b42318;
  --shadow: 0 24px 70px rgba(27, 36, 30, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(244, 182, 62, 0.18), transparent 34%),
    linear-gradient(180deg, #fbfcf7 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button:disabled,
.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.auth-page {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  align-items: center;
  gap: 56px;
  padding: 40px 0;
}

.brand-panel {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  font-weight: 800;
}

.brand img {
  width: 72px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-copy {
  max-width: 560px;
}

.domain {
  margin: 0 0 14px;
  color: var(--brand-strong);
  font-size: 18px;
  font-weight: 800;
}

h1 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 800;
  text-wrap: balance;
}

.brand-copy p:last-child {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.auth-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(223, 230, 220, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  background: #eef3eb;
  border-radius: 8px;
}

.tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(27, 36, 30, 0.08);
}

.auth-form {
  display: none;
  padding-top: 24px;
}

.auth-form.active {
  display: block;
}

h2 {
  margin: 0 0 18px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
}

label {
  display: block;
  margin: 14px 0;
  color: #334137;
  font-size: 13.5px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(244, 182, 62, 0.18);
}

.captcha-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf5;
}

.captcha-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.captcha-question {
  font-size: 18px;
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 7px;
  background: #1d6b43;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.primary-button:hover {
  background: #185735;
}

.secondary-button {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.secondary-button:hover {
  background: #fbfcfa;
  border-color: #c8d3c4;
}

.resend-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #1d6b43;
  background: #f6fbf7;
  border-color: #bcd9c6;
}

.resend-button:hover {
  background: #eef8f1;
  border-color: #89bf9b;
}

.resend-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #dff2e5;
  color: #1d6b43;
  font-size: 13px;
  font-weight: 800;
}

.button-spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid rgba(29, 107, 67, 0.25);
  border-top-color: #1d6b43;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button .button-spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

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

.hidden {
  display: none;
}

.reset-step {
  display: none;
}

.reset-step.active {
  display: block;
}

.reset-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.code-timer {
  display: none;
  margin: -2px 0 12px;
  padding: 9px 11px;
  border-radius: 7px;
  background: #eef8f1;
  color: #1d6b43;
  font-size: 12.5px;
  font-weight: 800;
  text-align: center;
}

.code-timer.active {
  display: block;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.google-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(27, 36, 30, 0.06);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.google-button:hover {
  border-color: #c8d3c4;
  background: #fbfcfa;
  transform: translateY(-1px);
}

.google-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.google-missing {
  display: none;
  margin: 9px 0 0;
  color: #8a5a00;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.google-not-configured .google-button {
  opacity: 0.55;
  pointer-events: none;
}

.google-not-configured .google-missing {
  display: block;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0;
}

.text-link:hover {
  color: #9a6500;
  text-decoration: underline;
}

.dot-separator {
  color: #a0aa9d;
}

.turnstile-wrap {
  min-height: 70px;
  margin: 16px 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.turnstile-widget {
  min-height: 65px;
}

.turnstile-missing {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f0cf8a;
  border-radius: 7px;
  background: #fff8e8;
  color: #8a5a00;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.turnstile-not-configured .turnstile-missing {
  display: block;
}

.turnstile-not-configured .turnstile-widget {
  display: none;
}

.strength {
  margin: -4px 0 6px;
}

.strength-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece3;
}

#strength-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width 160ms ease, background 160ms ease;
}

#strength-bar[data-score="3"] {
  background: #c47a16;
}

#strength-bar[data-score="4"],
#strength-bar[data-score="5"] {
  background: var(--green);
}

#strength-text {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-message {
  min-height: 22px;
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.ok {
  color: var(--green);
}

.error {
  color: var(--red);
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
    padding: 24px 0;
  }

  .brand-panel {
    min-height: auto;
    gap: 34px;
  }

  .brand-copy p:last-child {
    margin-top: 16px;
  }
}

@media (max-width: 520px) {
  .auth-page {
    width: min(100% - 20px, 1120px);
  }

  .auth-panel {
    padding: 14px;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 32px;
  }
}
