/* ============================================================
   MOBILE-APP.CSS — про.лаз Mobile-First Design System
   Soft Structuralism aesthetic, PWA-ready
   ============================================================ */

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

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand Colors */
  --c-primary: #FF7700;
  --c-primary-light: rgba(255,119,0,.12);
  --c-secondary: #1D3557;
  --c-secondary-light: #4A90E2;
  --c-accent: #5757f8;
  --c-accent-light: rgba(87,87,248,.1);

  /* Brand Legacy Aliases */
  --brand-primary: var(--c-primary);
  --brand-primary-dark: #e06900;
  --brand-secondary: var(--c-secondary);
  --brand-success: var(--c-success);
  --brand-warning: var(--c-warning);

  /* Semantic */
  --c-success: #06D6A0;
  --c-warning: #FFD166;
  --c-danger: #FF4757;
  --c-info: #4A90E2;

  /* Surfaces */
  --c-bg: #F4F5F8;
  --c-surface: #FFFFFF;
  --c-surface-2: #F8F9FB;
  --c-border: rgba(0,0,0,.07);

  /* Text */
  --c-text: #1A1D23;
  --c-text-secondary: #6B7280;
  --c-text-muted: #9CA3AF;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-md: 17px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 28px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Shadows — Soft Structuralism */
  --shadow-xs: 0 2px 8px rgba(0,0,0,.04);
  --shadow-sm: 0 8px 20px rgba(0,0,0,.05);
  --shadow-md: 0 12px 32px rgba(0,0,0,.06);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.12);
  --shadow-primary: 0 8px 24px rgba(255,119,0,.30);
  --shadow-accent: 0 8px 24px rgba(87,87,248,.25);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 250ms ease;
  --t-slow: 400ms cubic-bezier(.175,.885,.32,1.1);
  --t-spring: 500ms cubic-bezier(.34,1.56,.64,1);

  /* Safe Areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* App Shell */
  --app-bar-height: 60px;
  --tab-bar-height: 64px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100vw;
  overscroll-behavior-y: none;
}

body {
  font-family: var(--font);
  font-size: var(--font-size-base);
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea, select {
  -webkit-user-select: auto;
  user-select: auto;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
img { display: block; max-width: 100%; }

/* ============================================================
   3. APP SHELL LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  background: var(--c-bg);
  overflow: hidden;
}

#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
  /* Add padding bottom for the bottom tab bar */
  padding-bottom: 80px; 
}

/* ============================================================
   4. APP BAR
   ============================================================ */
.app-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(var(--safe-top) + 10px) var(--space-4) 10px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--c-border);
  transition: transform var(--t-base), opacity var(--t-base), background var(--t-base), backdrop-filter var(--t-base);
  min-height: var(--app-bar-height);
}

.app-bar--hidden { transform: translateY(-100%); }

.app-bar.app-bar--transparent {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
}

.app-bar__left {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.app-bar__center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-bar__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: -0.4px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity var(--t-base), transform var(--t-base);
}

.large-title-active .app-bar__title {
  opacity: 0;
  transform: translateY(10px);
}

.large-title-active.app-bar--scrolled .app-bar__title {
  opacity: 1;
  transform: translateY(0);
}

.app-bar__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-3);
}

.app-bar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: var(--c-surface-2);
  border-radius: 50%;
  font-size: 18px;
  transition: background var(--t-fast), transform var(--t-fast);
}

.app-bar__icon-btn:active { transform: scale(.92); }

.app-bar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: var(--font-size-sm);
  flex-shrink: 0;
  overflow: hidden;
}

.app-bar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   5. MAIN CONTENT AREA
   ============================================================ */
.main-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4);
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-4));
  scroll-behavior: smooth;
}

.mobile-content-area {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Legacy container override for mobile */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4) calc(var(--tab-bar-height) + var(--safe-bottom) + 20px);
}

/* ============================================================
   6. BOTTOM TAB BAR
   ============================================================ */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  z-index: 300;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-top: 1px solid var(--c-border);
  border-top-left-radius: var(--r-xl);
  border-top-right-radius: var(--r-xl);
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}

