/* === style.css === */
/* Основные стили сайта DreamCar.ua */
/* Обновлено: 2025-01-09 12:00 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: hsl(10, 10%, 4%);
  --text-primary: hsl(0, 0%, 98%);
  --color-primary: #be3333;
  --color-secondary: #d44d4d;
  --color-primary-light: #e06666;
  --color-primary-dark: #a32929;
  --ai-dark: #0a0a0a;
  --ai-gray: #1a1a1a;
  --ai-blue: #be3333;
  --ai-purple: #d44d4d;
  --ai-green: #10b981;
  --card-bg: hsl(10, 10%, 6%);
  --border-color: hsl(10, 10%, 15%);
  --text-muted: hsl(0, 0%, 65%);
  --color-danger: hsl(0, 84.2%, 60.2%);
  --gradient-primary: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  --gradient-card: linear-gradient(135deg, var(--card-bg) 0%, rgba(190, 51, 51, 0.05) 100%);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Фоновое изображение с затемнением */
.hero-section {
  position: relative;
  padding: 4rem 0;
  background-image: url('https://cdn.wdgtsrc.com/f569123ef49c1efefbd1c9f1f877a2c29020588/resize_landing/q7_20_webp/source.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.75), rgba(10, 10, 10, 0.85));
  z-index: 1;
}

.hero-section > * {
  position: relative;
  z-index: 2;
}

/* Контейнер */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Логотип */
.logo {
  max-width: 300px;
  height: 80px;
  object-fit: contain;
  margin: 2rem 0;
}

/* Заголовки */
h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }
  h2 {
    font-size: 2.25rem;
  }
  h3 {
    font-size: 1.875rem;
  }
}

/* Текстовый градиент */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Секции */
.section {
  padding: 4rem 0;
}

@media (min-width: 1024px) {
  .section {
    padding: 6rem 0;
  }
}

/* Карточки тарифов */
.tariffs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 3rem 0;
}

@media (min-width: 768px) {
  .tariffs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tariffs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tariff-card {
  background: var(--gradient-card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tariff-card:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(190, 51, 51, 0.2);
  border-color: var(--color-primary);
}

.tariff-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.tariff-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--gradient-primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.tariff-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tariff-subtitle {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.tariff-price {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.tariff-features {
  list-style: none;
  margin-bottom: 2rem;
}

.tariff-features li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tariff-features li:before {
  content: '✓';
  color: var(--ai-green);
  font-weight: 700;
  font-size: 1.25rem;
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  min-height: 60px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  background: var(--gradient-primary);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(190, 51, 51, 0.3);
}

.btn:active {
  transform: translateY(0);
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  border: 1px solid var(--border-color);
  position: relative;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.modal-close:hover {
  background: var(--border-color);
}

/* Форма */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--ai-gray);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(190, 51, 51, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Текст */
.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Уведомления */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

.notification.success {
  border-left: 4px solid var(--ai-green);
}

.notification.error {
  border-left: 4px solid var(--color-danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Загрузчик */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--ai-blue);
  animation: spin 0.8s linear infinite;
}

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

/* Ссылки */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

/* Дополнительные утилиты */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Адаптивность для мобильных */
@media (max-width: 767px) {
  .logo {
    max-width: 250px;
    height: 60px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .tariff-card {
    padding: 1.5rem;
  }

  .tariff-image {
    height: 250px;
  }

  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  /* backdrop-filter для браузеров которые поддерживают */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  /* Fallback для старых браузеров и Telegram WebView */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  animation: fadeIn 0.3s ease-in-out;
  overflow: hidden;
  padding: 1rem;
  box-sizing: border-box;
  /* Дополнительные стили для совместимости */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: opacity;
}

.loading-overlay.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999999 !important;
}

/* Принудительное отображение для всех браузеров */
.loading-overlay.active,
.loading-overlay[style*="display: flex"],
.loading-overlay[style*="display:flex"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Fallback для браузеров без поддержки backdrop-filter */
@supports not (backdrop-filter: blur(5px)) {
  .loading-overlay {
    background: rgba(0, 0, 0, 0.9);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-content {
  text-align: center;
  color: white;
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(220, 38, 38, 0.2);
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: spinLoader 1s linear infinite;
  box-sizing: border-box;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.loading-spinner::after {
  content: '💳';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  animation: pulseLoader 1.5s ease-in-out infinite;
  z-index: 2;
  line-height: 1;
}

@keyframes pulseLoader {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.8;
  }
}

.loading-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.4;
  word-wrap: break-word;
}

.loading-text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.loading-dots {
  display: inline-block;
  width: 20px;
  text-align: left;
}

.loading-dots::after {
  content: '...';
  animation: dotsLoader 1.5s steps(4, end) infinite;
}

@keyframes dotsLoader {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

@media (max-width: 640px) {
  .loading-overlay {
    padding: 1rem 0.5rem;
  }
  
  .loading-content {
    padding: 1.5rem 1rem;
    max-width: 100%;
  }
  
  .loading-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }
  
  .loading-text {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }
  
  .loading-spinner {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
  }
  
  .loading-spinner::after {
    font-size: 1.5rem;
  }
}

@media (max-width: 360px) {
  .loading-content {
    padding: 1rem 0.75rem;
  }
  
  .loading-title {
    font-size: 1.125rem;
  }
  
  .loading-text {
    font-size: 0.8125rem;
  }
  
  .loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
  }
}

@supports (-webkit-touch-callout: none) {
  .loading-overlay {
    position: -webkit-sticky;
    position: sticky;
    min-height: -webkit-fill-available;
  }
}
