:root {
  --gate-bg: #eef2f7;
  --gate-card: #ffffff;
  --gate-text: #0f172a;
  --gate-muted: #64748b;
  --gate-primary: #4f46e5;
  --gate-primary-hover: #4338ca;
  --gate-border: #e2e8f0;
  --gate-input-bg: #eef4fb;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--gate-text);
}

* { box-sizing: border-box; }
body.gate-page { margin: 0; min-height: 100vh; background: var(--gate-bg); }

.gate-split {
  display: flex;
  min-height: 100vh;
}

.gate-hero {
  flex: 1.15;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 48px 56px;
  color: #fff;
  background: linear-gradient(145deg, #060d18 0%, #0c1f3d 35%, #12325c 70%, #0f2847 100%);
}

.gate-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 10% 90%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 15%, rgba(129, 140, 248, 0.25), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(59, 130, 246, 0.08), transparent 60%);
}

.gate-hero-bg::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(
    -12deg,
    transparent,
    transparent 48px,
    rgba(148, 163, 184, 0.04) 48px,
    rgba(148, 163, 184, 0.04) 49px
  );
  transform: skewY(-6deg);
}

.gate-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.gate-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 40px;
}

.gate-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.gate-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.gate-lead {
  margin: 0 0 28px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(226, 232, 240, 0.92);
}

.gate-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gate-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: rgba(203, 213, 225, 0.95);
  line-height: 1.45;
}

.gate-bullets li::before {
  content: "✓";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.gate-panel {
  flex: 0.85;
  min-width: 0;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 40px 32px;
  background: var(--gate-bg);
}

.gate-panel-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--gate-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.lang-switch button {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 0;
  background: #fff;
  color: var(--gate-muted);
  cursor: pointer;
}

.lang-switch button.active {
  background: #eef2ff;
  color: var(--gate-primary);
}

.auth-card {
  background: var(--gate-card);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.auth-card-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gate-primary);
}

.auth-card-sub {
  margin: 0 0 22px;
  font-size: 0.88rem;
  color: var(--gate-muted);
  line-height: 1.45;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 6px;
}

.field-label:not(:first-child) { margin-top: 14px; }

.input-icon-wrap { position: relative; }

.input-icon-wrap .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.input-icon-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--gate-input-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-icon-wrap input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: #fff;
}

.input-icon-wrap.has-password-toggle input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.password-toggle:hover {
  color: #64748b;
  background: rgba(15, 23, 42, 0.04);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--gate-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.field-hint.error { color: #b91c1c; }

.code-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.legal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 18px;
  font-size: 0.82rem;
  color: var(--gate-muted);
  line-height: 1.45;
}

.legal-row input { margin-top: 3px; flex-shrink: 0; }
.legal-row a { color: var(--gate-primary); text-decoration: none; }
.legal-row a:hover { text-decoration: underline; }

.btn-primary-gate {
  width: 100%;
  padding: 13px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--gate-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}

.btn-primary-gate:hover { background: var(--gate-primary-hover); }
.btn-primary-gate:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gate-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gate-border);
}

.oauth-row { display: flex; gap: 10px; }

.btn-oauth {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid var(--gate-border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-oauth:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-oauth:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-oauth svg { flex-shrink: 0; }

.auth-switch {
  margin-top: 22px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--gate-muted);
}

.auth-switch button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gate-primary);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
}

.auth-switch button:hover { text-decoration: underline; }

.auth-extra-links {
  margin-top: 12px;
  text-align: center;
  font-size: 0.8rem;
}

.auth-extra-links button {
  background: none;
  border: 0;
  color: var(--gate-muted);
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
}

.gate-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--gate-muted);
}

.gate-footer a { color: var(--gate-primary); text-decoration: none; }
.gate-footer a:hover { text-decoration: underline; }

.hidden-block { display: none !important; }

.forgot-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--gate-primary);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 960px) {
  .gate-split { flex-direction: column; }
  .gate-hero {
    flex: none;
    min-height: auto;
    padding: 36px 28px 40px;
  }
  .gate-panel {
    max-width: none;
    padding: 24px 20px 32px;
  }
  .gate-hero-inner { max-width: none; }
  .gate-logo { margin-bottom: 24px; }
}