.nav-btn,
.more-menu-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-height: 52px;
  padding: var(--space-1) var(--space-2);
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.nav-btn:active,
.more-menu-trigger:active {
  transform: scale(.92);
  background: var(--c-primary-light);
}

.nav-btn.active {
  color: var(--c-primary);
}

.nav-btn.active .tab-icon {
  transform: translateY(-2px) scale(1.08);
}

.tab-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform var(--t-spring);
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* Active dot indicator */
.nav-btn.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-primary);
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity var(--t-fast);
}

/* ============================================================
   7. BOTTOM SHEET
   ============================================================ */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
  backdrop-filter: blur(4px);
}

.bottom-sheet-overlay.show {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-surface);
  border-top-left-radius: var(--r-xl);
  border-top-right-radius: var(--r-xl);
  padding: var(--space-5) var(--space-5) calc(var(--space-5) + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform var(--t-slow);
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet-overlay.show .bottom-sheet {
  transform: translateY(0);
}

/* Drag handle */
.bottom-sheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--c-border);
  margin: 0 auto var(--space-5);
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.bottom-sheet-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.close-sheet-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--c-surface-2);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-secondary);
  transition: background var(--t-fast);
}

.close-sheet-btn:active { background: var(--c-border); }

.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.more-menu-grid .nav-btn {
  flex-direction: row;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  min-height: 52px;
}

.more-menu-grid .nav-btn .tab-icon {
  font-size: 20px;
  margin-right: 0;
}

.more-menu-grid .nav-btn.btn-danger {
  color: var(--c-danger);
  background: rgba(255,71,87,.08);
  grid-column: 1 / -1;
  justify-content: center;
}

/* ============================================================
   8. WELCOME / ONBOARDING SCREEN
   ============================================================ */
.welcome-section {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--app-bar-height));
  padding: var(--space-4) var(--space-4) 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

.welcome-hero {
  text-align: center;
  padding: var(--space-5) 0 var(--space-4);
}

.welcome-hero h2 {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--c-secondary);
  letter-spacing: -0.5px;
  margin-bottom: var(--space-2);
}

.welcome-subtitle {
  font-size: var(--font-size-base);
  color: var(--c-text-secondary);
  font-weight: 500;
}

/* Promo banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--c-accent) 0%, #4b3cc9 100%);
  color: #fff;
  padding: var(--space-5);
  border-radius: var(--r-xl);
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-accent);
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}

.banner-icon { font-size: 36px; flex-shrink: 0; }

.banner-content h3 {
  font-size: var(--font-size-md);
  font-weight: 700;
  margin-bottom: var(--space-1);
  line-height: 1.3;
}

.banner-content p {
  font-size: var(--font-size-sm);
  opacity: .9;
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.banner-btn {
  display: inline-block;
  background: #fff;
  color: var(--c-accent);
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: var(--font-size-sm);
  font-weight: 700;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.banner-btn:active { transform: scale(.97); }

/* Feature cards carousel */
.features-carousel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex: 1;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--c-surface);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.feature-card:active { transform: scale(.96); box-shadow: var(--shadow-xs); }

.feature-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-card h4 {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 2px;
}

.feature-card p {
  font-size: var(--font-size-sm);
  color: var(--c-text-secondary);
  margin: 0;
}

/* Sticky CTA */
.welcome-sticky-bottom {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--c-bg) 70%, transparent);
  padding: var(--space-5) 0 calc(var(--space-5) + var(--safe-bottom));
  margin: 0 calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  text-align: center;
}

.login-hint {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--c-text-muted);
}

/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--c-primary) 0%, #e66800 100%);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover { box-shadow: 0 12px 32px rgba(255,119,0,.40); }

