/* =====================================================================
   Kéki Lapszabászat – shared design system ("Prémium műhely")
   Tokens, reset, typography, buttons, forms, cards, badges, tables,
   utilities. Page-specific styles live in web.css / order.css / crm.css.
   ===================================================================== */

:root {
  /* brand */
  --navy: #0c3b5d;
  --navy-700: #0d3d61;
  --navy-900: #082a44;
  --navy-050: #e3edf5;
  --oak: #c8955a;
  --oak-light: #e9c79a;
  --oak-tint: #f3e6d6;
  --oak-text: #8a5a25;
  --cream: #f6f1ea;
  --warm-white: #fffdfa;
  --surface: #efe7dc;
  --white: #ffffff;

  /* text */
  --text: #1a2430;
  --text-2: #5b6672;
  --text-3: #8e98a3;
  --on-navy: #f6f1ea;
  --on-navy-2: rgba(246, 241, 234, 0.72);

  /* lines & shadows */
  --line: rgba(12, 59, 93, 0.10);
  --line-strong: rgba(12, 59, 93, 0.18);
  --shadow-sm: 0 1px 2px rgba(12, 59, 93, 0.06), 0 1px 6px rgba(12, 59, 93, 0.05);
  --shadow-md: 0 6px 18px rgba(12, 59, 93, 0.10), 0 2px 6px rgba(12, 59, 93, 0.06);
  --shadow-lg: 0 24px 48px rgba(12, 59, 93, 0.16), 0 8px 16px rgba(12, 59, 93, 0.08);

  /* status */
  --st-new-bg: #fbeedd;      --st-new-fg: #b26b1e;
  --st-priced-bg: #e3edf5;   --st-priced-fg: #0c3b5d;
  --st-quote-bg: #efe8f8;    --st-quote-fg: #6b3fa0;
  --st-accepted-bg: #e2f2e9; --st-accepted-fg: #1e6b46;
  --st-processing-bg: #dff1f3; --st-processing-fg: #0f6f7a;
  --st-completed-bg: #e2f2e9; --st-completed-fg: #14532d;
  --st-rejected-bg: #fae5e7; --st-rejected-fg: #a7323f;

  --success: #1e6b46;
  --danger: #a7323f;
  --warning: #b26b1e;
  --info: #0c3b5d;

  /* type */
  --font-display: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* radii & spacing */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 100px;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 140ms var(--ease);
  --slow: 260ms var(--ease);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  max-width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
:focus-visible { outline: 2px solid var(--oak); outline-offset: 2px; }
::selection { background: var(--oak-light); color: var(--navy-900); }

/* ---------- typography ---------- */
.disp, h1, h2, h3, .h1, .h2, .h3, .num {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--navy);
}
h1, .h1 { font-size: clamp(44px, 6vw, 84px); }
h2, .h2 { font-size: clamp(34px, 4vw, 58px); }
h3, .h3 { font-size: clamp(22px, 2.2vw, 30px); }
.h4 { font-family: var(--font-body); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; text-transform: none; color: var(--text); }
.lead { font-weight: 300; font-size: clamp(16px, 1.3vw, 19px); color: var(--text-2); line-height: 1.65; }
.light { font-weight: 300; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--oak-text);
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--oak); border-radius: 2px; }
.tnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.idx { font-family: var(--font-display); font-size: 40px; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--line-strong); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container--narrow { max-width: 860px; }
.section { padding: clamp(56px, 8vw, 120px) 0; }
.section--tight { padding: clamp(32px, 5vw, 64px) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head .lead { max-width: 640px; margin: 10px 0 0; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- surfaces ---------- */
.card {
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: clamp(20px, 3vw, 32px); }
.card--glass {
  background: rgba(255, 253, 250, 0.82);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
}
.card--navy { background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: var(--on-navy); border-color: transparent; }
.card--navy h1, .card--navy h2, .card--navy h3, .card--navy .num { color: var(--on-navy); }
.card--navy .muted { color: var(--on-navy-2); }
.card-t { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.03em; color: var(--navy); text-transform: uppercase; }
.wood {
  background-color: var(--surface);
  background-image:
    repeating-linear-gradient(100deg, rgba(200, 149, 90, 0.10) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(97deg, rgba(12, 59, 93, 0.04) 0 1px, transparent 1px 14px);
}
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 14px; letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid transparent; transition: transform var(--fast), box-shadow var(--fast), background var(--fast), color var(--fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .ic { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; margin-right: -8px; }
.btn .ic svg { width: 15px; height: 15px; }
.btn-p { background: var(--navy); color: var(--on-navy); box-shadow: 0 6px 16px rgba(12, 59, 93, 0.22); }
.btn-p:hover { background: var(--navy-700); }
.btn-p .ic { background: rgba(255, 255, 255, 0.12); }
.btn-oak { background: var(--oak); color: #fff; box-shadow: 0 6px 16px rgba(200, 149, 90, 0.35); }
.btn-oak:hover { background: #b9854c; }
.btn-oak .ic { background: rgba(255, 255, 255, 0.18); }
.btn-s { background: var(--warm-white); color: var(--navy); border-color: var(--line-strong); }
.btn-s:hover { border-color: var(--navy); }
.btn-s .ic { background: var(--navy-050); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy-050); }
.btn-danger { background: #fae5e7; color: var(--danger); }
.btn-danger:hover { background: #f5d3d7; }
.btn-light { background: rgba(255, 255, 255, 0.14); color: var(--on-navy); border-color: rgba(255, 255, 255, 0.22); }
.btn-light:hover { background: rgba(255, 255, 255, 0.22); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn--sm .ic { width: 24px; height: 24px; }
.btn--lg { min-height: 54px; padding: 0 28px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.btn--icon svg { width: 18px; height: 18px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .error-text { font-size: 12px; color: var(--danger); font-weight: 600; }
.req { color: var(--oak-text); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 16px;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(12, 59, 93, 0.10); }
.input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--danger); }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6672' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text-2); font-weight: 600; font-size: 13px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--navy); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

/* pills / chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--warm-white); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 600; color: var(--text-2); transition: all var(--fast);
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.chip .count { font-size: 11px; padding: 2px 7px; border-radius: 100px; background: rgba(12, 59, 93, 0.08); }
.chip.is-active .count { background: rgba(255, 255, 255, 0.18); }

/* ---------- badges & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge--oak { background: var(--oak-tint); color: var(--oak-text); }
.badge--navy { background: var(--navy-050); color: var(--navy); }
.badge--success { background: var(--st-accepted-bg); color: var(--st-accepted-fg); }
.badge--danger { background: var(--st-rejected-bg); color: var(--st-rejected-fg); }
.badge--muted { background: var(--surface); color: var(--text-2); }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { background: var(--st-new-bg); color: var(--st-new-fg); }
.st-priced { background: var(--st-priced-bg); color: var(--st-priced-fg); }
.st-quote-sent { background: var(--st-quote-bg); color: var(--st-quote-fg); }
.st-accepted { background: var(--st-accepted-bg); color: var(--st-accepted-fg); }
.st-processing { background: var(--st-processing-bg); color: var(--st-processing-fg); }
.st-completed { background: var(--st-completed-bg); color: var(--st-completed-fg); }
.st-rejected { background: var(--st-rejected-bg); color: var(--st-rejected-fg); }

/* ---------- avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--navy-050); color: var(--navy); font-family: var(--font-display); font-size: 15px; letter-spacing: 0.04em; flex: none; }
.avatar--oak { background: var(--oak-tint); color: var(--oak-text); }
.avatar--lg { width: 48px; height: 48px; font-size: 19px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); }
.table { font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--warm-white); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: rgba(12, 59, 93, 0.03); }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table .nowrap { white-space: nowrap; }

/* ---------- alerts / flash / toast ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r-md); font-size: 14px; border: 1px solid transparent; }
.alert--success { background: var(--st-accepted-bg); color: var(--st-accepted-fg); border-color: rgba(30, 107, 70, 0.15); }
.alert--error { background: var(--st-rejected-bg); color: var(--st-rejected-fg); border-color: rgba(167, 50, 63, 0.15); }
.alert--info { background: var(--navy-050); color: var(--navy); border-color: rgba(12, 59, 93, 0.12); }
.alert--warning { background: var(--st-new-bg); color: var(--st-new-fg); border-color: rgba(178, 107, 30, 0.15); }
.flashes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 14px 18px; border-radius: var(--r-md); background: var(--navy-900); color: var(--on-navy); font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in var(--slow); }
.toast--success { background: var(--st-accepted-fg); }
.toast--error { background: var(--st-rejected-fg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(8, 42, 68, 0.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: toast-in var(--fast); }
.modal { width: 100%; max-width: 640px; max-height: calc(100vh - 40px); overflow: auto; background: var(--warm-white); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 28px; }
.modal--lg { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------- misc ---------- */
.pill-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--oak); color: #fff; font-family: var(--font-display); font-size: 15px; letter-spacing: .04em; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.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; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.w-100 { width: 100%; }
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--r-pill); font-weight: 600; font-size: 13px; border: 1px solid var(--line-strong); background: var(--warm-white); }
.pagination .is-active { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.pagination .dots { border: 0; background: none; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

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