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

/* ---------------------------------------------------------------------------
   Thirstforlife Claims — "Жажда за живот" design system.
   Warm-paper background, wine-red primary, petrol-teal accent.
   (Ported from the approved platform mockup.)
--------------------------------------------------------------------------- */
:root {
  --wine: #9f292e;
  --wine-dark: #761b21;
  --wine-soft: #f0ebe7;
  --on-wine: #ffffff;
  --petrol: #145f63;
  --petrol-dark: #0f4c50;

  /* Semantic aliases (existing class names map onto these) */
  --primary: var(--wine);
  --primary-dark: var(--wine-dark);
  --primary-50: #fbf1f0;
  --primary-100: #f3e0df;

  --paper: #f6f4f1;
  --surface: #ffffff;
  --surface-soft: #f0ebe7;
  --ink: #241f20;
  --ink-muted: #6c6264;
  --line: #dfd7d3;

  /* Grays remapped to the warm palette so existing utilities blend in */
  --gray-50: #f6f4f1;
  --gray-100: #f0ebe7;
  --gray-200: #dfd7d3;
  --gray-300: #cdc3bd;
  --gray-400: #a99f9a;
  --gray-500: #6c6264;
  --gray-600: #574f50;
  --gray-700: #3c3536;

  --success: #0a7d3d;
  --success-bg: #e3f4e9;
  --warning: #6b4300;
  --warning-bg: #fff3db;
  --danger: #c0261f;
  --danger-bg: #fbe4e2;
  --info: #145f63;
  --info-bg: #e2f0f0;

  --radius: 8px;
  --radius-card: 14px;
  --shadow: 0 1px 2px rgba(48,3,7,.06), 0 8px 24px rgba(48,3,7,.05);
  --shadow-lg: 0 20px 50px rgba(48,3,7,.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--wine); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
main { flex: 1 0 auto; width: 100%; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 0 0 .5rem; }
h3 { font-size: 1.08rem; margin: 0 0 .5rem; }
.muted { color: var(--ink-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small { font-size: .85rem; }
.mt { margin-top: 1rem; }
.mt2 { margin-top: 1.5rem; }
.mb { margin-bottom: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-logo { height: 56px; width: auto; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; font-weight: 600; }
.brand-text span { color: var(--ink-muted); font-size: .82rem; }
.nav { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.nav a { color: var(--gray-700); font-weight: 500; }
.nav a:hover { color: var(--wine); text-decoration: none; }
.nav form { display: inline; }
.lang-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--gray-700); border-radius: var(--radius); padding: .3rem .55rem; cursor: pointer; font-size: .78rem; font-weight: 600; }
.lang-toggle:hover { background: var(--surface-soft); text-decoration: none; }

/* Footer */
.site-footer { flex-shrink: 0; background: #272122; color: #eee7e7; margin-top: 3.5rem; }
.site-footer .container { padding: 1.6rem 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; align-items: center; }
.site-footer a { color: #eee7e7; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; border: 1px solid transparent; border-radius: var(--radius);
  padding: 0 1.1rem; font-weight: 500; font-size: .92rem;
  cursor: pointer; text-decoration: none; line-height: 1; transition: background .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--wine); color: #fff; }
.btn-primary:hover { background: var(--wine-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-soft); }
.btn-accent { background: var(--petrol); color: #fff; }
.btn-accent:hover { background: var(--petrol-dark); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9e1e18; color:#fff; }
.btn-ghost { background: transparent; color: var(--wine); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-header { padding: 1rem 1.35rem; border-bottom: 1px solid var(--line); font-weight: 600; }
.card-body { padding: 1.35rem; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }
.field .req { color: var(--wine); }
.input, .select, .textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: var(--radius); font: inherit; background: var(--surface); color: var(--ink);
}
.textarea { min-height: 140px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(159,41,46,.14); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: .8rem; margin-top: .3rem; }
.field .hint { color: var(--ink-muted); font-size: .8rem; margin-top: .3rem; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .9rem; }
.check input { margin-top: .2rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table th { background: var(--surface-soft); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-600); }
.table tr:hover td { background: var(--paper); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-urgent { background: var(--danger-bg); color: var(--danger); margin-left: .4rem; }

/* Alerts / flash */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: var(--success-bg); color: #0a5c2d; }
.alert-error, .alert-danger { background: var(--danger-bg); color: #8f1a15; }
.alert-info { background: var(--info-bg); color: #0f4c50; }
.alert-warning { background: var(--warning-bg); color: #6b4300; }

/* Hero */
.hero { background: linear-gradient(120deg, var(--wine-dark), var(--wine)); color: #fff; padding: 3.75rem 0; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); color: #fff; letter-spacing: -.03em; }
.hero p { font-size: 1.1rem; max-width: 680px; opacity: .95; }
.hero .btn-primary { background: #fff; color: var(--wine-dark); }
.hero .btn-primary:hover { background: #f3ede9; color: var(--wine-dark); }
.hero .btn-secondary { background: transparent; color:#fff; border-color: rgba(255,255,255,.65); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.12); }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 1.35rem; box-shadow: var(--shadow); }
.stat .num { font-size: 2rem; font-weight: 700; color: var(--wine); }
.stat .label { color: var(--ink-muted); font-size: .85rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; }
.step { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--wine); border-radius: var(--radius-card); padding: 1.4rem 1.25rem; }
.step .n { width:34px;height:34px;border-radius:50%;background:var(--surface-soft);color:var(--wine);display:inline-flex;align-items:center;justify-content:center;font-weight:600;margin-bottom:.9rem; }

/* Admin layout */
.admin-shell { display: flex; gap: 1.5rem; padding: 1.5rem 0; }
.sidebar { width: 210px; flex-shrink: 0; }
.sidebar a { display: block; padding: .55rem .8rem; border-radius: var(--radius); color: var(--gray-700); font-weight: 500; }
.sidebar a.active, .sidebar a:hover { background: var(--primary-50); color: var(--wine); text-decoration: none; }
.admin-main { flex: 1; min-width: 0; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .5rem 0 .5rem 1.25rem; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content:''; position:absolute; left:-6px; top:.8rem; width:10px;height:10px;border-radius:50%;background:var(--wine); }

/* Filters bar */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; }

/* Pagination */
.pagination { display: flex; gap: .35rem; margin-top: 1rem; align-items: center; }
.pagination a, .pagination span { padding: .4rem .65rem; border: 1px solid var(--line); border-radius: var(--radius); font-size: .85rem; background: var(--surface); }
.pagination .current { background: var(--wine); color: #fff; border-color: var(--wine); }
.pagination .disabled { opacity: .5; }

/* Bars for statistics */
.bar-row { display:flex; align-items:center; gap:.5rem; margin-bottom:.4rem; font-size:.85rem; }
.bar-row .bar-label { width: 160px; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-row .bar-track { flex:1; background: var(--surface-soft); border-radius:999px; height:16px; overflow:hidden; }
.bar-row .bar-fill { height:100%; background: var(--petrol); }
.bar-row .bar-val { width: 40px; text-align:right; }

/* Modal-ish disclosure */
details.modal > summary { list-style: none; }
details.modal > summary::-webkit-details-marker { display:none; }

/* ---------------------------------------------------------------------------
   Landing page (mockup-faithful sections)
--------------------------------------------------------------------------- */
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .72fr); align-items: center; gap: 48px; }
.lp-lead { font-size: 1.12rem; line-height: 1.6; max-width: 720px; margin-bottom: 1.6rem; }
.hero .row { gap: .75rem; }
.lp-hero-card { color: var(--ink); box-shadow: var(--shadow-lg); }
.lp-hero-card h2 { font-size: 1.25rem; margin-bottom: .35rem; }
.lp-field-row { display: flex; gap: 8px; margin-top: .4rem; }
.lp-field-row .input { flex: 1; min-height: 46px; }
.lp-field-row .btn { min-height: 46px; }
.lp-note { color: var(--ink-muted); font-size: .78rem; margin-top: .8rem; }

.lp-warning { display: flex; align-items: flex-start; gap: 12px; background: var(--warning-bg); color: #6b4300; border-radius: 10px; padding: 16px 20px; margin-top: 28px; line-height: 1.45; }
.lp-warning svg { flex: none; margin-top: 2px; }

.lp-section { padding: 3.25rem 0; }
.lp-section > .container > h2 { font-size: 1.85rem; }
.lp-intro { max-width: 650px; margin-bottom: 1.5rem; }
.lp-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

.lp-help { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; background: var(--petrol); color: #fff; border-radius: 14px; padding: 28px 32px; margin: 1rem 0; }
.lp-help h2 { color: #fff; margin-bottom: .35rem; }
.lp-help p { opacity: .92; margin: 0; }
.lp-help .btn { background: #fff; color: var(--petrol); border-color: #fff; }
.lp-help .btn:hover { background: #eef4f4; color: var(--petrol); }

.lp-funding { background: var(--surface); border-top: 1px solid var(--line); margin-top: 3.5rem; padding: 2.25rem 0; }
.lp-funding-grid { display: grid; grid-template-columns: 1.3fr .7fr; align-items: center; gap: 34px; }
.lp-project { color: var(--ink-muted); font-size: .82rem; line-height: 1.55; }
.lp-project strong { color: var(--ink); display: block; margin-bottom: 5px; font-size: .9rem; }
.lp-logo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lp-partner-logo { min-height: 72px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-muted); display: grid; place-items: center; padding: 12px; text-align: center; font-size: .68rem; line-height: 1.35; }
.lp-partner-logo img { max-width: 100%; max-height: 52px; width: auto; height: auto; object-fit: contain; }
.lp-disclaimer { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: .76rem; line-height: 1.55; }

@media (max-width: 900px) {
  .lp-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .lp-steps { grid-template-columns: repeat(2, 1fr); }
  .lp-funding-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lp-steps { grid-template-columns: 1fr; }
  .lp-help { grid-template-columns: 1fr; padding: 24px; }
  .lp-help .btn { width: 100%; }
  .lp-logo-row { grid-template-columns: 1fr; }
  .lp-field-row { flex-direction: column; }
}

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; display:flex; flex-wrap:wrap; gap:.3rem; }
  .sidebar a { flex: 1 1 auto; text-align:center; }
  .brand-text span { display: none; }
}
