/* ============================================
   GODauto Queue v2 — Премиум дизайн
   Цветовая схема: глубокий зелёный + золотой акцент
   ============================================ */

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

:root {
  /* Основная палитра — глубокий премиум */
  --green-900: #1a3a1a;
  --green-800: #1f4a2a;
  --green-700: #256535;
  --green-600: #2e7d32;
  --green-500: #3a8a4a;
  --green-400: #4a9a5a;
  --green-300: #6aaa6a;
  --green-200: #a8d5a2;
  --green-100: #e0f2e0;
  --green-50: #f2f8f2;

  /* Золотой акцент для премиальности */
  --gold-600: #c8a84e;
  --gold-500: #d4b85a;
  --gold-400: #e0c86a;
  --gold-200: #f0e4b0;
  --gold-100: #faf3d8;
  --gold-50: #fefcf4;

  /* Нейтральные */
  --bg: #f5f8f5;
  --bg-card: #ffffff;
  --white: #ffffff;
  --text-primary: #1a2a1a;
  --text-secondary: #4a6a4a;
  --text-muted: #7a9a7a;
  --text-link: #3a7a4a;

  /* Тени — слоистые для глубины */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 12px 48px rgba(0,0,0,0.1);
  --shadow-glow: 0 4px 24px rgba(46,125,50,0.15);

  /* Скругления */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Шрифт */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;

  /* Анимации */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  position: relative;
}

/* ============================================
   Логотип — премиум
   ============================================ */
.logo {
  text-align: center;
  padding: 28px 20px 12px;
}

.logo svg {
  height: 30px;
  width: auto;
}

/* ============================================
   Навигация
   ============================================ */
.nav-bar {
  display: flex;
  align-items: center;
  padding: 16px 20px 8px;
  gap: 8px;
}

.nav-back {
  background: none;
  border: none;
  color: var(--text-link);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}

.nav-back:hover {
  background: var(--green-50);
}

.nav-back svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-link);
  stroke-width: 2.5;
  fill: none;
}

/* ============================================
   Экран 1 – Вход (премиум)
   ============================================ */
.screen-auth {
  padding: 20px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

.screen-auth .greeting {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  text-align: center;
  letter-spacing: -0.03em;
}

.screen-auth .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  text-align: center;
  line-height: 1.5;
}

.screen-auth .greeting::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  border-radius: 2px;
  margin: 12px auto 0;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid #e4ebe4;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font);
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  letter-spacing: 0;
}

.form-input:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 4px rgba(74,154,90,0.12);
}

.form-input::placeholder {
  color: #bcc8bc;
}

.form-input:hover {
  border-color: #c0d0c0;
}

.btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-500) 0%, var(--green-600) 100%);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(46,125,50,0.25);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(46,125,50,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-link);
  border: 2px solid #c8dcc8;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--green-400);
  background: var(--green-50);
  transform: translateY(-1px);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-link);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 4px;
  font-family: var(--font);
  transition: color var(--transition-fast);
}

.btn-text:hover {
  color: var(--green-600);
}

.address {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: 20px;
  letter-spacing: 0.02em;
}

/* ============================================
   Экран 1А – С возвращением
   ============================================ */
