/* ==========================================================================
   APOYO GROUP POLAND S.A. — Stylesheet
   Structure: tokens → base → layout → components → sections → utilities
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --ink: #0f1b2d;
  --ink-soft: #33425b;
  --muted: #5f6f86;
  --line: #e2e8f1;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;

  --brand: #1d4ed8;
  --brand-dark: #1a3fb0;
  --brand-tint: #e8efff;
  --accent: #0d9488;
  --accent-bright: #2dd4bf;
  --accent-tint: #dff5f2;

  --navy: #0a1b33;
  --navy-2: #112a4d;
  --footer-bg: #07142a;

  --danger: #c62828;
  --success: #0f766e;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 2px 8px rgba(15, 27, 45, .04);
  --shadow-md: 0 14px 36px rgba(15, 27, 45, .12);

  --header-h: 72px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) { overflow: hidden; }

img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(2.15rem, 4.8vw, 3.5rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.02rem; }

:focus-visible {
  outline: 3px solid rgba(29, 78, 216, .55);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(64px, 9vw, 104px); }

.section-head { max-width: 700px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { margin-bottom: 14px; }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; }

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand);
}

/* ---------- Icons ---------- */
.icon {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 18px; height: 18px; }

.icon-wrap {
  display: inline-grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand-tint); color: var(--brand);
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.icon-wrap.sm { width: 40px; height: 40px; border-radius: 12px; }
.icon-wrap.sm .icon { width: 20px; height: 20px; }
.icon-wrap.accent { background: var(--accent-tint); color: var(--accent); }
.icon-wrap.on-dark { background: rgba(45, 212, 191, .14); color: var(--accent-bright); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px;
  font: inherit; font-weight: 600; line-height: 1.2;
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none !important;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.btn-sm { padding: 10px 18px; font-size: .92rem; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(29, 78, 216, .28); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 10px 24px rgba(29, 78, 216, .34); }

.btn-ghost { background: #fff; color: var(--ink); border-color: #cfd8e6; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }

.link-btn {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-btn:hover { color: var(--brand-dark); }
.link-btn.light { color: #b9c7de; }
.link-btn.light:hover { color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 24px rgba(15, 27, 45, .06); }

.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.15rem; letter-spacing: .08em; }
.brand-text small { font-size: .62rem; letter-spacing: .26em; color: var(--muted); font-weight: 600; }
.brand-light { color: #fff; }
.brand-light small { color: #9fb0cb; }
.logo-mark { border-radius: 10px; }

.nav ul { display: flex; list-style: none; gap: 30px; }
.nav a {
  position: relative; display: inline-block; padding: 8px 2px;
  font-weight: 500; color: var(--ink-soft); text-decoration: none;
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--brand); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch { display: inline-flex; padding: 3px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; }
.lang-btn {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 999px;
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); cursor: pointer;
  transition: background .2s, color .2s;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { background: var(--brand); color: #fff; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s, top .25s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 104px);
  background:
    radial-gradient(900px 420px at 90% -10%, var(--brand-tint), transparent 62%),
    radial-gradient(700px 360px at -10% 30%, var(--accent-tint), transparent 62%),
    #fff;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-soft); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 28px; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { width: 18px; height: 18px; color: var(--accent); stroke-width: 2.6; }

.hero-visual { position: relative; }
.hero-visual > svg { width: 100%; height: auto; filter: drop-shadow(0 24px 40px rgba(15, 27, 45, .14)); }
.float-card {
  position: absolute; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-md); font-weight: 600; font-size: .9rem;
  animation: float 6s ease-in-out infinite;
}
.float-1 { top: 6%; right: -10px; }
.float-2 { bottom: 8%; left: -10px; animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: center; }
.about-frame { position: relative; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-md); }
.about-frame > svg { width: 100%; height: auto; }
.about-badge {
  position: absolute; left: 20px; bottom: 20px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-md);
}
.about-badge small { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.about-badge strong { font-size: .98rem; }

.about-copy h2 { margin-bottom: 18px; }
.about-copy > p { color: var(--ink-soft); margin-bottom: 14px; }

.values { list-style: none; display: grid; gap: 18px; margin-top: 28px; }
.values li { display: flex; gap: 16px; align-items: flex-start; }
.values h3 { margin-bottom: 2px; }
.values p { color: var(--muted); font-size: .96rem; }

/* ---------- Services ---------- */
.services { background: var(--bg-soft); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 30px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: #cdd9ee; }
.card:hover .icon-wrap { background: var(--brand); color: #fff; transform: scale(1.06); }
.card h3 { margin-top: 6px; }
.card p { color: var(--muted); flex: 1; }

.card-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  font-weight: 600; font-size: .94rem; text-decoration: none !important;
}
.card-link .icon { transition: transform .25s var(--ease); }
.card-link:hover .icon { transform: translateX(5px); }

/* ---------- Why choose us ---------- */
.why {
  position: relative; overflow: hidden; color: #dbe6f6;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
}
.why::before {
  content: ""; position: absolute; top: -160px; right: -120px; width: 560px; height: 560px;
  background: radial-gradient(closest-side, rgba(45, 212, 191, .16), transparent);
  pointer-events: none;
}
.why .container { position: relative; }
.why h2, .why h3, .why h4 { color: #fff; }
.why .eyebrow { color: #7dd3fc; }
.why .section-head p:not(.eyebrow) { color: #b6c4dc; }

.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.benefit {
  display: flex; flex-direction: column; gap: 10px;
  padding: 28px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .3s var(--ease), background .3s, border-color .3s;
}
.benefit:hover { transform: translateY(-5px); background: rgba(255, 255, 255, .08); border-color: rgba(125, 211, 252, .45); }
.benefit h3 { margin-top: 6px; }
.benefit p { color: #b6c4dc; font-size: .96rem; }

.process-title { text-align: center; margin: 76px 0 8px; font-size: 1.5rem; }
.process { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 36px; }
.process li { position: relative; padding-top: 62px; }
.process li::before {
  content: ""; position: absolute; top: 21px; left: 56px; right: -20px; height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, .06));
}
.process li:last-child::before { display: none; }
.step-num {
  position: absolute; top: 0; left: 0;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-bright); color: #04302b; font-weight: 800; font-size: .9rem;
}
.process h4 { margin-bottom: 4px; }
.process p { color: #b6c4dc; font-size: .94rem; }

/* ---------- CTA band ---------- */
.cta-section { padding-block: 0; margin-top: -1px; }
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  margin-block: 64px 0; padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 52px);
  border-radius: 22px; color: #fff;
  background: linear-gradient(120deg, var(--brand) 0%, #2563eb 55%, #0d9488 130%);
  box-shadow: var(--shadow-md);
}
.cta-band h2 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 6px; }
.cta-band p { color: #e2ebff; }

/* ---------- Contact ---------- */
.contact { padding-top: clamp(56px, 8vw, 88px); }
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; align-items: start; }

.contact-card, .contact-form {
  padding: clamp(24px, 3.4vw, 36px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.contact-card { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; background: var(--bg-soft); }
.company-name { font-weight: 700; letter-spacing: .02em; }
.contact-list { list-style: none; display: grid; gap: 20px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list strong { display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-list address { font-style: normal; color: var(--ink); }
.contact-list a { font-weight: 600; word-break: break-word; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: .92rem; }
.req { color: var(--danger); }

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%; padding: 12px 14px;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cbd5e4; border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(29, 78, 216, .15);
}
.field.has-error input[type="text"],
.field.has-error input[type="email"],
.field.has-error textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(198, 40, 40, .1); }

.error-msg { color: var(--danger); font-size: .85rem; }
.error-msg:empty { display: none; }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400 !important; font-size: .9rem !important; color: var(--ink-soft); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.check-field.has-error .check input { outline: 2px solid var(--danger); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 16px; font-size: .95rem; }
.form-status:empty { display: none; }
.form-status.is-success { color: var(--success); background: #e7f6f3; border: 1px solid #b7e3dc; padding: 12px 16px; border-radius: var(--radius-sm); }
.form-status.is-error { color: var(--danger); background: #fdecec; border: 1px solid #f3c3c3; padding: 12px 16px; border-radius: var(--radius-sm); }
.form-status.is-info { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: #9fb0cb; padding-top: 72px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr; gap: 40px; }
.footer-brand p { margin-top: 18px; max-width: 340px; font-size: .94rem; }
.footer-title { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: 16px; }
.footer-links { list-style: none; display: grid; gap: 10px; }
.site-footer a { color: #9fb0cb; transition: color .2s; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-address { font-style: normal; font-size: .94rem; line-height: 1.8; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 56px; padding-block: 24px;
  border-top: 1px solid rgba(255, 255, 255, .1); font-size: .88rem;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s var(--ease), visibility .25s, background .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--brand-dark); }

/* ---------- Privacy dialog ---------- */
dialog {
  width: 100%; max-width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: var(--radius); overflow: hidden;
  color: var(--ink); box-shadow: 0 30px 80px rgba(7, 20, 42, .35);
}
dialog::backdrop { background: rgba(7, 20, 42, .6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.dialog-body { padding: 28px clamp(22px, 4vw, 36px) 32px; overflow-y: auto; max-height: calc(100dvh - 48px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.dialog-close {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-size: 1.5rem; line-height: 1; color: var(--ink-soft); cursor: pointer;
  transition: background .2s;
}
.dialog-close:hover { background: var(--bg-soft); }
.dialog-body h3 { margin: 22px 0 4px; font-size: 1.02rem; }
.dialog-body p { color: var(--ink-soft); font-size: .96rem; }
.dialog-body .btn { margin-top: 26px; }

/* ---------- Scroll reveal (only active when JS is available) ---------- */
.js .reveal { opacity: 0; }
.js .reveal.is-visible {
  opacity: 1;
  animation: rise .7s var(--ease) backwards;
  animation-delay: calc(var(--d, 0) * 90ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .cards, .benefits { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .header-cta { display: none; }

  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px rgba(15, 27, 45, .08);
    padding: 8px 20px 18px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { display: block; padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .nav li:last-child a { border-bottom: 0; }
  .nav a::after { display: none; }

  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 520px; margin-inline: auto; width: 100%; }
  .float-1 { right: 4px; }
  .float-2 { left: 4px; }
  .about-visual { max-width: 520px; width: 100%; margin-inline: auto; }
  .process { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
  .process li::before { display: none; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .container { padding-inline: 16px; }
  .cards, .benefits, .form-row, .footer-grid { grid-template-columns: 1fr; }
  .form-row { gap: 0; }
  .brand-text strong { font-size: 1.02rem; }
  .brand-text small { font-size: .56rem; letter-spacing: .2em; }
  .header-actions { gap: 8px; }
  .hero-cta .btn { width: 100%; }
  .cta-band { text-align: center; justify-content: center; }
  .process { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; }
}