.btn-secondary {
  background: linear-gradient(135deg, var(--c-secondary) 0%, var(--c-secondary-light) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(29,53,87,.20);
}

.btn-ghost {
  background: var(--c-surface-2);
  color: var(--c-text);
  box-shadow: none;
}

.btn-danger {
  background: var(--c-danger);
  color: #fff;
}

.btn-block { display: flex; width: 100%; }

.btn-lg {
  min-height: 56px;
  font-size: var(--font-size-md);
  border-radius: var(--r-lg);
}

.btn-sm {
  min-height: 36px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-sm);
  border-radius: var(--r-sm);
}

/* ============================================================
   10. CARDS — Soft Structuralism
   ============================================================ */
.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: none;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.card:active { transform: scale(.96); box-shadow: var(--shadow-xs); }

.card-body { padding: var(--space-5); }
.card-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--c-border); }
.card-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--c-border); }

/* Stat Cards */
.stat-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.stat-card:active { transform: scale(.96); box-shadow: var(--shadow-xs); }

/* ============================================================
   PULL-TO-REFRESH
   ============================================================ */
.ptr-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.ptr-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.5) rotate(0deg);
  transition: opacity var(--t-fast);
}

.ptr-spinner.ptr-pulling {
  opacity: 1;
}

.ptr-spinner.ptr-refreshing {
  opacity: 1;
  transform: scale(1);
  animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
  to { transform: scale(1) rotate(360deg); }
}

/* List rows */
.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--c-border);
}
.list-row:last-child { border-bottom: none; }

.list-row__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.list-row__content { flex: 1; min-width: 0; }
.list-row__title { font-size: var(--font-size-base); font-weight: 600; color: var(--c-text); }
.list-row__subtitle { font-size: var(--font-size-sm); color: var(--c-text-secondary); margin-top: 2px; }
.list-row__trailing { font-size: var(--font-size-sm); color: var(--c-text-muted); flex-shrink: 0; }

/* ============================================================
   11. FORMS — Mobile Optimized
   ============================================================ */
.form-group { margin-bottom: var(--space-5); }

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--c-text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--font-size-base);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-light);
}

.form-group textarea { resize: vertical; min-height: 100px; }

/* ============================================================
   12. MODAL (as Bottom Sheet on mobile)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-content {
  background: var(--c-surface);
  border-top-left-radius: var(--r-xl);
  border-top-right-radius: var(--r-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: var(--space-6) var(--space-5) calc(var(--space-6) + var(--safe-bottom));
  animation: sheetUp var(--t-slow) forwards;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--c-border);
}

.modal-header h3 { font-size: var(--font-size-lg); font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--c-surface-2);
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-secondary);
  cursor: pointer;
}

.modal-footer {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-3);
}

.modal-footer .btn { flex: 1; }

/* ============================================================
   13. TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: calc(var(--app-bar-height) + var(--safe-top) + var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: calc(100% - var(--space-8));
  max-width: 500px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--c-text);
  color: #fff;
  border-radius: var(--r-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--t-spring) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-success { background: #0F7B5F; }
.toast-error   { background: #C0392B; }
.toast-warning { background: #B7750D; }

/* ============================================================
   14. STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.status-confirmed { background: #d1fae5; color: #047857; }
.status-completed { background: #dbeafe; color: #1d4ed8; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.status-pending   { background: #fef3c7; color: #b45309; }
.status-neutral   { background: #e5e7eb; color: #374151; }

/* ============================================================
   15. LANG SWITCHER
   ============================================================ */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--c-surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
}

.lang-switcher__btn {
  border: none;
  background: transparent;
  color: var(--c-text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--t-fast), color var(--t-fast);
}

.lang-switcher__btn.is-active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-xs);
}

/* i18n flash prevention */
html:not([data-i18n-ready]) [data-i18n] { visibility: hidden; }

/* ============================================================
   16. MICRO ANIMATIONS
   ============================================================ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.animate-in { animation: fadeSlideUp var(--t-slow) both; }

.skeleton {
  background: linear-gradient(90deg, var(--c-surface-2) 25%, #e8e9eb 50%, var(--c-surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

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

/* ============================================================
   17. BOOKING PORTAL — mobile card overrides
   ============================================================ */
.booking-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.booking-card:active { transform: scale(.99); }

