:root {
  --bg: #0c0c0e;
  --bg-card: #16161a;
  --bg-elevated: #1f1f25;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #e01f2d;
  --accent-hover: #c2151f;
  --accent-soft: rgba(224, 31, 45, 0.14);
  --yellow: #ffc21f;
  --yellow-hover: #ffb300;
  --yellow-soft: rgba(255, 194, 31, 0.14);
  --border: rgba(255, 255, 255, 0.09);
  --success: #22c55e;
  --error: #ef4444;
  --radius: 14px;
  --radius-sm: 8px;
  --btn-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.28), 0 1px 2px -1px rgba(0, 0, 0, 0.28);
  --btn-shadow-hover: 0 4px 10px -2px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  --font: 'Manrope', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(224, 31, 45, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 18% 12%, rgba(255, 194, 31, 0.1) 0%, transparent 55%),
    var(--bg);
}

body::after {
  content: '';
  position: fixed;
  left: 50%;
  bottom: -2%;
  z-index: -1;
  width: min(1100px, 130vw);
  height: min(480px, 55vh);
  pointer-events: none;
  background: url('../images/car.svg') no-repeat center bottom;
  background-size: contain;
  opacity: 0.16;
  transform: translateX(-50%);
  animation: carBackground 16s ease-in-out infinite;
  will-change: transform;
}

@keyframes carBackground {
  0% {
    transform: translateX(calc(-50% - 12vw)) translateY(0) scale(1);
  }
  25% {
    transform: translateX(calc(-50% - 4vw)) translateY(-18px) scale(1.04);
  }
  50% {
    transform: translateX(calc(-50% + 8vw)) translateY(-8px) scale(1.06);
  }
  75% {
    transform: translateX(calc(-50% + 4vw)) translateY(-22px) scale(1.03);
  }
  100% {
    transform: translateX(calc(-50% - 12vw)) translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
    opacity: 0.12;
  }
}

a {
  color: var(--yellow);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--yellow-hover);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.logo::first-letter {
  color: var(--accent);
}

.logo:hover {
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
}

.nav__auth {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.info-card:hover {
  border-color: rgba(224, 31, 45, 0.35);
  transform: translateY(-2px);
}

.info-card h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.info-card p {
  font-size: 0.9rem;
}

.legal-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}

.legal-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.legal-block h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.legal-block p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover {
  box-shadow: var(--btn-shadow-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: none;
}

.btn--sm {
  padding: 0.375rem 0.8rem;
  font-size: 0.75rem;
}

.btn--telegram {
  background: #229ed9;
  color: #fff;
}

.btn--telegram:hover {
  background: #1c8dc4;
  color: #fff;
}

/* Hero / Card */
.hero {
  padding: 3.5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: center;
}

.hero__label {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--yellow-soft);
  color: var(--yellow);
  border: 1px solid rgba(255, 194, 31, 0.3);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.4vw, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.9rem;
}

.hero h1 span,
.hero .accent {
  color: var(--accent);
}

.hero__text {
  color: var(--text-muted);
  font-size: 0.975rem;
  max-width: 480px;
  margin-bottom: 1.75rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Visit card */
.visit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.85rem;
  box-shadow: var(--shadow);
  position: relative;
}

.visit-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(224, 31, 45, 0.08) 0%, rgba(255, 194, 31, 0.05) 100%);
  pointer-events: none;
}

.visit-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--yellow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.1rem;
}

.visit-card__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.visit-card__role {
  color: var(--yellow);
  font-size: 0.85rem;
  margin-bottom: 1.35rem;
}

.visit-card__contacts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.visit-card__contacts li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.875rem;
}

.visit-card__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.visit-card__contacts a {
  color: var(--text);
  word-break: break-word;
}

.visit-card__contacts a:hover {
  color: var(--yellow);
}

.visit-card__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section--alt {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__head {
  text-align: center;
  margin-bottom: 2.25rem;
}

.section__head h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

.section__head h2::after {
  content: '';
  display: block;
  width: 46px;
  height: 3px;
  margin: 0.7rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--yellow));
}

.section__head p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature:hover {
  border-color: rgba(224, 31, 45, 0.35);
  transform: translateY(-2px);
}

.feature__icon {
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Footer */
.footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.825rem;
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-brand h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.auth-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input:read-only {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.auth-submit {
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: background 0.2s, box-shadow 0.2s;
  margin-top: 0.4rem;
}

.auth-submit:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: var(--btn-shadow-hover);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  display: none;
  padding: 0.7rem 0.9rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.825rem;
  margin-bottom: 1rem;
}

.auth-error.visible {
  display: block;
}

.auth-success {
  display: none;
  padding: 0.7rem 0.9rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  color: #86efac;
  font-size: 0.825rem;
  margin-bottom: 1rem;
}

.auth-success.visible {
  display: block;
}

.auth-footer {
  text-align: center;
  margin-top: 1.35rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.4rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  gap: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-telegram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: #229ed9;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: background 0.2s, box-shadow 0.2s;
}

.auth-telegram::before {
  content: '✈';
  font-size: 1rem;
}

.auth-telegram:hover {
  background: #1c8dc4;
  color: #fff;
  box-shadow: var(--btn-shadow-hover);
}

/* Telegram login overlay */
.tg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.tg-overlay--visible {
  display: flex;
}

.tg-overlay__card {
  width: min(400px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid #229ed9;
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.tg-overlay__spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 1.1rem;
  border: 3px solid var(--border);
  border-top-color: #229ed9;
  border-radius: 50%;
  animation: tg-spin 0.9s linear infinite;
}

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

.tg-overlay__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.tg-overlay__status {
  margin: 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.tg-overlay__steps {
  text-align: left;
  margin: 0 0 1.35rem;
  padding-left: 1.2rem;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.55;
}

.tg-overlay__steps li {
  margin-bottom: 0.3rem;
}

.tg-overlay__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tg-overlay__link {
  color: #229ed9;
  font-size: 0.85rem;
  text-decoration: none;
}

.tg-overlay__link:hover {
  text-decoration: underline;
}

.tg-overlay__cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.tg-overlay__cancel:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Cabinet */
.cabinet {
  min-height: 100vh;
  padding: 2rem 0 4rem;
}

.cabinet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.cabinet__header h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.cabinet__header p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.cabinet__actions {
  display: flex;
  gap: 0.7rem;
}

.cabinet__grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.cabinet__form-card,
.cabinet__preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.85rem;
}

.cabinet__form-card h2,
.cabinet__preview-card h2 {
  font-size: 1.05rem;
  margin-bottom: 1.35rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.cabinet__preview-card .visit-card {
  box-shadow: none;
  padding: 0;
  border: none;
  background: transparent;
}

.cabinet__preview-card .visit-card::after {
  display: none;
}

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

  .features,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .visit-card {
    max-width: 400px;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 4vw;
    gap: 0.75rem;
  }

  .nav.open {
    display: flex;
  }

  .nav__auth {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .header__inner {
    position: relative;
  }

  .hero {
    padding: 2.5rem 0 3rem;
  }

  .cabinet__actions {
    width: 100%;
  }

  .cabinet__actions .btn {
    flex: 1;
  }
}
