/* ============================================================
   metala-trepes.lv — styles
   Design tokens & layout per design handoff README
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --primary: #1348b8;        /* dark blue — buttons, links, icons */
  --accent: #2f9df4;         /* light blue — hover, kickers, highlights */
  --tint: #e7f3fd;           /* icon chips */
  --badge-bg: rgba(47, 157, 244, 0.15);
  --ink: #101725;            /* headings / body on light */
  --body: #4a5568;
  --muted: #8a97a8;
  --faint: #93a2b8;          /* on dark */
  --dark-navy: #0c1526;
  --light-section: #f4f7fb;
  --border: #e8ecf2;
  --input-border: #d7dee8;
  --success-bg: #eaf7ef;
  --success-border: #bfe5cc;
  --success-text: #1d6b3a;

  --radius-card: 18px;
  --radius-card-lg: 20px;
  --radius-tile: 14px;
  --radius-tile-lg: 16px;
  --radius-btn: 10px;
  --radius-input: 9px;
  --radius-pill: 100px;

  --container: 1200px;
  --side-pad: 24px;
  --section-pad: 88px;

  --card-hover-shadow: 0 12px 32px rgba(19, 72, 184, 0.10);
  --font: 'Archivo', sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* offset for sticky header */
}

body {
  margin: 0;
  font-family: var(--font);
  background: #ffffff;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

input, select, textarea, button { font-family: var(--font); }

::selection { background: var(--accent); color: #fff; }

img { max-width: 100%; }

h1, h2, h3, p { margin: 0; }

h2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--side-pad);
  padding-right: var(--side-pad);
}

.divider { height: 1px; background: var(--border); }

.kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-stack {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
}

.section-note {
  font-size: 15px;
  color: var(--body);
  line-height: 1.6;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  text-align: center;
  padding: 15px 28px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 16px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  min-height: 44px;
}

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 600;
}
.btn-ghost:hover { border-color: var(--accent); color: #7cc2f7; }

.btn-outline {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 12px 20px;
  font-size: 15px;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-size: 15.5px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent); color: #fff; }

.btn-block { display: block; width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.brand-mark { width: 40px; height: 40px; flex: none; }

.brand-word {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-lv { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}

.main-nav a { color: var(--ink); }
.main-nav a:hover { color: var(--primary); }

.nav-phone { display: none; } /* only shown inside mobile menu */

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-phone {
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
  white-space: nowrap;
}

/* LV/EN segmented toggle */
.lang-toggle {
  display: flex;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  overflow: hidden;
}

.lang-btn {
  border: none;
  cursor: pointer;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: var(--body);
  min-height: 32px;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn.is-active {
  background: var(--primary);
  color: #fff;
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  background: var(--dark-navy);
  overflow: hidden;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 14, 28, 0.92) 0%, rgba(8, 14, 28, 0.55) 55%, rgba(8, 14, 28, 0.15) 100%);
}

.hero-container {
  position: relative;
  width: 100%;
  padding-top: 96px;
  padding-bottom: 96px;
}

.hero-content {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  background: var(--badge-bg);
  border: 1px solid rgba(47, 157, 244, 0.4);
  color: #7cc2f7;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-title {
  font-size: 52px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  text-wrap: balance;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: #c3cede;
  max-width: 540px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   ABOUT + STATS
   ============================================================ */
.about { border-bottom: 1px solid var(--border); }

.about-grid {
  padding-top: 72px;
  padding-bottom: 72px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-text p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-tile {
  background: var(--light-section);
  border-radius: var(--radius-tile);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 14px;
  color: var(--body);
  line-height: 1.4;
}

/* ============================================================
   PRICES
   ============================================================ */
.prices { background: var(--light-section); }

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.price-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.price-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-hover-shadow);
}

.price-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--body);
}

.price-figure {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-amount {
  font-size: 40px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.price-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: #33404f;
}

.feature-list svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.price-card .btn-outline { margin-top: auto; }

/* ============================================================
   CALCULATOR
   ============================================================ */
.calculator { background: var(--dark-navy); }

.calc-grid {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}

.calc-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 100px;
}

