/* USTO.impro - Main Stylesheet */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1e293b;
  --light: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

@media (max-width: 640px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

p {
  margin-bottom: 1rem;
  color: var(--gray-600);
}

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

a:hover {
  color: var(--primary-dark);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

.btn-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-label-required::after {
  content: " *";
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: white;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
  color: var(--gray-400);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em;
  padding-right: 2.5rem;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--danger);
}

.form-hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  backdrop-filter: blur(10px);
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
}

.navbar-brand span {
  color: var(--primary);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.navbar-nav a {
  color: var(--gray-600);
  font-weight: 500;
  transition: color 0.2s;
}

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

.navbar-phone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
}

@media (max-width: 768px) {
  .navbar-nav {
    display: none;
  }
}

/* Hero Section */
.hero {
  padding: 8rem 0 4rem;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: white;
  line-height: 1.1;
}

.hero p {
  font-size: 1.25rem;
  color: var(--gray-300);
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

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

.hero-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--gray-400);
}

@media (max-width: 640px) {
  .hero {
    padding: 6rem 0 3rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Section */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--gray-500);
  font-size: 1.125rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border: 2px solid transparent;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.service-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.service-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* How It Works */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 2rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -1rem;
  left: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.step-title {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Order Form Wizard */
.wizard {
  max-width: 600px;
  margin: 0 auto;
}

.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.wizard-step {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--gray-500);
  transition: all 0.3s;
}

.wizard-step.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.wizard-step.completed {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.wizard-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.wizard-step-content {
  display: none;
}

.wizard-step-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

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

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

/* System Type Selection */
.system-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.system-type {
  position: relative;
  padding: 1.5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
}

.system-type:hover {
  border-color: var(--primary);
}

.system-type.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.system-type input {
  position: absolute;
  opacity: 0;
}

.system-type-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.system-type-label {
  font-weight: 600;
  color: var(--gray-800);
}

/* Phone Input */
.phone-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.phone-prefix {
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

/* SMS Code Input */
.code-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.code-input {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.code-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Order Status Cards */
.status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  border-left: 4px solid var(--gray-300);
}

.status-card.pending { border-left-color: var(--warning); }
.status-card.assigned { border-left-color: var(--primary); }
.status-card.in_progress { border-left-color: var(--primary); }
.status-card.completed { border-left-color: var(--success); }

.status-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.status-card.pending .status-icon { background: #fef3c7; }
.status-card.assigned .status-icon { background: var(--primary-light); }
.status-card.in_progress .status-icon { background: var(--primary-light); }
.status-card.completed .status-icon { background: #d1fae5; }

.status-info h4 {
  margin-bottom: 0.25rem;
}

.status-meta {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Footer */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-title {
  color: white;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--gray-400);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--gray-800);
  text-align: center;
  color: var(--gray-500);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s;
  max-width: 400px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }

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

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-gray { color: var(--gray-500); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Offline Banner */
.offline-banner {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--warning);
  color: white;
  text-align: center;
  padding: 0.5rem;
  z-index: 999;
  display: none;
}

.offline-banner.show {
  display: block;
}

/* Responsive */
@media (max-width: 640px) {
  .wizard-actions {
    flex-direction: column-reverse;
    gap: 1rem;
  }
  
  .wizard-actions .btn {
    width: 100%;
  }
  
  .phone-input-wrapper {
    flex-direction: column;
  }
  
  .code-inputs {
    gap: 0.25rem;
  }
  
  .code-input {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}

/* Стили для фото-отчётов - ИСПРАВЛЕНИЕ: добавлено 2026-03-23 */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.photo-item {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid var(--gray-200);
}

.photo-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: var(--primary);
}

.photo-item img {
  display: block;
  transition: transform 0.3s;
}

.photo-item:hover img {
  transform: scale(1.05);
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .photo-item img {
    height: 120px !important;
  }
}
/* Mobile Navigation Fixes - добавлено 2026-03-26 */
@media (max-width: 768px) {
  /* Показываем кнопку меню на мобильных */
  #mobile-menu-btn {
    display: flex !important;
  }
  
  /* Скрываем десктопное меню */
  #desktop-nav {
    display: none !important;
  }
  
  /* Стили для мобильного меню когда оно открыто */
  #mobile-nav:not(.hidden) {
    display: block !important;
    animation: slideDown 0.2s ease-out;
  }
  
  /* Анимация открытия */
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Стили ссылок в мобильном меню */
  #mobile-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
  }
  
  #mobile-nav a:hover {
    background: var(--gray-100);
    color: var(--primary);
  }
  
  /* Особый стиль для кнопки Кабинет */
  #mobile-nav a[href="/lk/orders"] {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
  }
  
  /* Стиль для телефона */
  #mobile-nav a[href^="tel:"] {
    color: var(--success);
    font-weight: 600;
  }
}

/* На десктопе скрываем мобильную кнопку */
@media (min-width: 769px) {
  #mobile-menu-btn {
    display: none !important;
  }
}