.booking-date { font-size: var(--font-size-md); font-weight: 700; color: var(--c-text); margin-bottom: 6px; }
.booking-card-actions { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ============================================================
   18. RESPONSIVE SAFETY NET
   ============================================================ */
@media (min-width: 601px) {
  .bottom-tab-bar { border-radius: 0; }
  .app-bar { border-radius: 0; }
  .container { padding: var(--space-5) var(--space-5) var(--space-8); }
}

@media (max-width: 600px) {
  /* Fix vertical scrolling: remove overflow-x: hidden from html/body */
  html, body { 
      width: 100vw;
      overflow-x: hidden; 
  }
  
  /* Prevent touch callouts */
  * { -webkit-tap-highlight-color: transparent; }
  
  /* Calendar mobile */
  .fc-toolbar { flex-direction: column; gap: var(--space-3); }
  .fc-toolbar-chunk { display: flex; justify-content: center; }
  
  /* Profile hero edge-to-edge */
  .profile-hero-header {
    border-radius: 0 0 var(--r-xl) var(--r-xl) !important;
    margin: -10px -10px var(--space-5) !important;
  }
  
  /* Stats horizontal scroll */
  .profile-stats {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-4) !important;
    padding-bottom: var(--space-3) !important;
    scrollbar-width: none;
  }
  .profile-stats::-webkit-scrollbar { display: none; }
  .profile-stats .stat-card {
    min-width: 160px !important;
    flex: 0 0 auto !important;
    scroll-snap-align: start !important;
  }
  
  /* Headings */
  h1, h2, h3 { letter-spacing: -0.4px; }
}

/* ============================================================
   19. LOGIN PAGE — Mobile-First
   ============================================================ */
.login-page-shell {
  min-height: 100dvh;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
}

.login-brand-bar {
  background: linear-gradient(135deg, var(--c-secondary) 0%, var(--c-secondary-light) 100%);
  padding: calc(var(--safe-top) + var(--space-4)) var(--space-4) var(--space-8);
}

.login-brand-bar__inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.login-brand-logo {
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.15);
  padding: 4px;
}

.login-brand-name {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  flex: 1;
}

.login-brand-bar__actions { margin-left: auto; }

/* Login card pulled up over the brand bar */
.login-container {
  max-width: 480px;
  margin: calc(-1 * var(--space-6)) auto 0;
  background: var(--c-surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--space-6) var(--space-5) calc(var(--space-6) + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  flex: 1;
  animation: sheetUp 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

.login-header { margin-bottom: var(--space-6); }
.login-header h1 { font-size: var(--font-size-2xl); font-weight: 800; color: var(--c-secondary); letter-spacing: -0.5px; margin-bottom: var(--space-2); }
.login-subtitle { font-size: var(--font-size-sm); color: var(--c-text-secondary); }

.login-back-home { margin-top: var(--space-5); text-align: center; }

/* Yandex button — clean CSS, no JS timer needed */
#yandex-login-btn {
  display: flex !important;
  width: 100%;
  min-height: 56px;
  padding: var(--space-4) var(--space-5);
  background: #FC3F1D;
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: var(--font-size-md);
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  box-shadow: 0 6px 20px rgba(252,63,29,.35);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

#yandex-login-btn:hover {
  background: #e6361a;
  box-shadow: 0 8px 24px rgba(252,63,29,.45);
}

#yandex-login-btn:active { transform: scale(.97); }

#yandex-oauth-wrapper {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background: linear-gradient(135deg, #fff5f3 0%, #ffe8e5 100%);
  border: 2px solid rgba(252,63,29,.25);
  border-radius: var(--r-xl);
}

#yandex-oauth-wrapper h2 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: #FC3F1D;
  text-align: center;
  margin-bottom: var(--space-4);
}

/* Login info card */
.login-info {
  background: var(--c-surface-2);
  border-left: 3px solid var(--c-accent);
  padding: var(--space-5);
  border-radius: var(--r-md);
  margin-top: var(--space-6);
}

.login-info h3 {
  color: var(--c-accent);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-3);
}

