/* Shared fonts — pages may drop duplicate <link> after cache settle */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap');

/* ============================================================
   Design Tokens — личный кабинет клиента CRMBeautyGo
   Все цвета зависят от темы салона (salon_id).
   ============================================================ */

:root {
  /* --- Брендинг салона (перезаписывается через theme-preload.js) --- */
  --primary: #2F6F68;
  --primary-light: #4A8C84;
  --primary-dark: #1F4F4A;
  --primary-contrast: #FFFFFF;
  --primary-soft: rgba(47, 111, 104, 0.08);
  --primary-soft-hover: rgba(47, 111, 104, 0.14);

  --accent: #C9A961;
  --accent-soft: rgba(201, 169, 97, 0.12);

  /* --- Семантика --- */
  --success: #2E9E5B;
  --success-soft: rgba(46, 158, 91, 0.12);
  --warning: #E0A500;
  --warning-soft: rgba(224, 165, 0, 0.12);
  --danger: #D64545;
  --danger-soft: rgba(214, 69, 69, 0.12);
  --info: #3B82F6;
  --info-soft: rgba(59, 130, 246, 0.12);

  /* --- Поверхности (как CRM theme-variables) --- */
  --bg: #FFF9F5;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-subtle: #F5F0EB;
  --bg-hover: #F0EBE5;
  --bg-overlay: rgba(20, 20, 20, 0.5);

  /* --- Текст --- */
  --text: #2A2421;
  --text-primary: var(--text);
  --text-secondary: #7A716A;
  --text-muted: #9A918A;
  --text-inverse: #FFFFFF;
  --text-link: var(--primary);

  /* --- Границы --- */
  --border: #E8E0D8;
  --border-color: var(--border);
  --border-strong: #C8C0B4;
  --border-focus: var(--primary);

  /* --- Алиасы под компоненты --- */
  --bg-soft: var(--bg-subtle);
  --bg-secondary: var(--bg-subtle);

  /* --- Радиусы --- */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Тени --- */
  --shadow-xs: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 2px 4px rgba(20, 20, 20, 0.06);
  --shadow-md: 0 4px 12px rgba(20, 20, 20, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 20, 20, 0.12);
  --shadow-focus: 0 0 0 3px var(--primary-soft);

  /* --- Spacing (8-pt grid) --- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* --- Типографика (Inter + Space Grotesk) --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-base: 1.5;
  --lh-relaxed: 1.7;

  /* --- Анимации --- */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-index --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-drawer: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* --- Layout --- */
  --header-h: 60px;
  --bottom-nav-h: 68px;
  --sidebar-w: 260px;
  --content-max: 1150px;
  --shell-max: 1150px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Base reset --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* Тонкий скроллбар в стиле кабинета */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

h1, h2, h3, .page-head__title, .hero-greeting__title, .section__title, .auth-card__title {
  font-family: var(--font-heading);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--text);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover { color: var(--primary-dark); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}
