/* ============================================================
   Wizytówki Ełk — design tokens & global styles
   Minimal premium: warm white canvas, near-black ink, gold accent
   ============================================================ */

:root {
  /* color */
  --paper:      #faf8f3;
  --paper-2:    #f2ede3;
  --paper-3:    #ebe5d8;
  --white:      #ffffff;
  --ink:        #15120d;
  --ink-2:      #3a342b;
  --ink-soft:   #6b6357;
  --ink-faint:  #9c948684;
  --line:       rgba(21,18,13,0.12);
  --line-soft:  rgba(21,18,13,0.07);
  /* UI accent — cobalt blue (replaces gold in buttons/tags/steps) */
  --gold:       #2f54d6;
  --gold-2:     #213fae;
  --gold-soft:  #e4e9fb;
  --gold-glow:  #aebef4;
  --accent:     #2f54d6;
  --accent-2:   #213fae;
  --accent-soft:#e4e9fb;
  /* real metallics — only for actual foil product swatches/visuals */
  --foil-gold:  #c19a4e;
  --silver:     #b7b8bb;
  --silver-2:   #e7e8ea;
  --good:       #2f7d52;
  --good-soft:  #e2f0e6;

  /* softer dark panel (less harsh than near-black ink) */
  --panel:      #28303f;
  --panel-2:    #323b4d;
  --panel-blue: #2f53d6;

  /* type */
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;

  /* shape */
  --r-card: 14px;
  --r-tile: 12px;
  --r-pill: 999px;

  /* shadow */
  --sh-1: 0 1px 2px rgba(21,18,13,0.05), 0 1px 1px rgba(21,18,13,0.04);
  --sh-2: 0 4px 18px -8px rgba(21,18,13,0.18);
  --sh-3: 0 24px 60px -28px rgba(21,18,13,0.40);
  --sh-card: 0 30px 60px -30px rgba(21,18,13,0.55);

  --maxw: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body { overflow-x: hidden; position: relative; }
img, svg, canvas { max-width: 100%; }
#root { overflow-x: hidden; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
}

#root { min-height: 100vh; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

.num { font-family: var(--display); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--gold-soft); color: var(--ink); }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .wrap { padding: 0 18px; } }

.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.eyebrow.ink { color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display); font-weight: 500; font-size: 15px;
  padding: 15px 26px; border-radius: var(--r-pill);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s, box-shadow .2s, color .15s;
  white-space: nowrap; line-height: 1; letter-spacing: -0.01em;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--sh-2); }