.login-info ul { padding-left: var(--space-5); color: var(--c-text-secondary); }
.login-info li { margin-bottom: var(--space-2); font-size: var(--font-size-sm); line-height: 1.5; }

/* Error message */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================================
   20. PROFILE REDESIGN (Soft Structuralism)
   ============================================================ */

/* Hero Section */
.profile-hero {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  background-size: 200% 200%;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  padding: calc(var(--space-6) + var(--space-4)) var(--space-5) var(--space-6);
  margin-top: calc(-1 * var(--space-4));
  margin-left: calc(-1 * var(--space-4));
  margin-right: calc(-1 * var(--space-4));
  margin-bottom: var(--space-5);
  color: var(--c-bg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-accent);
  animation: gradientShift 8s ease infinite;
}

.profile-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.2), transparent 60%);
  pointer-events: none;
}

.profile-hero__cover {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: rgba(255,255,255,0.1);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.profile-hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 60px;
}

.profile-hero__avatar-wrap {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
  border: 4px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: var(--space-3);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.profile-hero__avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-hero__name {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
}

.profile-hero__username {
  font-size: var(--font-size-sm);
  opacity: 0.9;
  margin-bottom: var(--space-3);
}

.profile-hero__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: var(--font-size-sm);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
  font-weight: 500;
}

.profile-hero__actions {
  display: flex;
  gap: var(--space-2);
  width: 100%;
}

.profile-hero__actions .btn {
  flex: 1;
  background: rgba(255,255,255,0.25);
  color: var(--c-bg);
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.profile-hero__actions .btn:active {
  background: rgba(255,255,255,0.35);
}

.profile-quote {
  margin-top: var(--space-4);
  padding: var(--space-3);
  font-style: italic;
  font-size: var(--font-size-sm);
  background: rgba(0,0,0,0.15);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
}

.stat-card__icon {
  font-size: 24px;
  margin-bottom: var(--space-1);
}

.stat-card__label {
  font-size: var(--font-size-xs);
  color: var(--c-text-mut);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card__value {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--c-text);
  line-height: 1;
}

.stat-card__trend {
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card--primary { background: linear-gradient(135deg, var(--c-surface) 0%, rgba(255, 119, 0, 0.05) 100%); }
.stat-card--info { background: linear-gradient(135deg, var(--c-surface) 0%, rgba(74, 144, 226, 0.05) 100%); }
.stat-card--warning { background: linear-gradient(135deg, var(--c-surface) 0%, rgba(245, 166, 35, 0.05) 100%); }

/* ============================================================
   14. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-3);
  opacity: 0.9;
}

.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--space-2);
}

.empty-state__desc {
  font-size: var(--font-size-base);
  color: var(--c-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-5);
  max-width: 280px;
}

/* ============================================================
   15. SEGMENTED CONTROL
   ============================================================ */
.segmented-control {
  display: flex;
  background: var(--c-surface-2);
  padding: 4px;
  border-radius: var(--r-md);
  width: 100%;
}

.segmented-control__btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: calc(var(--r-md) - 4px);
  border: none;
  background: transparent;
  color: var(--c-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: var(--t-fast);
  cursor: pointer;
}

.segmented-control__btn.active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 2px 6px rgba(0,0,0,.04), 0 0 1px rgba(0,0,0,.1);
}

/* ============================================================
   16. PUSH SCREEN
   ============================================================ */
.push-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--c-bg);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform var(--t-base) cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.push-screen.show {
  transform: translateX(0);
}

.push-screen__header {
  height: var(--app-bar-height);
  padding: 0 var(--space-4) 0 var(--space-2);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-top: var(--safe-top);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.push-screen__back-btn {
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: var(--space-2);
  border-radius: 50%;
  transition: background-color var(--t-fast);
}

.push-screen__back-btn:active {
  background: var(--c-surface-2);
}

.push-screen__title {
  flex: 1;
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.push-screen__content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  padding-bottom: calc(var(--space-4) + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
  background: var(--c-bg);
}

/* Animation Utils */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
