/* =============================================
   styles.css — Shared styles for pallet-calculator.com
   Theme: Pale Blue · 2025
   ============================================= */

/* Design tokens */
:root{
  --bg:#f5f9ff;
  --panel:#ffffff;
  --surface-muted:#edf3ff;
  --border:#d6e3f6;
  --text:#102a43;
  --muted:#5b6b87;
  --brand:#2b7de9;
  --brand-2:#5aa0ff;
  --ok:#1a9a58;
  --warn:#d97706;
  --bad:#dc2626;
  --radius:14px;
  --shadow:0 18px 36px rgba(43,125,233,.14);
  --ring:0 0 0 3px rgba(43,125,233,.28);
  --container:1120px;
}

/* Base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,#f5f9ff 0%, #f2f6ff 55%, #e7f0ff 100%);
  color:var(--text);
  font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
}
img{max-width:100%; height:auto; display:block}
a{color:var(--brand); text-decoration:none}
a:hover{color:var(--brand-2)}
:focus-visible{outline:none; box-shadow:var(--ring)}
.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}

/* Layout helpers */
.container{max-width:var(--container); margin:0 auto; padding:24px}
.grid{display:grid; gap:18px}
.grid-2{display:grid; gap:18px}
.grid-3{display:grid; gap:18px; grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.grid.tools{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
@media(min-width:960px){ .grid-2{grid-template-columns:1.18fr .82fr} }
@media(min-width:960px){ .grid.tools{grid-template-columns:repeat(3,minmax(0,1fr))} }
@media(min-width:960px){ .grid-3{grid-template-columns:repeat(3,minmax(0,1fr))} }
.hero{display:grid; gap:16px; align-items:center; padding:32px 0}
.cta{display:flex; gap:12px; flex-wrap:wrap}
.pill-group{display:flex; flex-wrap:wrap; gap:8px}
.actions{display:flex; gap:8px; flex-wrap:wrap}
.lang-switch{font-size:14px; color:var(--muted); margin-bottom:16px}
.lang-switch a{color:var(--brand)}
.lang-switch a:hover{color:var(--brand-2)}

/* Header / Nav */
header.site-header{position:sticky; top:0; z-index:20; backdrop-filter:saturate(160%) blur(10px); background:rgba(255,255,255,.92); border-bottom:1px solid var(--border)}
header.site-header .container{display:flex; align-items:center; justify-content:space-between; gap:16px}
.brand{display:inline-flex; align-items:center; gap:12px; text-decoration:none; color:var(--text); font-weight:600}
.brand-logo{height:40px; width:auto}
nav.nav{display:flex; gap:12px; flex-wrap:wrap}
nav.nav a{color:#4f6589; padding:8px 14px; border-radius:999px; border:1px solid transparent; transition:background .18s ease, color .18s ease}
nav.nav a[aria-current="page"], nav.nav a:hover{color:var(--brand); background:rgba(43,125,233,.12); border-color:rgba(43,125,233,.35)}

/* Typography */
h1{font-size:clamp(28px,3.2vw,40px); line-height:1.18; margin:24px 0 8px}
h2{font-size:clamp(20px,2.2vw,28px); margin:20px 0 12px}
h3{font-size:19px; margin:12px 0}
.muted{color:var(--muted)}
.kbd{font:12px ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; padding:2px 6px; border-radius:6px; background:var(--surface-muted); border:1px solid var(--border); color:#1d3b61}

/* Cards */
.card{background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(237,243,255,.94)); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow)}
.card .card-body{padding:18px}
.card h2:first-child,.card h3:first-child{margin-top:0}

/* Badges */
.badge{display:inline-flex; gap:8px; align-items:center; padding:6px 12px; border-radius:999px; font-size:12px; color:var(--brand); background:rgba(43,125,233,.12); border:1px solid rgba(43,125,233,.3)}

/* Buttons */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 16px; border-radius:12px; border:1px solid var(--border); background:var(--panel); color:var(--brand); cursor:pointer; font-weight:600; transition:background .18s ease, border-color .18s ease, color .18s ease}
.btn:hover{background:var(--surface-muted); border-color:rgba(43,125,233,.4)}
.btn.primary{background:var(--brand); border-color:var(--brand); color:#fff}
.btn.primary:hover{background:#236ad3; border-color:#236ad3}
.btn.ghost{background:transparent; color:var(--muted)}
.btn:disabled{opacity:.6; cursor:not-allowed}

/* Forms */
.form-row{display:grid; gap:10px; grid-template-columns:repeat(4, minmax(0,1fr))}
.form-row-2{display:grid; gap:10px; grid-template-columns:repeat(2, minmax(0,1fr))}
@media(max-width:960px){
  .form-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .form-row-2{grid-template-columns:1fr}
}
.field{display:flex; flex-direction:column; gap:6px}
label{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em}
input[type="number"], select, input[type="text"], input[type="email"]{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  transition:border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus{outline:none; border-color:rgba(43,125,233,.55); box-shadow:var(--ring)}
.radio{display:flex; gap:12px; align-items:center; margin:8px 0 12px}
.radio label{display:flex; gap:8px; align-items:center}
.field-error{color:var(--bad); font-size:12px}

/* Results & Preview */
.result{display:grid; gap:12px}
.result .stat,.stat{background:var(--surface-muted); padding:12px 14px; border:1px dashed rgba(43,125,233,.28); border-radius:10px}
.result .stat b,.stat b{font-size:18px; color:var(--text)}
.stat[data-focus="true"]{border-style:solid; border-color:rgba(43,125,233,.48); background:rgba(43,125,233,.12)}
.preview{min-height:200px; background:repeating-linear-gradient(135deg, rgba(43,125,233,.08) 0 16px, rgba(255,255,255,.8) 16px 32px); border-radius:var(--radius); border:1px dashed rgba(43,125,233,.22); display:flex; align-items:center; justify-content:center; color:var(--muted); padding:18px; text-align:center}
.status-ok{color:var(--ok)}
.status-warn{color:var(--warn)}
.status-bad{color:var(--bad)}
.stamp{font-size:12px; color:var(--muted); margin-top:12px}

/* Sticky toolbar */
.sticky-spacer{height:12px}
.sticky-toolbar{position:sticky; top:12px; z-index:15; display:flex; gap:8px; flex-wrap:wrap; padding:12px 16px; border-radius:var(--radius); border:1px solid var(--border); background:rgba(255,255,255,.95); box-shadow:var(--shadow)}
@media(max-width:640px){ .sticky-toolbar{position:static; box-shadow:none; padding:0; border:none; background:transparent} }

/* Tables */
.table{width:100%; border-collapse:collapse}
.table th,.table td{padding:10px 12px; border-bottom:1px solid var(--border); text-align:left}

/* Samples grid */
.sample{display:grid; gap:12px}
@media(min-width:960px){ .sample{grid-template-columns:repeat(3, minmax(0,1fr))} }
.sample a{display:block; padding:14px; border-radius:12px; border:1px solid var(--border); background:var(--panel); transition:transform .18s ease, box-shadow .18s ease}
.sample a:hover{transform:translateY(-2px); box-shadow:0 10px 24px rgba(43,125,233,.14)}

/* Footer */
footer{color:var(--muted); border-top:1px solid var(--border); margin-top:36px; background:rgba(255,255,255,.88)}
footer .container{display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between}

/* Utility */
.badge + h1{margin-top:12px}
.card.dashed{border-style:dashed}

/* Print */
@media print{
  body{background:#fff; color:#000; font:12pt/1.4 system-ui}
  header.site-header{position:static; background:#fff !important; border:none; box-shadow:none}
  nav.nav, .cta, .sticky-toolbar, footer{display:none !important}
  .card{background:#fff; color:#000; box-shadow:none; border:1px solid #999}
  .card .card-body{padding:16px}
  .preview{color:#000; border-color:#999; background:none}
  .stamp{color:#000}
  .btn{border-color:#000; color:#000}
}