/* ================================
   ДИЗАЙН-СИСТЕМА "ЮЖНОЕ ДОВЕРИЕ"
   РосГарант - Недвижимость Новороссийска
   Философия: светлые тона, море, небо, профессионализм
   ================================ */

/* TOKENS_START */
:root {
  --color-accent-error: #EF4444;
  --color-accent-orange-100: #ffedd5;
  --color-accent-orange-200: #fed7aa;
  --color-accent-orange-300: #fdba74;
  --color-accent-orange-400: #fb923c;
  --color-accent-orange-50: #fff7ed;
  --color-accent-orange-500: #F97316;
  --color-accent-orange-600: #ea580c;
  --color-accent-orange-700: #c2410c;
  --color-accent-orange-800: #9a3412;
  --color-accent-orange-900: #7c2d12;
  --color-accent-purple-100: #f3e8ff;
  --color-accent-purple-200: #e9d5ff;
  --color-accent-purple-300: #d8b4fe;
  --color-accent-purple-400: #c084fc;
  --color-accent-purple-50: #faf5ff;
  --color-accent-purple-500: #8B5CF6;
  --color-accent-purple-600: #7c3aed;
  --color-accent-purple-700: #6d28d9;
  --color-accent-purple-800: #5b21b6;
  --color-accent-purple-900: #4c1d95;
  --color-accent-sea: #06B6D4;
  --color-accent-sun: #FCD34D;
  --color-accent-warning: var(--color-accent-orange-500);
  --color-apartment-available: #10B981;
  --color-apartment-available-dark: #059669;
  --color-apartment-booked: #F59E0B;
  --color-apartment-booked-light: #FCD34D;
  --color-apartment-sold: #6B7280;
  --color-apartment-sold-light: #9CA3AF;
  --color-apartment-special: #8B5CF6;
  --color-apartment-special-dark: #7C3AED;
  --color-bg: #F8F9FA;
  --color-bg-secondary: #F9FAFB;
  --color-black: #000000;
  --color-border: #E5E7EB;
  --color-border-dark: #D1D5DB;
  --color-border-light: #F3F4F6;
  --color-primary: #2563EB;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-50: #eff6ff;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;
  --color-primary-800: #1e40af;
  --color-primary-900: #1e3a8a;
  --color-primary-dark: #1F4E79;
  --color-primary-hover: #1D4ED8;
  --color-primary-light: #60A5FA;
  --color-primary-ultralight: #DBEAFE;
  --color-secondary: #047857;
  --color-secondary-dark: #065F46;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-text: #1F2937;
  --color-text-inverse: #FFFFFF;
  --color-text-light: #9CA3AF;
  --color-text-secondary: #4B5563;
  --color-white: #FFFFFF;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  --font-size-base: 1rem;
  --font-size-body: 1rem;
  --font-size-h1: 3rem;
  --font-size-h2: 2.25rem;
  --font-size-h3: 1.5rem;
  --font-size-h4: 1.25rem;
  --font-size-lg: 1.125rem;
  --font-size-sm: 0.875rem;
  --font-size-xl: 1.25rem;
  --font-size-xs: 0.75rem;
  --font-weight-bold: 700;
  --font-weight-light: 300;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-tight: 1.25;
  --min-touch-target: 44px;
  --min-touch-target-spacing: 8px;
  --mobile-touch-target: 48px;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  --radius-lg: 0.75rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-xl: 1rem;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px 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-primary: 0 10px 25px -5px rgba(59, 130, 246, 0.3);
  --shadow-sm: 0 1px 2px 0 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);
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --spacing-lg: 1.5rem;
  --spacing-md: 1rem;
  --spacing-sm: 0.5rem;
  --spacing-xl: 2rem;
  --spacing-xs: 0.25rem;
  --transition-base: 300ms ease-in-out;
  --transition-fast: 150ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
  --z-dropdown: 1000;
  --z-fixed: 1030;
  --z-modal: 1050;
  --z-modal-backdrop: 1040;
  --z-popover: 1060;
  --z-sticky: 1020;
  --z-tooltip: 1070;
}
/* TOKENS_END */

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* ========== ТИПОГРАФИКА ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

