:root {
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(148, 163, 184, 0.24);
  --primary: #0f172a;
  --primary-strong: #020617;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 16px 45px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at left, rgba(15, 23, 42, 0.06), transparent 22%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-shell {
  width: min(100%, 1120px);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-weight: 800;
  transition: 0.2s ease;
}

.back-link:hover,
.back-link:focus-visible {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(100, 116, 139, 0.4);
}

.auth-card {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 30px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-copy strong {
  font-family: "Manrope", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.auth-intro {
  margin-top: 28px;
  max-width: 830px;
}

.auth-intro h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.45rem, 4.4vw, 4.45rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 800;
}

.auth-intro p {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.04rem;
}

.consent-box {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  padding: 20px;
}

.check-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
}

.check-row + .check-row {
  margin-top: 14px;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--primary);
}

.check-row span {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.97rem;
}

.check-row a {
  color: var(--accent);
  font-weight: 800;
}

.check-row a:hover {
  text-decoration: underline;
}

.consent-note {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.92rem;
}

.gate-message {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(217, 119, 6, 0.22);
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning);
  font-weight: 800;
}

.gate-message.show {
  display: block;
}

.tab-row {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tab-btn {
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-weight: 800;
  transition: 0.2s ease;
}

.tab-btn:hover,
.tab-btn:focus-visible {
  transform: translateY(-1px);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.auth-panel {
  display: none;
  margin-top: 24px;
}

.auth-panel.active {
  display: block;
}

.panel-head h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.panel-head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.field-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 0.92rem;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
  transition: 0.2s ease;
}

.field input::placeholder {
  color: #94a3b8;
}

.field input:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  margin-top: 16px;
  font-weight: 800;
  transition: 0.2s ease;
}

.primary-btn {
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-strong);
}

.secondary-btn {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.secondary-btn:hover:not(:disabled) {
  border-color: rgba(100, 116, 139, 0.4);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-message {
  min-height: 24px;
  margin-top: 18px;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.45;
}

.auth-message.success {
  color: var(--success);
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.warn {
  color: var(--warning);
}

.auth-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 26px;
}

.footer-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 18px;
}

.footer-card strong {
  display: block;
  font-family: "Manrope", sans-serif;
  margin-bottom: 8px;
  font-weight: 800;
}

.footer-card span {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.footer-card.premium {
  background: var(--primary);
  border-color: var(--primary);
}

.footer-card.premium strong,
.footer-card.premium span {
  color: #fff;
}

@media (max-width: 820px) {
  .auth-top,
  .auth-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-top {
    gap: 16px;
  }

  .status-pill {
    width: fit-content;
  }

  .auth-intro h1 {
    font-size: clamp(2.25rem, 8vw, 3.5rem);
  }
}

@media (max-width: 560px) {
  .auth-page {
    padding: 18px 12px;
  }

  .auth-card {
    padding: 22px 16px;
    border-radius: 22px;
  }

  .tab-row,
  .auth-footer {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .brand-copy small {
    display: none;
  }

  .auth-intro h1 {
    font-size: clamp(2rem, 10vw, 2.9rem);
    letter-spacing: -0.045em;
  }

  .auth-intro p,
  .check-row span {
    font-size: 0.95rem;
  }
}