.btn-primary:hover { background: #000; box-shadow: var(--sh-3); }
.btn-gold { background: var(--gold); color: #fff; box-shadow: 0 10px 28px -12px var(--gold-2); }
.btn-gold:hover { background: var(--gold-2); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: var(--white); }
.btn-lg { padding: 18px 32px; font-size: 16px; }
.btn-sm { padding: 11px 18px; font-size: 13.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- card surfaces ---------- */
.surface {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

/* ---------- chips / segmented ---------- */
.seg {
  display: inline-flex; padding: 4px; gap: 4px;
  background: var(--paper-2); border-radius: var(--r-pill);
  border: 1px solid var(--line-soft);
}
.seg button {
  font-family: var(--display); font-weight: 500; font-size: 13px;
  padding: 8px 16px; border-radius: var(--r-pill); color: var(--ink-soft);
  transition: all .16s;
}
.seg button[data-on="true"] { background: var(--ink); color: var(--paper); }

/* ---------- option tiles ---------- */
.tile {
  position: relative; display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--line); border-radius: var(--r-tile);
  background: var(--white); overflow: hidden; cursor: pointer;
  transition: border-color .16s, box-shadow .2s, transform .16s;
  text-align: left; padding: 0;
}
.tile:hover { border-color: var(--ink-soft); box-shadow: var(--sh-2); }
.tile[data-on="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.tile[data-disabled="true"] { opacity: .4; cursor: not-allowed; filter: grayscale(.4); }
.tile[data-disabled="true"]:hover { border-color: var(--line); box-shadow: none; }
.tile .swatch { aspect-ratio: 1.55 / 1; width: 100%; display: block; }
.tile .tlabel { padding: 10px 12px 12px; font-size: 13px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tile .tlabel small { color: var(--ink-soft); font-weight: 400; }
.tile .tcheck {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  opacity: 0; transform: scale(.7); transition: all .16s;
}
.tile[data-on="true"] .tcheck { opacity: 1; transform: scale(1); }

/* ---------- info tooltip ---------- */
.infodot {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  border: 1.4px solid var(--ink-soft); color: var(--ink-soft);
  font-family: var(--display); font-style: italic; font-weight: 600; font-size: 11px;
  cursor: help; flex: none; transition: all .15s; line-height: 1;
}
.infodot:hover { border-color: var(--gold-2); color: var(--gold-2); background: var(--gold-soft); }

/* ---------- inputs ---------- */
.field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); margin-bottom: 7px; letter-spacing: .01em; }
.input {
  width: 100%; font-family: var(--body); font-size: 15px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21,18,13,.06); }
.input.ok { border-color: var(--good); }
.input.err { border-color: #c0492f; }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--line); border: 0; }
.fade-in { animation: fadeIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes foilShift { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--display);
  font-size: 11.5px; font-weight: 500; letter-spacing: .04em; padding: 5px 11px;
  border-radius: var(--r-pill); background: var(--paper-2); color: var(--ink-2);
}
.tag.gold { background: var(--gold-soft); color: var(--gold-2); }
.tag.good { background: var(--good-soft); color: var(--good); }

/* hairline grid lines used as brand motif */
.hairline { background: var(--line); }

/* progress stepper shown inline above the calculator — never break page width */
.stepper-inline { max-width: 100%; overflow-x: auto; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #d8d0c2; border-radius: 99px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #c5bdac; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .stepper-wrap { display: none !important; }
  .mainnav { display: none !important; }
}
@media (max-width: 960px) {
  .calc-grid, .cfg-grid, .form-grid, .sum-grid, .foot-grid, .proc-grid,
  .fin-makieta, .info-cols { grid-template-columns: 1fr !important; }
  /* hero: show the rotatable card ABOVE the copy on mobile */
  .hero-card { order: -1; margin-bottom: 0; }
  .hero-copy { text-align: left; }
  .hero-sec { padding-top: 16px !important; padding-bottom: 32px !important; gap: 14px !important; }
  .hero-sec .eyebrow { margin-top: 2px; }
  .cfg-grid > div:first-child { position: static !important; }
  .form-grid > div:last-child { position: static !important; }
  [style*="position: sticky"] { position: static !important; }
  section[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .finish-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .realizacje-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .steps-tiles { grid-template-columns: repeat(2, 1fr) !important; }
  h1 { font-size: 42px !important; }
}
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .stepper-inline { display: none !important; }
  .stepper-wrap { display: none !important; }
  .calc-cta-row { flex-direction: column; align-items: flex-start !important; }
  .calc-cta-row .btn { width: 100%; justify-content: center; }
  .wrap { padding-left: 18px !important; padding-right: 18px !important; }
  /* every multi-column grid collapses to a single column */
  .finish-grid, .proc-grid, .steps-row, .steps-tiles, .realizacje-grid,
  .fmt-row, .sw-grid, .brand-sec { grid-template-columns: 1fr !important; }
  /* generic: any inline 2/3/4-col grid stacks */
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1.6fr 1fr"],
  [style*="grid-template-columns: 1.5fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr 1fr"],
  [style*="grid-template-columns: 0.7fr"] { grid-template-columns: 1fr !important; }
  /* option tiles (folia / uszlachetnienia / format / rogi) stay 2-up */
  .opt-grid { grid-template-columns: 1fr 1fr !important; }
  /* price table: nakład left, price stacked on the right above per-piece */
  .price-head { display: none !important; }
  .price-row { grid-template-columns: 1fr auto !important; row-gap: 2px !important; }
  .price-row > span:first-child { grid-row: 1 / span 2; align-self: center; }
  .price-row > span:nth-child(2) { text-align: right; }
  .price-row > span:nth-child(3) { text-align: right !important; }
  h1 { font-size: 32px !important; line-height: 1.05 !important; }
  h2 { font-size: 25px !important; }
  /* shrink the 3D card so it never overflows */
  .card3d { max-width: 100%; }
  /* fixed-bottom action bars: stack + wrap */
  .navbar-inner { flex-wrap: wrap !important; gap: 12px !important; padding: 12px 18px !important; }
  .navbar-inner .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .finish-grid { grid-template-columns: 1fr 1fr !important; }
  h1 { font-size: 28px !important; }
}

/* ---------- print (summary as PDF) ---------- */
@media print {
  header, .infodot, button.btn { display: none !important; }
  body { background: #fff; }
  .surface { box-shadow: none; }
}