p {
  margin-bottom: var(--spacing-md);
}

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

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

/* ========== УТИЛИТЫ ========== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-3xl) 0;
}

/* Текстовые утилиты */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-center { text-align: center; }

/* Фоновые утилиты */
.bg-primary { background-color: var(--color-primary); }
.bg-white { background-color: var(--color-white); }
.bg-light { background-color: var(--color-bg); }

/* ========== АНИМАЦИИ ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* Классы для анимаций */
.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ========== АДАПТИВНОСТЬ (MOBILE FIRST - 5 BREAKPOINTS) ========== */

/* Base styles (320px+) - Mobile First */
:root {
  /* Typography responsive */
  --section-padding-y: 2rem;          /* 32px */
  --container-padding-x: 1rem;        /* 16px */
}

/* Small devices (phones landscape, 640px and up) */
@media (min-width: 640px) {
  :root {
    --font-size-h1: 2.25rem;          /* 36px */
    --font-size-h2: 1.875rem;         /* 30px */
    --font-size-h3: 1.5rem;           /* 24px */
    --section-padding-y: 3rem;        /* 48px */
    --container-padding-x: 1.5rem;    /* 24px */
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  :root {
    --font-size-h1: 2.5rem;           /* 40px */
    --font-size-h2: 2rem;             /* 32px */
    --font-size-h3: 1.5rem;           /* 24px */
    --section-padding-y: 4rem;        /* 64px */
  }

  .section {
    padding: var(--spacing-3xl) 0;
  }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
  :root {
    --font-size-h1: 3rem;             /* 48px */
    --font-size-h2: 2.25rem;          /* 36px */
    --font-size-h3: 1.5rem;           /* 24px */
    --section-padding-y: 5rem;        /* 80px */
    --container-padding-x: 2rem;      /* 32px */
  }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
  :root {
    --font-size-h1: 3.5rem;           /* 56px */
    --font-size-h2: 2.5rem;           /* 40px */
    --font-size-h3: 1.875rem;         /* 30px */
  }
}

/* Legacy support - max-width queries for backwards compatibility */
@media (max-width: 768px) {
  .section {
    padding: var(--spacing-2xl) 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--container-padding-x);
  }
}

/* ========== ACCESSIBILITY ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible для клавиатурной навигации */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========== КАСТОМНЫЙ СКРОЛЛБАР ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-dark);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ========== SELECTION ========== */
::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ========== HERO GRADIENTS ========== */
/* Предустановленные градиенты для hero секций */

.hero-gradient-blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.hero-gradient-green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.hero-gradient-orange {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.hero-gradient-purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

/* Применение:
- Новостройки, Каталог → hero-gradient-blue
- Вторичка, Продать → hero-gradient-green
- Аренда → hero-gradient-orange
- Коммерция, Инвестиции → hero-gradient-purple
*/

/* Accessibility-oriented utility overrides for sufficient contrast */
.bg-blue-400 { background-color: #1d4ed8 !important; }
.bg-blue-500 { background-color: #2563eb !important; }
.hover\:bg-blue-500:hover { background-color: #1d4ed8 !important; }
.hover\:bg-blue-600:hover { background-color: #1e40af !important; }

.bg-green-500 { background-color: #15803d !important; }
.hover\:bg-green-600:hover { background-color: #166534 !important; }

.bg-orange-500 { background-color: #c2410c !important; }
.bg-cyan-500 { background-color: #0e7490 !important; }
.bg-purple-500 { background-color: #7e22ce !important; }
.bg-indigo-500 { background-color: #4338ca !important; }
.bg-red-500 { background-color: #dc2626 !important; }

.text-blue-500 { color: #1d4ed8 !important; }
.text-red-500 { color: #b91c1c !important; }
