/**
 * PROFI CLINIC - Mobile Design System
 * Современный дизайн в стиле iOS/Android приложений
 * Цветовая схема: белый, синий, зеленый
 */

:root {
  /* Основные цвета */
  --white: #ffffff;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;
  
  /* Нейтральные */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Градиенты */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-success: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --gradient-hero: linear-gradient(135deg, #3b82f6 0%, #22c55e 100%);
  --gradient-subtle: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  
  /* Тени */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-blue: 0 10px 40px -10px rgba(37, 99, 235, 0.3);
  --shadow-green: 0 10px 40px -10px rgba(34, 197, 94, 0.3);
  
  /* Радиусы */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Анимации */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Roboto', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Header в стиле iOS */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.4px;
}

.header-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Карточки в стиле iOS */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.card-press:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  width: 100%;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.3px;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s;
}

.btn:active::after {
  background: rgba(255, 255, 255, 0.2);
}

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

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

.btn-success {
  background: var(--gradient-success);
  color: var(--white);
  box-shadow: var(--shadow-green);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-900);
}

.btn-ghost {
  background: transparent;
  color: var(--blue-600);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Поля ввода */
.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.input {
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--gray-900);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s var(--ease-smooth);
  -webkit-appearance: none;
}

.input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

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

/* Списки в стиле iOS */
.list {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 16px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
  cursor: pointer;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:active {
  background: var(--gray-50);
}

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item-icon.blue {
  background: var(--blue-100);
  color: var(--blue-600);
}

.list-item-icon.green {
  background: var(--green-100);
  color: var(--green-600);
}

.list-item-icon svg {
  width: 20px;
  height: 20px;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtitle {
  font-size: 13px;
  color: var(--gray-500);
}

.list-item-arrow {
  color: var(--gray-400);
  flex-shrink: 0;
}

/* Бейджи */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.badge-blue {
  background: var(--blue-100);
  color: var(--blue-700);
}

.badge-green {
  background: var(--green-100);
  color: var(--green-700);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: -0.2px;
}

.nav-item.active {
  color: var(--blue-600);
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

/* Аватары */
.avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.avatar-blue {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-blue);
}

.avatar-green {
  background: var(--gradient-success);
  box-shadow: var(--shadow-green);
}

/* Пустые состояния */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 40px;
  height: 40px;
  color: var(--gray-400);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 15px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Skeleton загрузка */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

/* Toast уведомления */
.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--gray-900);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  transform: translateY(120%);
  transition: transform 0.3s var(--ease-spring);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.show {
  transform: translateY(0);
}

.toast-success {
  background: var(--green-600);
}

.toast-error {
  background: #ef4444;
}

/* Модальные окна */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s var(--ease-out);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  margin: 0 auto 20px;
}

/* Индикаторы шагов */
.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--gray-100);
  color: var(--gray-500);
  transition: all 0.3s var(--ease-smooth);
}

.step.active .step-num {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}

.step.completed .step-num {
  background: var(--gradient-success);
  color: var(--white);
}

.step-label {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
}

.step.active .step-label {
  color: var(--blue-600);
  font-weight: 600;
}

/* Временные слоты */
.time-slot {
  display: inline-block;
  padding: 14px 20px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  transition: all 0.2s var(--ease-smooth);
  cursor: pointer;
}

.time-slot:active {
  transform: scale(0.95);
}

.time-slot.selected {
  background: var(--blue-50);
  border-color: var(--blue-500);
  color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Утилиты */
.text-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.safe-top {
  padding-top: max(0px, env(safe-area-inset-top));
}

.safe-bottom {
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

/* Секции */
.section {
  padding: 20px 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-desc {
  font-size: 15px;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Hero секции */
.hero {
  background: var(--gradient-hero);
  padding: 32px 20px;
  margin: 16px;
  border-radius: var(--radius-2xl);
  color: var(--white);
  box-shadow: var(--shadow-blue);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 15px;
  opacity: 0.9;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* Статистика */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

/* Поиск */
.search-box {
  position: relative;
  margin: 16px;
}

.search-box input {
  padding-left: 44px;
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  pointer-events: none;
}

/* Анимации появления */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s var(--ease-out);
}

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

.animate-scale-in {
  animation: scaleIn 0.4s var(--ease-spring);
}

/* Пульсация */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Спиннер загрузки */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* Разделители */
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 16px 0;
}

/* Инфо блоки */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 14px;
  color: var(--gray-500);
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

/* Floating кнопка */
.fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-blue);
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  z-index: 90;
}

.fab:active {
  transform: scale(0.95);
}

.fab svg {
  width: 24px;
  height: 24px;
}
