/* ============================================================
   TilePro – Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

:root {
  --c-bg:        #f4f3ef;
  --c-surface:   #ffffff;
  --c-border:    #e2e1dc;
  --c-text:      #1a1a1a;
  --c-muted:     #6b6b6b;
  --c-accent:    #e8650a;
  --c-accent-h:  #c85508;
  --c-navy:      #1e2b3c;
  --c-navy-l:    #263548;
  --c-green:     #22a06b;
  --c-red:       #d93025;
  --font-main:   'DM Sans', sans-serif;
  --font-mono:   'Space Mono', monospace;
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --transition:  .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--c-bg); color: var(--c-text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   NAV
   ============================================================ */
.nav { background: var(--c-navy); border-bottom: 3px solid var(--c-accent); position: sticky; top: 0; z-index: 100; }
.nav__inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 58px; }
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__logo { width: 32px; height: 32px; background: var(--c-accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav__logo svg { color: #fff; }
.nav__title { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.nav__title span { color: var(--c-accent); }
.nav__links { display: flex; gap: 4px; list-style: none; align-items: center; }
.nav__links a { color: rgba(255,255,255,.75); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 6px; transition: var(--transition); }
.nav__links a:hover, .nav__links a.active { color: #fff; background: rgba(255,255,255,.08); }
.nav__links a.active { color: var(--c-accent); }
.nav__burger { display: none; background: none; border: none; padding: 6px; flex-direction: column; gap: 5px; }
.nav__burger span { display: block; width: 22px; height: 2px; background: rgba(255,255,255,.8); border-radius: 2px; transition: var(--transition); }
.nav__mobile { display: none; flex-direction: column; background: var(--c-navy-l); padding: 8px 16px 12px; }
.nav__mobile a { color: rgba(255,255,255,.8); font-size: 14px; font-weight: 500; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.06); display: block; transition: var(--transition); }
.nav__mobile a:last-child { border: none; }
.nav__mobile a:hover { color: var(--c-accent); }
.nav__mobile.open { display: flex; }

/* ============================================================
   HERO
   ============================================================ */
.page-hero { background: linear-gradient(135deg, var(--c-navy) 0%, #2a3f58 100%); padding: 36px 20px 32px; text-align: center; }
.page-hero h1 { font-size: clamp(22px, 4vw, 32px); font-weight: 600; color: #fff; letter-spacing: -0.5px; }
.page-hero p { color: rgba(255,255,255,.6); font-size: 14px; margin-top: 6px; max-width: 520px; margin-left: auto; margin-right: auto; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-content { flex: 1; }
.app-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ============================================================
   TRIJŲ STULPELIŲ ZONA
   ============================================================ */
.params-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}

.params-grid .panel {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

/* ============================================================
   SIENŲ SĄRAŠAS
   ============================================================ */
.walls-section {}

/* ============================================================
   SKAIČIUOTI MYGTUKAS
   ============================================================ */
.calc-btn-wrap {
  display: flex;
  justify-content: center;
}
.calc-btn-wrap .btn-run {
  width: auto;
  min-width: 280px;
  padding: 16px 40px;
  font-size: 16px;
}

/* ============================================================
   PANEL
   ============================================================ */
.panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.panel__title { font-size: 11px; font-weight: 600; color: var(--c-muted); letter-spacing: .8px; text-transform: uppercase; display: flex; align-items: center; gap: 7px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--c-border); }
.panel__title svg { flex-shrink: 0; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.field { margin-bottom: 12px;}
.field label { display: block; font-size: 10px; font-weight: 600; color: var(--c-muted); letter-spacing: .6px; text-transform: uppercase; margin-bottom: 4px; }
.field-note { font-size: 11px; color: var(--c-muted); margin-top: 5px; font-style: italic; }
.inp { width: 100%; padding: 9px 11px; border: 1.5px solid var(--c-border); border-radius: 7px; font-size: 14px; color: var(--c-text); background: var(--c-bg); transition: border-color var(--transition), box-shadow var(--transition); -webkit-appearance: none; }
.inp:focus { border-color: var(--c-accent); outline: none; box-shadow: 0 0 0 3px rgba(232,101,10,.12); background: #fff; }
.inp-sm { width: 110px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.radio-group { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.radio-group2 { display: flex; flex-direction: row; gap: 6px; margin-top: 4px; width: 100%;}
.radio-group2 .radio-opt {
  flex: 1; 
  display: flex;
}
.radio-opt { display: flex; align-items: center; cursor: pointer; }
.radio-opt input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-box { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 7px; border: 1.5px solid var(--c-border); font-size: 13px; font-weight: 500; color: var(--c-text); background: var(--c-bg); width: 100%; transition: border-color var(--transition), background var(--transition); cursor: pointer; }
.radio-box svg { color: var(--c-muted); flex-shrink: 0; }
.radio-opt input[type="radio"]:checked + .radio-box { border-color: var(--c-accent); background: rgba(232,101,10,.06); color: var(--c-accent); }
.radio-opt input[type="radio"]:checked + .radio-box svg { color: var(--c-accent); }

.sub-field { margin-top: 8px; padding: 10px 12px; background: var(--c-bg); border-radius: 7px; border: 1px solid var(--c-border); }
.sub-field label { display: block; font-size: 10px; font-weight: 600; color: var(--c-muted); letter-spacing: .6px; text-transform: uppercase; margin-bottom: 4px; }

.tog { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.tog input { opacity: 0; width: 0; height: 0; position: absolute; }
.tog-sl { position: absolute; inset: 0; background: #cbd5e0; border-radius: 11px; cursor: pointer; transition: .2s; }
.tog-sl::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tog input:checked + .tog-sl { background: var(--c-accent); }
.tog input:checked + .tog-sl::before { transform: translateX(18px); }
.tog-lbl { font-size: 13px; color: var(--c-text); font-weight: 500; }
.toggle-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }

.hint-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 4px; background: var(--c-border); color: var(--c-text); border-radius: 50%; font-size: 11px; font-weight: 600; cursor: help; }
.hint-icon:hover { background: var(--c-accent); color: #fff; }

/* ============================================================
   BTN RUN
   ============================================================ */
.btn-run { width: 100%; margin-top: 0; padding: 14px; background: var(--c-accent); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background var(--transition), transform var(--transition), box-shadow var(--transition); box-shadow: 0 4px 12px rgba(232,101,10,.3); }
.btn-run:hover { background: var(--c-accent-h); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(232,101,10,.4); }
.btn-run:active { transform: translateY(0); }

/* ============================================================
   REZULTATAI
   ============================================================ */
.results-section { display: flex; flex-direction: column; gap: 16px; }
.results-section.hidden { display: none !important; }

/* ============================================================
   SUVESTINĖ
   ============================================================ */
.summary { background: var(--c-navy); border-radius: var(--radius); padding: 16px; color: #fff; }
.summary h3 { font-size: 11px; font-weight: 600; color: var(--c-accent); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 12px; }
.summary__row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.summary__row:last-child { border: none; }
.summary__row--reserve { background: rgba(232,101,10,.1); margin: 8px -8px -8px; padding: 10px 8px; border-radius: 0 0 8px 8px; border: none !important; }
.summary__row--reserve span:first-child { font-weight: 600; font-size: 12px; }
.summary__val { font-weight: 600; font-family: var(--font-mono); font-size: 13px; }
.summary__val--accent { color: var(--c-accent); }
.summary__val--green { color: #4ade80; font-size: 15px; }

/* ============================================================
   SIENŲ LENTELĖ
   ============================================================ */
.parts-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.parts-header h2 { font-size: 16px; font-weight: 600; }
.parts-header p  { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.parts-badge { background: var(--c-accent); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font-mono); padding: 3px 9px; border-radius: 20px; white-space: nowrap; align-self: flex-start; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.tbl th { text-align: left; font-size: 10px; font-weight: 600; color: var(--c-muted); letter-spacing: .6px; text-transform: uppercase; padding: 8px 8px; background: var(--c-bg); border-bottom: 2px solid var(--c-border); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.tbl tr:last-child td { border: none; }
.tbl tr:hover td { background: #fafaf8; }
.tinp { width: 100%; padding: 6px 8px; border: 1.5px solid var(--c-border); border-radius: 6px; font-size: 14px; background: var(--c-bg); color: var(--c-text); transition: border-color var(--transition); }
.tinp:focus { border-color: var(--c-accent); outline: none; }
.btn-add { background: var(--c-accent); border: none; color: #fff; width: 30px; height: 30px; border-radius: 7px; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--transition); }
.btn-add:hover { background: var(--c-accent-h); }
.btn-del { background: none; border: none; color: #c0392b; font-size: 15px; padding: 3px 6px; border-radius: 5px; transition: background var(--transition); }
.btn-del:hover { background: #fdf0f0; }

/* ============================================================
   VIZUALIZACIJOS
   ============================================================ */
.boards-wrap { display: flex; flex-direction: column; gap: 16px; }
.board-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.board-hdr { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.board-hdr__title { font-size: 15px; font-weight: 600; color: var(--c-text); }
.board-hdr__title span { font-size: 11px; color: var(--c-muted); font-weight: 400; margin-left: 4px; }
.board-hdr__stats { font-size: 12px; color: var(--c-muted); display: flex; gap: 14px; flex-wrap: wrap; }
.board-canvas-wrap { overflow-x: auto; }
canvas { display: block; border-radius: 0px; background: #d4d4ce; border: 1.5px solid var(--c-border); max-width: 100%; }

/* Wall stats chips */
.wall-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; margin-bottom: 4px; }
.stat-chip { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 20px; padding: 4px 10px; font-size: 11px; font-weight: 500; color: var(--c-text); display: flex; align-items: center; gap: 5px; }
.stat-chip strong { font-family: var(--font-mono); color: var(--c-accent); }
.stat-chip.cut-chip strong { color: var(--c-red); }

/* ============================================================
   LEGENDA (po brėžiniu)
   ============================================================ */
.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 7px;
  align-items: center;
}
.board-legend__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--c-muted);
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-right: 4px;
  flex-basis: 100%;
  margin-bottom: 4px;
}
.board-legend__item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.board-legend__color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.12);
}
.board-legend__name { font-weight: 600; color: var(--c-text); }
.board-legend__dim { font-family: var(--font-mono); font-size: 11px; color: var(--c-muted); margin-left: 2px; }

/* Reserve box */
.reserve-box { background: linear-gradient(135deg, #1e2b3c 0%, #263548 100%); border-radius: var(--radius); padding: 20px; border: 1px solid rgba(232,101,10,.3); box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.reserve-box__title { font-size: 12px; font-weight: 600; color: var(--c-accent); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px; }
.reserve-box__main { font-size: 22px; font-weight: 700; color: #fff; font-family: var(--font-mono); margin-bottom: 4px; }
.reserve-box__main span { font-size: 14px; color: rgba(255,255,255,.5); font-weight: 400; }
.reserve-box__sub { font-size: 12px; color: rgba(255,255,255,.5); }
.reserve-box__row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13px; color: rgba(255,255,255,.7); }
.reserve-box__row:last-child { border: none; }
.reserve-box__row strong { font-family: var(--font-mono); color: #4ade80; }

/* ============================================================
   INFO SECTIONS
   ============================================================ */
.info-section { max-width: 1280px; margin: 0 auto; padding: 40px 16px 60px; }
.info-section h2 { font-size: clamp(20px, 3vw, 26px); font-weight: 600; margin-bottom: 6px; letter-spacing: -0.3px; }
.info-section .sub { color: var(--c-muted); font-size: 14px; margin-bottom: 28px; }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 40px; }
.step-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.step-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--c-accent); }
.step-num { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: rgba(232,101,10,.15); line-height: 1; margin-bottom: 8px; }
.step-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.step-card p  { font-size: 13px; color: var(--c-muted); line-height: 1.6; }

/* FAQ */
/* FAQ SEKCIJA */
.info-section {
    width: 100%;
    display: block !important; /* Užtikriname, kad tai ne flex elementas */
}

.faq {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    margin: 40px auto !important; /* Viršuje/apačioje 40px, šonuose auto - sucentruoja */
    width: 100% !important;        /* Užima beveik visą plotą mažuose ekranuose */
}

.faq-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100% !important;
    box-sizing: border-box !important;
}

.faq-q {
    width: 100% !important;
    text-align: left;
    padding: 16px 18px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.faq-a {
    display: none;
    padding: 16px 18px;
    font-size: 13px;
    color: var(--c-muted);
    line-height: 1.7;
    border-top: 1px solid var(--c-border);
    width: 100% !important;
    box-sizing: border-box !important; /* Neleidžia paddingui išpūsti pločio */
}

.faq-item.open .faq-a {
    display: block !important;
}

/* Grain info / Tips */
.grain-info { background: var(--c-navy); border-radius: var(--radius); padding: 24px; color: #fff; margin-bottom: 40px; }
.grain-info h3 { font-size: 16px; font-weight: 600; color: var(--c-accent); margin-bottom: 6px; }
.grain-info p  { font-size: 13px; color: rgba(255,255,255,.7); line-height: 1.7; }
.grain-visual { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grain-box { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 14px; }
.grain-box h4 { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5); letter-spacing: .5px; margin-bottom: 8px; text-transform: uppercase; }
.grain-box p  { font-size: 13px; color: rgba(255,255,255,.8); line-height: 1.6; }
.grain-box svg { margin-bottom: 8px; color: var(--c-accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--c-navy); border-top: 3px solid var(--c-accent); color: rgba(255,255,255,.65); padding: 40px 20px 24px; }
.footer__inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
.footer__brand .nav__logo { width: 36px; height: 36px; margin-bottom: 10px; }
.footer__brand h3 { font-family: var(--font-mono); font-size: 16px; color: #fff; font-weight: 700; }
.footer__brand p  { font-size: 13px; line-height: 1.7; margin-top: 6px; max-width: 260px; }
.footer__col h4 { font-size: 11px; font-weight: 600; color: #fff; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 12px; }
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.footer__col a { font-size: 13px; color: rgba(255,255,255,.55); transition: color var(--transition); }
.footer__col a:hover { color: var(--c-accent); }
.footer__bottom { max-width: 1280px; margin: 28px auto 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; color: rgba(255,255,255,.35); }

/* ============================================================
   TOAST
   ============================================================ */
#toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); min-width: 320px; max-width: 90%; background: #c0392b; color: #ffffff; padding: 16px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; line-height: 1.5; z-index: 9999; box-shadow: 0 10px 30px rgba(192,57,43,.3), 0 4px 10px rgba(0,0,0,.2); border-left: 6px solid #8e2a20; font-family: 'DM Sans', sans-serif; display: flex; align-items: center; gap: 12px; animation: slideIn 0.3s ease-out forwards; }
@keyframes slideIn { from { opacity: 0; transform: translate(-50%, -20px); } to   { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================
   UTILITY
   ============================================================ */
.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; }
.eff-g { color: var(--c-green); font-weight: 600; }
.eff-o { color: var(--c-accent); font-weight: 600; }
.eff-r { color: var(--c-red); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Tablet: 2 stulpeliai parametrams */
@media (max-width: 960px) {
  .params-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .grain-visual { grid-template-columns: 1fr 1fr; }
}

/* Mažesni planšetai: 1 stulpelis */
@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .params-grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .grain-visual { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .col-hide { display: none; }
  .tinp { font-size: 13px; padding: 7px 8px; }
  .radio-group { flex-direction: row; flex-wrap: wrap; }
  .radio-box { padding: 5px 10px; font-size: 12px; }
  .calc-btn-wrap .btn-run { min-width: unset; width: 100%; }
  .board-legend { gap: 6px 12px; }
}

@media (max-width: 480px) {
  .app-wrap { padding: 12px 10px 30px; }
  .panel { padding: 14px; }
  .board-card { padding: 12px; }
  .board-legend { padding: 8px 10px; }
}

.info-note {
  display: flex;
  gap: 12px;
  /* Šviesiai raudonas/rausvas fonas */
  background: #fff5f5; 
  /* Ryški raudona kairėje pusėje */
  border-left: 4px solid var(--c-red, #d93025); 
  padding: 16px;
  border-radius: var(--radius);
  margin: 20px 0;
  /* Tamsiai raudona tekstui, kad būtų lengva skaityti */
  color: #a8201a; 
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #fed7d7; /* Pridėtas šviesus rėmelis aplink visą bloką */
}

.info-note__icon {
  flex-shrink: 0;
  /* Ryški piktogramos spalva */
  color: var(--c-red, #d93025); 
  margin-top: 2px;
}

.info-note strong {
  display: block;
  margin-bottom: 2px;
  /* Dar tamsesnė raudona paryškintam tekstui */
  color: #7d120e; 
}
