:root {
  --bg: #fbf9f6;
  --bg-soft: #f0ebe7;
  --bg-deep: #dedad1;
  --ink: #0a0a0a;
  --muted: #5e5e5e;
  --line: #ccc6ba;
  --accent: #ecd882;
  --lime: #e6fbb9;
  --sage-soft: #eaeee0;
  --sky-soft: #e3e9f1;
  --rose-soft: #f2e6e6;
  --radius: 20px;
  --measure: 68rem;
  --narrow: 65ch;
  --gutter: max(1.25rem, (100% - var(--measure)) / 2);
  --font-display: "Onest", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 400 1.0625rem/1.55 var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }

section, header, footer, main {
  padding-inline: var(--gutter);
}

section {
  padding-block: clamp(3.5rem, 8vw, 6rem);

  &:nth-of-type(even) { background: var(--bg-soft); }

  & > h2 {
    margin-bottom: 2rem;
    max-width: 28ch;
  }
}

/* Components */

@keyframes topbar-compact {
  to {
    padding-block: 0.5rem;
    box-shadow: 0 1px 12px rgb(0 0 0 / 0.08);
  }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 1.25rem;

  & a {
    text-decoration: none;
    font-weight: 600;
  }

  & > a {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.6rem;
    align-items: center;
    line-height: 1.25;

    & strong, & span { grid-column: 2; }

    & span {
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--muted);
    }

    & img {
      grid-row: 1 / 3;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      object-fit: cover;
      object-position: 62% 24%;
    }
  }

  & div {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  & .phone, & .viber { min-width: 10rem; }

  & div a:first-child {
    margin-right: 0.5rem;
    font-size: 0.8rem;
    color: #8a857c;
    text-decoration: none;
    text-underline-offset: 0.2em;
    text-decoration-color: var(--line);

    &:hover { color: var(--muted); text-decoration: underline; }
  }

  @media (width > 760px) {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg);
    box-shadow: 0 1px 12px rgb(0 0 0 / 0.08);

    @supports (animation-timeline: scroll()) {
      box-shadow: none;
      animation: topbar-compact linear both;
      animation-timeline: scroll();
      animation-range: 0 80px;
    }
  }

  @media (width <= 760px) {
    & .phone, & .viber { display: none; }
  }
}

.phone, .viber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

/* Viber brand purple */
.viber { background: #7360f2; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: 2rem;

  & h1 { margin-bottom: 1.25rem; }

  & > div > p {
    font-size: 1.25rem;
    color: var(--muted);
    max-width: 48ch;
    margin-bottom: 2rem;
  }

  & .partner { margin-top: 1rem; }

  & img {
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius) * 1.5);
    object-fit: cover;
  }

  @media (width <= 760px) {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 1rem;

    & h1 { font-size: 2rem; }

    & > div > p {
      font-size: 1.125rem;
      margin-bottom: 1.5rem;
    }

    & img {
      max-height: 40vh;
      aspect-ratio: 4 / 3;
      object-position: 50% 20%;
    }
  }
}

.partner {
  font-size: 0.9rem;
  color: var(--muted);

  & a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }
}

.lead-form {
  display: grid;
  gap: 0.875rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 34rem;

  & label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
  }

  & input, & select {
    font: inherit;
    font-size: 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--ink);

    &:focus-visible {
      outline: 2px solid var(--ink);
      outline-offset: 1px;
    }

    &:user-invalid { border-color: #c0392b; }
  }

  & button {
    font: inherit;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--ink);
    cursor: pointer;
    margin-top: 0.25rem;

    &:hover { filter: brightness(0.96); }
    &:disabled { opacity: 0.6; cursor: progress; }
  }

  & nav {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.95rem;

    @media (width <= 760px) {
      grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));

      & span { grid-column: 1 / -1; text-align: center; }
    }
  }

  & small {
    text-align: center;
    text-wrap: balance;
    color: var(--muted);
  }
}

.banks {
  padding-block: 2.5rem;

  & h2 {
    font: 500 0.85rem/1 var(--font-body);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.5rem;
    max-width: none;
  }

  & ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1.5rem 2rem;
    align-items: center;
  }

  & img { width: 100%; height: auto; }

  @media (width <= 900px) {
    & ul { grid-template-columns: repeat(4, 1fr); }
  }
}

.testimonials {
  & ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.25rem;
    max-width: var(--narrow);
    margin-inline: auto;
  }

  & blockquote {
    margin: 0;
    display: grid;
    gap: 1.25rem;
    padding: 1.75rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  & p {
    font-style: italic;

    &::before { content: "„"; }
    &::after { content: "“"; }
  }

  & footer {
    display: grid;
    gap: 0.2rem;
    padding: 0;
    font-size: 0.9rem;
    color: var(--muted);

    & b { color: var(--ink); font-weight: 600; }
  }

  & li:nth-child(1) blockquote { background: var(--sage-soft); }
  & li:nth-child(2) blockquote { background: var(--sky-soft); }
  & li:nth-child(3) blockquote { background: var(--rose-soft); }
}

.steps {
  & ol {
    list-style: none;
    counter-reset: step;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
    max-width: var(--narrow);
    margin-inline: auto;
  }

  & li {
    counter-increment: step;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);

    &::before {
      content: "0" counter(step);
      grid-row: span 2;
      align-self: start;
      display: grid;
      place-items: center;
      width: 2.75rem;
      aspect-ratio: 1;
      font-family: var(--font-display);
      font-weight: 700;
      border-radius: 50%;
      background: var(--accent);
    }
  }

  & p { color: var(--muted); }
}

.testimonials, .steps, .why, .faq {
  & > h2 {
    text-align: center;
    margin-inline: auto;
  }
}

.why {
  & ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1rem;
    max-width: var(--narrow);
    margin-inline: auto;
  }

  & li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.875rem;
    font-size: 1.125rem;

    &::before {
      content: "✓";
      display: grid;
      place-items: center;
      width: 1.75rem;
      height: 1.75rem;
      border-radius: 50%;
      background: var(--lime);
      font-size: 0.9rem;
      font-weight: 700;
    }
  }
}

.faq {
  & details {
    border-top: 1px solid var(--line);
    max-width: var(--narrow);
    margin-inline: auto;

    &:last-child { border-bottom: 1px solid var(--line); }
  }

  & summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.125rem;

    &::-webkit-details-marker { display: none; }

    &::after {
      content: "+";
      font-weight: 400;
      font-size: 1.5rem;
      line-height: 1;
      color: var(--muted);
    }
  }

  & details[open] summary::after { content: "–"; }

  & p {
    padding-bottom: 1.25rem;
    color: var(--muted);
    max-width: 60ch;
  }
}

.cta {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1rem;

  & > h2 { margin-bottom: 0; }

  & > p {
    color: var(--muted);
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }

  & form {
    width: 100%;
    text-align: left;
  }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;

  & strong { color: var(--ink); }
  & .phone { padding: 0; background: none; color: inherit; font-weight: 500; }
  & .partner { flex-basis: 100%; }

  @media (width <= 760px) {
    padding-bottom: 5rem;
  }
}

.callbar {
  display: none;

  @media (width <= 760px) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    position: fixed;
    inset: auto 0 0 0;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);

    & a { padding-inline: 0.5rem; }
  }
}

.thanks {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 1.25rem;
  padding: 4rem max(1.25rem, (100% - 44rem) / 2);

  & > p { font-size: 1.125rem; color: var(--muted); }
  & h2 { font-size: 1.25rem; margin-top: 1rem; }
  & ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; }
  & a { margin-top: 1rem; font-weight: 500; }
}