.calc-title { color: #fff; }

.calc-note {
  font-size: 15px;
  line-height: 1.7;
  color: var(--faint);
}

/* Result panel */
.calc-result {
  margin-top: 16px;
  background: rgba(47, 157, 244, 0.08);
  border: 1px solid rgba(47, 157, 244, 0.25);
  border-radius: var(--radius-tile-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calc-result-label {
  font-size: 14px;
  font-weight: 600;
  color: #7cc2f7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calc-total {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.calc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--faint);
}

.calc-row {
  display: flex;
  justify-content: space-between;
}

.calc-row-val {
  color: #d4dce8;
  font-weight: 600;
}

.calc-disclaimer {
  font-size: 12.5px;
  color: #68788e;
  line-height: 1.5;
}

/* Form card */
.calc-card {
  background: #ffffff;
  border-radius: var(--radius-card-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.calc-fields-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.calc-fields-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.calc-card label:not(.calc-checkbox) {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: #33404f;
}

.calc-card input[type="number"],
.calc-card select {
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-input);
  padding: 11px 12px;
  font-size: 15px;
  width: 100%;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}

.calc-card input[type="number"]:focus,
.calc-card select:focus {
  border-color: var(--accent);
  outline: none;
}

.calc-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: #33404f;
  cursor: pointer;
  min-height: 44px;
}

.calc-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex: none;
}

.calc-form-note {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ============================================================
   PORTFOLIO
   ============================================================ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.portfolio-tile {
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-tile-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--card-hover-shadow);
}

.portfolio-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eef2f7;
  overflow: hidden;
}

.portfolio-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-tile:hover .portfolio-img img { transform: scale(1.05); }

.portfolio-tile figcaption {
  padding: 13px 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  border-top: 1px solid var(--border);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  background: var(--light-section);
  border-top: 1px solid var(--border);
}

.contact-grid {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.contact-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-left .section-note { line-height: 1.7; }

.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  padding: 18px 22px;
  transition: border-color 0.2s ease;
}

a.contact-card:hover { border-color: var(--accent); }

.icon-chip {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.icon-chip svg { width: 19px; height: 19px; }

.contact-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-card-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-card-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

/* Form card */
.form-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
}

.form-card h3 {
  font-size: 20px;
  font-weight: 700;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-form input,
.contact-form textarea {
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  font-size: 15px;
  width: 100%;
  color: var(--ink);
  min-height: 44px;
}

.contact-form textarea { resize: vertical; min-height: 120px; }

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.contact-form input.is-invalid,
.contact-form textarea.is-invalid { border-color: #d64545; }

.form-thanks {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 12px;
  padding: 20px;
  font-size: 15px;
  color: var(--success-text);
  line-height: 1.6;
}

/* Estimate attached from the calculator (removable) */
.calc-attachment {
  background: var(--tint);
  border: 1px solid #bcdffb;
  border-radius: var(--radius-tile);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.attach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.attach-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.attach-remove {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bcdffb;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.attach-remove:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.attach-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  margin: 0 0 12px;
}

.attach-rows dt {
  font-size: 13px;
  color: var(--body);
}

.attach-rows dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

.attach-breakdown {
  border-top: 1px solid #bcdffb;
  padding-top: 10px;
}

.attach-brow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--body);
  padding: 3px 0;
}

.attach-brow span:last-child {
  font-weight: 600;
  color: var(--ink);
}

.attach-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #bcdffb;
}

.attach-total span:first-child {
  font-weight: 700;
  color: var(--ink);
}

.attach-total span:last-child {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
}

.attach-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--body);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--dark-navy);
  color: var(--faint);
}

.footer-inner {
  padding-top: 40px;
  padding-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-mark { width: 28px; height: 28px; }

.footer-word { font-weight: 700; color: #fff; }

.footer-rights { font-size: 13.5px; }

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 13.5px;
}

.footer-links a { color: var(--faint); }
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- Tablet: ≤1024px --- */
@media (max-width: 1024px) {
  .hero-title { font-size: 44px; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .price-grid { grid-template-columns: repeat(2, 1fr); }

  .calc-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .calc-left { position: static; }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Nav collapse: ≤920px --- */
@media (max-width: 920px) {
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    /* Solid background: a nested backdrop-filter inside the header's
       backdrop-filter is unreliable in Chromium, so keep this opaque. */
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    box-shadow: 0 12px 32px rgba(19, 72, 184, 0.10);
  }

  .main-nav.is-open { display: flex; }

  .main-nav a {
    padding: 13px 4px; /* ≥44px touch targets */
    border-bottom: 1px solid var(--border);
    font-size: 16px;
  }

  .main-nav a:last-child { border-bottom: none; }

  .nav-phone {
    display: block;
    color: var(--primary);
    font-weight: 700;
  }

  .header-phone { display: none; }

  .hamburger { display: flex; }
}

/* --- Mobile: ≤680px --- */
@media (max-width: 680px) {
  :root { --section-pad: 64px; }

  html { scroll-padding-top: 80px; }

  .brand-word { font-size: 17px; }

  .hero { min-height: 560px; }

  .hero-container {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .hero-title { font-size: 36px; }

  .hero-sub { font-size: 16px; }

  .hero-ctas .btn { width: 100%; }

  h2 { font-size: 28px; }

  .about-grid {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .price-grid { grid-template-columns: 1fr; }

  .calc-card { padding: 24px 20px; }

  .calc-fields-3 { grid-template-columns: 1fr; }
  .calc-fields-2 { grid-template-columns: 1fr; }

  .calc-result { padding: 22px 20px; }
  .calc-total { font-size: 40px; }

  .portfolio-grid { grid-template-columns: 1fr; }

  .form-card { padding: 24px 20px; }

  .form-row-2 { grid-template-columns: 1fr; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* --- Small phones: keep 2-col portfolio between 480–680? no; ensure stats stack --- */
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
}
