﻿:root {
  --bg: #0c0e11;
  --panel: #121418;
  --panel-soft: #121418;
  --line: #2b3038;
  --text: #eef2f6;
  --muted: #a8afb9;
  --accent: linear-gradient(180deg, #232a35 0%, #1a202a 100%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #15181d 0, #060709 78%);
  background-color: #060709;
}

.auth-shell {
  width: min(1060px, 100% - 22px);
  margin: 0 auto;
  padding: 16px 0 24px;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #121418;
  padding: 18px;
}

.auth-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.back-btn {
  text-decoration: none;
  color: #e7edf4;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #373c45;
  border-radius: 999px;
  background: #1a1f26;
  min-height: 36px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.back-btn:hover {
  border-color: #4a525d;
  background: #232a34;
}

.auth-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(240px, 0.75fr);
  gap: 14px;
}

.auth-panel,
.auth-side {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  padding: 16px;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: #9aa5b3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-panel h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 4.8vw, 44px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.mode-switch {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mode-btn {
  border: 1px solid #373c45;
  border-radius: 999px;
  background: #1a1f26;
  min-height: 40px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.mode-btn.is-active {
  border-color: #4a525d;
  background: #232931;
}

.mode-btn:hover {
  border-color: #4a525d;
  background: #232a34;
}

.auth-form {
  margin-top: 12px;
  display: none;
  gap: 10px;
  min-width: 0;
}

.auth-form.is-active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 8px;
  min-width: 0;
}

.auth-form span {
  font-size: 13px;
  font-weight: 700;
  color: #a8afb9;
}

.auth-form input,
.auth-form select {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid #3a4049;
  background: #14181e;
  padding: 10px 12px;
  font: inherit;
  color: #f1f4f8;
  outline: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.auth-form input::placeholder {
  color: #8f9baa;
}

.auth-form select option {
  background: #171d25;
  color: #e6edf5;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-toggle {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid #3b424c;
  background: #1f2630;
  color: #e7edf4;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.password-toggle:hover {
  border-color: #4a525d;
  background: #293240;
}

.password-rules {
  margin-top: 8px;
  border: 1px solid #323a45;
  border-radius: 12px;
  background: #141b24;
  padding: 0 12px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    max-height 240ms ease,
    opacity 200ms ease,
    transform 220ms ease,
    padding 220ms ease;
}

.password-rules.is-open {
  padding: 10px 12px;
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.password-rules p {
  margin: 0;
  color: #9aa8b7;
  font-size: 12px;
  font-weight: 700;
}

.password-rules ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9aa8b7;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease;
}

.password-rules.is-open li {
  opacity: 1;
  transform: translateY(0);
}

.password-rules.is-open li:nth-child(1) {
  transition-delay: 40ms;
}

.password-rules.is-open li:nth-child(2) {
  transition-delay: 70ms;
}

.password-rules.is-open li:nth-child(3) {
  transition-delay: 100ms;
}

.password-rules.is-open li:nth-child(4) {
  transition-delay: 130ms;
}

.password-rules.is-open li:nth-child(5) {
  transition-delay: 160ms;
}

.rule-mark {
  width: 14px;
  height: 14px;
  min-width: 14px;
  border-radius: 50%;
  border: 1px solid #48556a;
  background: #222b37;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
}

.password-rules li.is-met {
  color: #bfe9d2;
}

.password-rules li.is-met .rule-mark {
  border-color: #49b470;
  background: #49b470;
  color: #eaf7f0;
}

.password-rules li.is-met .rule-mark::before {
  content: "✓";
}

.auth-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M2 2l4 4 4-4' fill='none' stroke='%23c9d3df' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px 7px;
  cursor: pointer;
}

.auth-form select::-ms-expand {
  display: none;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #5d6b7e;
  box-shadow: 0 0 0 2px rgba(93, 107, 126, 0.24);
}

.primary-btn {
  border: 0;
  min-height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: #eef3fa;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

.divider {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a8afb9;
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: #313843;
  flex: 1;
}

.x-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid #373c45;
  background: #1a1f26;
  color: #e7edf4;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.x-btn:hover {
  border-color: #4a525d;
  background: #232a34;
}

.x-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.x-btn.is-disabled:hover {
  border-color: #373c45;
  background: #1a1f26;
}

.hint {
  margin: 8px 0 0;
  color: #a8afb9;
  font-size: 12px;
  line-height: 1.3;
}

.hint code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

.message {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.message.error {
  color: #ffc9d6;
}

.message.success {
  color: #bfe9d2;
}

.message.info {
  color: #d3deeb;
}

.auth-side h2 {
  margin: 0;
  font-size: 28px;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.auth-side ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.auth-side li {
  border: 1px solid #313843;
  border-radius: 12px;
  background: #141920;
  padding: 10px;
  color: #cfd8e5;
  font-size: 14px;
}

.preview-link {
  display: inline-flex;
  margin-top: 12px;
  color: #d4e0ee;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 900px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .auth-shell {
    width: calc(100% - 12px);
    padding-top: 6px;
  }

  .auth-card {
    border-radius: 18px;
    padding: 12px;
  }

  .brand {
    font-size: 24px;
  }

  .auth-panel,
  .auth-side {
    padding: 12px;
  }

  .auth-panel h1 {
    font-size: 32px;
  }

  .sub {
    font-size: 14px;
  }

  .phone-row {
    grid-template-columns: 1fr;
  }

  .auth-side h2 {
    font-size: 24px;
  }
}
