:root {
  /* Colors from logo: dark charcoal, white, Chinese red, Korean blue */
  --bg-dark: #444341;
  --bg-card: #444341;
  --bg-card-hover: #4d4d4b;
  --text-primary: #ffffff;
  --text-secondary: #b8b8c0;
  --accent-red: #de2910;
  --accent-blue: #003478;
  --accent-yellow: #ffcc00;
  --border: #555553;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-up {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-left {
  opacity: 0;
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-right {
  opacity: 0;
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-fade-scale {
  opacity: 0;
  animation: fadeInScale 0.5s ease-out forwards;
}

.animate-fade {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }
.anim-delay-6 { animation-delay: 0.6s; }

body {
  font-family: 'Rubik', -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.main-nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.main-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.main-nav-link.active {
  color: var(--accent-yellow);
  background: rgba(255, 204, 0, 0.1);
}

.top-row {
  max-width: 900px;
  margin: 2rem auto 3rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .top-row {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
}

@media (min-width: 641px) {
  .top-row {
    padding: 0 1.5rem;
  }
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  width: 100%;
}

.logo-wrap > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.logo-wrap img.logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.description-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.description {
  width: 100%;
  padding: 2rem 2.25rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 2px solid rgba(255, 204, 0, 0.5);
  border-radius: 20px;
  transform: rotate(-2deg);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.description:hover {
  transform: rotate(-1deg) scale(1.02);
  border-color: rgba(255, 204, 0, 0.7);
}

.description p {
  font-family: 'Rubik', sans-serif;
  font-size: 1.08rem;
  color: #e0e0e8;
  line-height: 1.9;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.description p:first-child {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.2rem;
}

.description p:last-child {
  margin-bottom: 0;
}

.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 0;
  padding: 0.9rem 1.75rem;
  background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 136, 204, 0.35);
}

.telegram-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 136, 204, 0.45);
}

.telegram-wrap {
  text-align: center;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.admin-add-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.admin-add-link:hover {
  color: var(--accent-yellow);
}

.catalog-all-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  background: rgba(0, 52, 120, 0.4);
  border: 2px solid rgba(0, 52, 120, 0.6);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.catalog-all-link:hover {
  background: rgba(0, 52, 120, 0.6);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.catalog-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  background: rgba(0, 52, 120, 0.4);
  border: 2px solid rgba(0, 52, 120, 0.6);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.catalog-add-btn:hover {
  background: rgba(0, 52, 120, 0.6);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.catalog-page {
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}

.catalog-header {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.catalog-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.catalog-back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 1rem;
}

.catalog-back:hover {
  color: var(--text-primary);
}

.catalog-page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.catalog-page-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent-red);
  margin-top: 0.75rem;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(255, 204, 0, 0.5);
  border-radius: 20px;
  padding: 2rem 2.25rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 24px 48px -12px rgba(0, 0, 0, 0.4);
}

.login-wrapper:hover {
  border-color: rgba(255, 204, 0, 0.7);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.login-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent-red);
  margin-top: 0.75rem;
}

.login-message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.login-error {
  background: rgba(222, 41, 16, 0.2);
  border: 1px solid var(--accent-red);
  color: #ff9999;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.login-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
}

.login-field input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.login-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

.login-btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent-red);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.login-btn:hover {
  background: #c9240e;
}

.login-cancel {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

.login-cancel:hover {
  color: var(--text-primary);
}

.telegram-btn svg {
  width: 22px;
  height: 22px;
}

.catalog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

@media (min-width: 600px) {
  .catalog {
    padding: 3rem 1.5rem 4rem;
  }
}

.catalog-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 24px 48px -12px rgba(0, 0, 0, 0.4);
}

@media (min-width: 600px) {
  .catalog-wrapper {
    padding: 2.5rem;
  }
}

.catalog-title {
  font-family: 'Rubik', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: block;
}

.catalog-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent-red);
  margin-top: 0.75rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 480px) {
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (min-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.car-card {
  position: relative;
  background: rgba(68, 67, 65, 0.6);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s;
}

.car-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

.car-image-wrap {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--bg-dark);
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.car-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s, opacity 0.4s ease;
  z-index: 1;
}

.car-image.fade-out {
  opacity: 0;
}

.car-card:hover .car-image:not(.fade-out) {
  transform: scale(1.03);
}

.car-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.car-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  background: var(--accent-red);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 1;
}

.car-body {
  padding: 1rem;
}

@media (min-width: 600px) {
  .car-body {
    padding: 1.25rem;
  }
}

.car-title {
  font-family: 'Rubik', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
  min-height: 2.8em;
}

@media (min-width: 600px) {
  .car-title {
    font-size: 1.2rem;
    min-height: 2.8em;
  }
}

.car-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.car-spec {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(0, 52, 120, 0.25);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 52, 120, 0.4);
}

.car-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.car-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  background: rgba(222, 41, 16, 0.9);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  display: inline-block;
}

@media (min-width: 600px) {
  .car-price {
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
  }
}

.car-gallery {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.car-gallery::-webkit-scrollbar {
  height: 4px;
}

.car-gallery::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 2px;
}

.car-gallery img {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.car-gallery img:hover,
.car-gallery img.active {
  opacity: 1;
}

.reviews {
  padding: 3rem 0 4rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.reviews::before,
.reviews::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 60px;
  pointer-events: none;
  z-index: 1;
}

.reviews::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-dark) 0%, transparent 100%);
}

.reviews::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
}

.reviews-title {
  font-family: 'Rubik', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-align: center;
  padding: 0 1.5rem;
}

.reviews-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent-red);
  margin: 0.75rem auto 0;
}

.reviews-slider {
  overflow: hidden;
  padding: 0 3rem;
  position: relative;
}

.reviews-slider::before,
.reviews-slider::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 1;
}

.reviews-slider::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-dark) 0%, transparent 100%);
}

.reviews-slider::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-dark) 0%, transparent 100%);
}

.reviews-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.review-card {
  flex: 0 0 100%;
  min-width: 0;
  margin-right: 1rem;
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.review-card:last-child {
  margin-right: 0;
}

.reviews-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.reviews-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.reviews-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.reviews-btn svg {
  width: 20px;
  height: 20px;
}

.reviews-dots {
  display: flex;
  gap: 0.5rem;
}

.reviews-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}

.reviews-dot.active {
  background: var(--accent-red);
  transform: scale(1.2);
}

.reviews-dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.review-stars {
  color: var(--accent-yellow);
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.review-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.review-author {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.review-car {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.footer {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
  font-family: 'Rubik', -apple-system, sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.footer-tagline {
  font-family: 'Rubik', -apple-system, sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
