/* ===== EcoGuli base: tokens, type, forms, buttons ===== */

@font-face { font-family: "Noto Sans Georgian"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-400-normal.woff2") format("woff2"); unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-600-normal.woff2") format("woff2"); unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-700-normal.woff2") format("woff2"); unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-georgian-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-georgian-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-georgian-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Noto Serif Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-serif-georgian-georgian-600-normal.woff2") format("woff2"); unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Serif Georgian"; font-weight: 700; font-display: swap; src: url("../fonts/noto-serif-georgian-georgian-700-normal.woff2") format("woff2"); unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Serif Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-serif-georgian-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Noto Serif Georgian"; font-weight: 700; font-display: swap; src: url("../fonts/noto-serif-georgian-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

:root {
  /* Brand: --primary is overridden from admin settings */
  --primary: #B7E4C7;
  --primary-soft: #E3F3E9;
  --primary-mid: #8CCBA5;
  --primary-deep: #4E9E78;
  --ink: #143A2B;
  --ink-soft: #46604F;
  --paper: #F6FBF7;
  --surface: #FFFFFF;
  --line: #D3E6D9;
  --accent: #F2C46D;
  --accent-soft: #FBEBC5;
  --danger: #A83A2B;
  --danger-soft: #F7DDD8;
  --ok: #1F6B47;

  --font-body: "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Noto Serif Georgian", "Noto Sans Georgian", Georgia, serif;

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.75vw, 1.7rem);
  --step-3: clamp(1.7rem, 1.4rem + 1.5vw, 2.4rem);
  --step-4: clamp(2.05rem, 1.55rem + 2.5vw, 3.4rem);

  --r-sm: 10px; --r-md: 16px; --r-lg: 26px; --r-pill: 999px;
  --cut: 22px;
  --gap: 1rem;
  --tabbar-h: 68px;
  --header-h: 60px;
}

@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --primary-soft: color-mix(in srgb, var(--primary) 32%, white);
    --primary-mid: color-mix(in srgb, var(--primary) 70%, #2d7a56);
    --primary-deep: color-mix(in srgb, var(--primary) 45%, #1f6b47);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); font-size: var(--step-0); line-height: 1.65;
  color: var(--ink); background: var(--paper); -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration-color: var(--primary-deep); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; margin: 0 0 0.5em; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
small, .small { font-size: var(--step--1); }
.muted { color: var(--ink-soft); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--primary); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hidden { display: none !important; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.6rem 1.4rem; border: 2px solid transparent; border-radius: var(--r-pill);
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-align: center; text-decoration: none;
  background: var(--primary); color: var(--ink); cursor: pointer;
  transition: background-color 0.15s, transform 0.1s, border-color 0.15s;
}
.btn:hover { background: var(--primary-mid); }
.btn:active { transform: scale(0.98); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #0c2a1e; }
.btn-ghost { background: transparent; border-color: var(--ink); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f1c6be; }
.btn-sm { min-height: 40px; padding: 0.35rem 1rem; font-size: 0.92rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 1.2em; height: 1.2em; }

/* ----- Forms ----- */
.field { margin-bottom: 1rem; }
.field > label, .label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; }
.hint { display: block; font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.3rem; font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 0.65rem 0.9rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid #B9D3C3; border-radius: var(--r-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--primary); }
.input::placeholder, .textarea::placeholder { color: #7C9686; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23143A2B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 1.15rem; padding-right: 2.5rem; }
input[type="file"].input { padding: 0.55rem 0.7rem; }
input[type="color"].input { padding: 0.25rem; height: 48px; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .field-row-2 { grid-template-columns: 1fr 1fr; } .field-row-3 { grid-template-columns: repeat(3, 1fr); } }

/* Selectable option (radio / checkbox as a tappable row) */
.choice {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.8rem 1rem; margin-bottom: 0.6rem;
  background: var(--surface); border: 1.5px solid #B9D3C3; border-radius: var(--r-md); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--ink); background: var(--primary-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice input { margin-top: 0.3rem; width: 1.15rem; height: 1.15rem; accent-color: var(--ink); flex: none; }
.choice-body { flex: 1; min-width: 0; }
.choice-title { font-weight: 600; }
.choice.is-disabled { opacity: 0.5; cursor: not-allowed; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; accent-color: var(--ink); flex: none; }

/* ----- Badges, flash ----- */
.badge { display: inline-block; padding: 0.15rem 0.65rem; border-radius: var(--r-pill); font-size: 0.82rem; font-weight: 600; line-height: 1.5; background: var(--primary-soft); color: var(--ink); white-space: nowrap; }
.badge-ok { background: #D3EEDD; color: #145333; }
.badge-warn { background: var(--accent-soft); color: #6B4A06; }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: #D6E9F3; color: #1D4E69; }
.badge-neutral { background: #E7EEE9; color: var(--ink-soft); }

.flash { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.85rem 1rem; margin: 0 0 1rem; border-radius: var(--r-md); background: var(--primary-soft); font-weight: 600; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: #E1EEF5; color: #1D4E69; }
.flash-ok { background: #D3EEDD; color: #145333; }
.flash svg { flex: none; width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; }

/* ----- Rich text ----- */
.prose { max-width: 68ch; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.35em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
