/* Общие стили для всех экранов прототипа «Кейта» */
:root {
  --c-bg: #F7F8F5;
  --c-surface: #FFFFFF;
  --c-surface-2: #F2F4EF;
  --c-text: #1A1D24;
  --c-text-2: #5B6470;
  --c-text-3: #9099A6;
  --c-primary: #2D6A4F;
  --c-primary-dark: #1B4332;
  --c-primary-light: #D8F3DC;
  --c-accent: #F9A825;
  --c-accent-dark: #E68A00;
  --c-danger: #C1121F;
  --c-danger-light: #FFE5E5;
  --c-warning: #FFB703;
  --c-success: #2D6A4F;
  --c-border: #E5E7EB;
  --shadow-sm: 0 1px 2px rgba(20, 30, 20, 0.05);
  --shadow-md: 0 4px 12px rgba(20, 30, 20, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 30, 20, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

a { color: var(--c-primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  transition: transform 0.05s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
}
.btn-primary:disabled {
  background: var(--c-text-3); border-color: var(--c-text-3); box-shadow: none; opacity: 0.6;
}
.btn-accent {
  background: var(--c-accent); color: #1A1D24; border-color: var(--c-accent);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-primary); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 17px; }

/* ===== Карточки ===== */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* ===== Бейджи ===== */
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: var(--c-primary-light); color: var(--c-primary-dark); }
.badge-yellow { background: #FFF3CD; color: #856404; }
.badge-red { background: var(--c-danger-light); color: var(--c-danger); }
.badge-gray { background: var(--c-surface-2); color: var(--c-text-2); }

/* ===== Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, #eef0eb 0%, #f6f7f4 50%, #eef0eb 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Утилиты ===== */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--c-text-2); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.center { text-align: center; }
.hidden { display: none !important; }
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ===== Тосты ===== */
.toast-host {
  position: fixed; left: 0; right: 0; top: 16px; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(26, 29, 36, 0.95); color: #fff; padding: 12px 18px;
  border-radius: var(--radius-md); font-size: 14px; max-width: 90%;
  box-shadow: var(--shadow-lg); pointer-events: auto;
  animation: toast-in 0.25s ease-out;
}
@keyframes toast-in {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Push-имитация ===== */
.push {
  position: fixed; left: 12px; right: 12px; top: 12px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--shadow-lg);
  z-index: 9000;
  animation: push-in 0.35s cubic-bezier(.16,1,.3,1);
  max-width: 420px; margin: 0 auto;
}
.push-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--c-primary); color: #fff;
  display: grid; place-items: center; font-size: 20px; flex-shrink: 0;
}
.push-body { flex: 1; min-width: 0; }
.push-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.push-text { font-size: 13px; color: var(--c-text-2); }
.push-time { font-size: 11px; color: var(--c-text-3); }
@keyframes push-in {
  from { transform: translateY(-110%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