.screen-return {
  padding: 20px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

.screen-return .greeting {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.screen-return .phone-display {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 36px;
  font-weight: 500;
  background: var(--green-100);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   Экран 1Б – SMS-код
   ============================================ */
.screen-sms {
  padding: 8px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

.screen-sms .title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
}

.code-inputs {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 20px;
}

.code-input {
  width: 60px;
  height: 72px;
  border: 2px solid #e4ebe4;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition-fast);
  background: var(--white);
  color: var(--text-primary);
}

.code-input:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 4px rgba(74,154,90,0.12);
  transform: translateY(-2px);
}

.code-input:not(:placeholder-shown) {
  border-color: var(--green-300);
  background: var(--green-50);
}

.phone-sent {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.resend {
  text-align: center;
  margin-top: 12px;
}

.resend .btn-text {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.resend .btn-text:hover {
  color: var(--text-link);
}

/* ============================================
   Экран 2 – Главная (премиум)
   ============================================ */
.screen-home {
  padding: 8px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

/* Шапка с логотипом и кнопкой выхода */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-logout {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: #ccc;
  color: #666;
  background: #f5f5f5;
}

.btn-logout:active {
  background: #eee;
}

.screen-home .greeting {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

/* Карточка статуса — премиум */
.status-card {
  background: var(--bg-card);
  border: 1px solid #e4ebe4;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-400), var(--green-600), var(--gold-500));
}

.status-card:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.status-card .queue-number {
  font-size: 72px;
  font-weight: 900;
  color: var(--green-600);
  line-height: 1;
  margin-bottom: 6px;
  animation: bounce 0.6s ease-out;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status-card .queue-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 500;
}

.status-card .car-info {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.status-card .problem-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.status-card .eta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--green-100), #e8f5e9);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--green-700);
  transition: all var(--transition-fast);
  border: 1px solid var(--green-200);
}

.status-card .eta:hover {
  background: var(--green-100);
  border-color: var(--green-300);
}

.status-card .eta strong {
  font-weight: 700;
  color: var(--green-700);
}

/* Кнопки на главной — премиум */
.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.home-actions .btn {
  padding: 16px;
  font-size: 15px;
  border-radius: var(--radius-sm);
}

/* Ссылка помощи — кликабельная, премиум */
.help-link {
  text-align: center;
  margin-top: 24px;
  padding-bottom: 20px;
}

.help-link a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.help-link a:hover {
  color: var(--green-600);
  background: var(--green-50);
  border-color: var(--green-200);
}

.help-link a strong {
  color: var(--green-500);
  font-weight: 600;
}

.help-link a:hover strong {
  color: var(--green-600);
}

/* Пустой экран */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state .icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.empty-state .text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ============================================
   Экран 3 – Форма машины (премиум)
   ============================================ */
.screen-car-form {
  padding: 8px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

.screen-car-form .form-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.screen-car-form .form-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  border-radius: 2px;
  margin-top: 8px;
}

.screen-car-form .form-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.screen-car-form textarea.form-input {
  min-height: 110px;
  resize: vertical;
}

.form-submit {
  margin-top: auto;
  padding-top: 24px;
}

/* ============================================
   Экран 4 – Подтверждение (премиум)
   ============================================ */
.screen-confirm {
  padding: 8px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

.check-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--green-400) 0%, var(--green-600) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto 20px;
  box-shadow: 0 6px 24px rgba(46,125,50,0.25);
  animation: pulse 2s ease-in-out infinite;
}

.check-circle svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--white);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screen-confirm .confirm-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.screen-confirm .confirm-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.price-card {
  background: linear-gradient(135deg, var(--gold-50) 0%, var(--gold-100) 100%);
  border: 1px solid var(--gold-200);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.price-card .price-label {
  font-size: 13px;
  color: var(--gold-600);
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.price-card .price-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--green-800);
  letter-spacing: -0.02em;
}

.price-card .price-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.notif-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--green-50) 100%);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}

.notif-card .notif-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.notif-card .notif-title .bell svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--green-500);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notif-card ul {
  list-style: none;
  padding: 0;
}

.notif-card li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-card li::before {
  content: "✓";
  color: var(--green-400);
  font-weight: 700;
  font-size: 14px;
}

/* ============================================
   Экран 5 – История
   ============================================ */
.screen-history {
  padding: 8px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

.screen-history .hist-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.history-list {
  flex: 1;
  overflow-y: auto;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid #e8eee8;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  animation: slideInRight 0.3s ease-out;
  animation-fill-mode: both;
}

.history-card:nth-child(1) { animation-delay: 0.05s; }
.history-card:nth-child(2) { animation-delay: 0.1s; }
.history-card:nth-child(3) { animation-delay: 0.15s; }
.history-card:nth-child(4) { animation-delay: 0.2s; }
.history-card:nth-child(5) { animation-delay: 0.25s; }
.history-card:nth-child(6) { animation-delay: 0.3s; }
.history-card:nth-child(7) { animation-delay: 0.35s; }
.history-card:nth-child(8) { animation-delay: 0.4s; }

.history-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.history-card .hist-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.history-card .hist-car {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.history-card .hist-service {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.history-card .hist-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-600);
}

.history-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================
   Анимации — премиум
   ============================================ */
.screen-enter {
  animation: fadeInUp 0.4s ease-out;
}

.screen-enter-fast {
  animation: fadeInUp 0.2s ease-out;
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-10px); }
  40% { transform: translateY(0); }
  60% { transform: translateY(-5px); }
  80% { transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Утилиты
   ============================================ */
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.pb-16 { padding-bottom: 16px; }

/* Скрытие скроллбара */
::-webkit-scrollbar { width: 0; height: 0; }

/* ============================================
   Адаптив
   ============================================ */
@media (min-width: 481px) {
  #app {
    border-radius: var(--radius-xl);
    min-height: 90vh;
    margin: 5vh auto;
    box-shadow: var(--shadow-xl);
  }
}
