/* Aptaujas izskats: Elektroniskie sakari zīmola krāsas (esakari.lv), bez ārējiem fontiem un skriptiem. */
:root {
  color-scheme: light;
  --brand: #981e33;        /* bordo */
  --brand-2: #bb3031;      /* sarkans */
  --brand-dark: #7e1526;
  --brand-soft: #f8e9ec;
  --steel: #8496a0;        /* logo pelēkais */
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1f2429;
  --muted: #5d6870;
  --line: #e1e4e7;
  --ok: #1f8a5b;
  --error: #b42318;
  --error-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .05), 0 8px 24px rgba(20, 24, 28, .06);
  --ease: cubic-bezier(.22, .9, .32, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; overflow-x: hidden;
  font: 16px/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; position: relative; }

/* ---- fons: lēni izplūstoši radioviļņi (uzņēmuma tēma) ---- */
.bg-waves { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-waves span {
  position: absolute; right: -180px; top: -180px; width: 520px; height: 520px; border-radius: 50%;
  border: 2px solid var(--brand); opacity: 0; animation: wave 9s var(--ease) infinite;
}
.bg-waves span:nth-child(2) { animation-delay: 3s; }
.bg-waves span:nth-child(3) { animation-delay: 6s; }
@keyframes wave { 0% { transform: scale(.2); opacity: .16; } 100% { transform: scale(2.2); opacity: 0; } }
header, main, footer { position: relative; z-index: 1; }

/* ---- galvene ---- */
.top { background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; justify-content: space-between; align-items: center; min-height: 68px; }
.logo { height: 56px; width: auto; display: block; }
.lang {
  color: var(--brand); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 7px 14px;
  border: 1.5px solid var(--brand); border-radius: 999px; transition: background .2s, color .2s, transform .2s var(--ease);
}
.lang:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
main { padding-bottom: 40px; }
.foot { color: var(--muted); font-size: .82rem; text-align: center; padding: 8px 16px 32px; }

/* ---- ievads ---- */
.hero {
  position: relative; overflow: hidden; margin: 24px 0 18px; padding: 30px 26px 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #7e1526 0%, #981e33 45%, #bb3031 100%);
  box-shadow: 0 18px 40px -18px rgba(152, 30, 51, .55);
  animation: rise .7s var(--ease) both;
}
.hero-rings { position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; pointer-events: none; }
.hero-rings i {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35);
  animation: ring 4.5s ease-out infinite;
}
.hero-rings i:nth-child(2) { animation-delay: 1.5s; }
.hero-rings i:nth-child(3) { animation-delay: 3s; }
@keyframes ring { 0% { transform: scale(.15); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; opacity: .85; }
.hero h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 14px; max-width: 30ch; }
.hero .lead { color: rgba(255, 255, 255, .93); margin: 14px 0 0; font-size: 1rem; max-width: 62ch; position: relative; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px;
  padding: 4px 12px; font-size: .85rem; font-weight: 600; animation: pop .5s var(--ease) both;
}
.chips li:nth-child(2) { animation-delay: .08s; } .chips li:nth-child(3) { animation-delay: .16s; }
.privacy { margin-top: 16px; position: relative; }
.privacy summary { cursor: pointer; font-weight: 600; font-size: .92rem; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary::before { content: "›"; display: inline-block; transition: transform .25s var(--ease); font-size: 1.2rem; line-height: 1; }
.privacy[open] summary::before { transform: rotate(90deg); }
.privacy p { background: rgba(0, 0, 0, .16); border-radius: 10px; padding: 12px 14px; margin: 10px 0 0; font-size: .9rem; animation: rise .35s var(--ease) both; }

.banner { background: #fff6dd; color: #6b4e00; border-radius: 12px; padding: 12px 16px; margin: 16px 0; animation: rise .4s var(--ease) both; }
.banner-error { background: var(--error-soft); color: var(--error); font-weight: 600; }
.banner-preview { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- progress ---- */
.progress {
  position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 12px 16px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
}
.progress-track { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0; border-radius: 99px; transition: width .6s var(--ease);
  background: linear-gradient(90deg, var(--brand), var(--brand-2), #e0566b, var(--brand));
  background-size: 300% 100%; animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: -300% 0; } }
.progress-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px; font-weight: 600; }
.progress-pct { color: var(--brand); font-variant-numeric: tabular-nums; }
.dots { list-style: none; display: flex; justify-content: space-between; gap: 4px; padding: 0; margin: 8px 0 0; }
.dots li {
  flex: 1; text-align: center; font-size: .95rem; padding: 3px 0; border-radius: 8px; filter: grayscale(1); opacity: .45;
  transition: filter .3s, opacity .3s, transform .3s var(--ease), background .3s;
}
.dots li.done { filter: none; opacity: .8; }
.dots li.on { filter: none; opacity: 1; transform: scale(1.18); background: var(--brand-soft); }

/* ---- sadaļas un pārejas ---- */
.step { background: var(--card); border-radius: var(--radius); padding: 22px 20px 18px; margin: 14px 0; box-shadow: var(--shadow); }
.step.enter-next { animation: in-right .45s var(--ease) both; }
.step.enter-back { animation: in-left .45s var(--ease) both; }
@keyframes in-right { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes in-left { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.step-icon {
  width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem;
  background: var(--brand-soft); animation: pop .6s var(--ease) both, float 4s ease-in-out .6s infinite;
}
@keyframes float { 50% { transform: translateY(-4px) rotate(-4deg); } }
.step-no { color: var(--brand); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
h2 { font-size: 1.3rem; margin: 2px 0 0; outline: none; line-height: 1.25; }

/* ---- jautājumi ---- */
.q {
  border: 0; margin: 0 0 8px; padding: 16px 14px 18px; border-radius: 12px; min-width: 0; position: relative;
  transition: background .3s;
}
.step:not([hidden]) .q { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 80ms); }
.q + .q { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.q legend { font-weight: 650; font-size: 1.02rem; padding: 0; margin-bottom: 12px; display: block; position: relative; padding-left: 30px; }
.tick {
  position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line);
  transition: background .25s, border-color .25s, transform .3s var(--ease);
}
.tick::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff;
  border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .3s var(--ease) .05s;
}
.answered .tick { background: var(--ok); border-color: var(--ok); transform: scale(1.1); }
.answered .tick::after { transform: rotate(45deg) scale(1); }
.q .opt { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: .88rem; }
.help, .sub-intro { color: var(--muted); font-size: .9rem; margin: -6px 0 12px 30px; }
.sub-intro { font-weight: 650; color: var(--ink); margin: 0 0 6px 14px; }
.has-error legend { color: var(--error); }
.has-error .tick { border-color: var(--error); }
.q.shake { animation: shake .45s ease both !important; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.err { color: var(--error); font-size: .88rem; margin: 10px 0 0; font-weight: 600; animation: rise .3s var(--ease) both; }

/* Likerta un labumu skala */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.opt-pill, .enps-cell, .choice { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.opt-pill input, .enps-cell input, .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-pill span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  min-height: 72px; padding: 8px 4px; border: 1.5px solid var(--line); border-radius: 12px; font-size: .76rem;
  color: var(--muted); background: var(--card); line-height: 1.25;
  transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s, box-shadow .2s;
}
.opt-pill b { font-size: 1.15rem; color: var(--ink); transition: color .2s; }
.opt-na { grid-column: 1 / -1; }
.opt-na span { min-height: 42px; flex-direction: row; }
.opt-pill:hover span, .enps-cell:hover span, .choice:hover span {
  border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 6px 14px -8px rgba(152, 30, 51, .5);
}
.opt-pill input:checked + span, .enps-cell input:checked + span, .choice input:checked + span {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -8px rgba(152, 30, 51, .7); animation: select .35s var(--ease);
}
.opt-pill input:checked + span b { color: #fff; }
@keyframes select { 0% { transform: scale(.92); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.opt-pill input:focus-visible + span, .enps-cell input:focus-visible + span, .choice input:focus-visible + span {
  outline: 3px solid var(--steel); outline-offset: 2px;
}

/* eNPS 0–10 */
.enps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; }
.enps-cell span {
  display: flex; align-items: center; justify-content: center; height: 48px; border: 1.5px solid var(--line);
  border-radius: 10px; font-weight: 700; background: var(--card);
  transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s, box-shadow .2s;
}
.enps-ends { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 8px; gap: 12px; }

/* izvēles un prioritātes */
.choices { display: grid; gap: 8px; }
.choice span {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s, box-shadow .2s;
}
.choice span::before {
  content: ""; width: 18px; height: 18px; flex: none; border: 2px solid var(--steel); border-radius: 50%;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.q-multi .choice span::before { border-radius: 5px; }
.choice input:checked + span::before { border-color: #fff; background: #fff; box-shadow: inset 0 0 0 3px var(--brand); }
.choice input:disabled + span { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); min-height: 110px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.counter { font-size: .78rem; color: var(--muted); margin: 6px 0 0; min-height: 1em; text-align: right; }

/* navigācija */
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.nav .btn:only-child { margin-left: auto; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 13px 28px; border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 10px 22px -10px rgba(152, 30, 51, .8); transition: transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -10px rgba(152, 30, 51, .9); }
.btn:active { transform: translateY(0) scale(.98); }
.js-next::after { content: " →"; display: inline-block; transition: transform .2s var(--ease); }
.js-next:hover::after { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--brand), 0 8px 18px -12px rgba(152, 30, 51, .8); }
.btn-primary { background: linear-gradient(135deg, #1f8a5b, #2aa36f); box-shadow: 0 10px 22px -10px rgba(31, 138, 91, .8); }
.btn-primary:not(:disabled) { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 10px 30px -6px rgba(31, 138, 91, .9); } }
.btn:disabled { opacity: .7; cursor: wait; }
.btn.loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- paldies / slēgta ---- */
.card {
  background: var(--card); border-radius: 20px; padding: 40px 24px; margin-top: 36px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; animation: rise .6s var(--ease) both;
}
.center { text-align: center; }
.card h1 { font-size: 1.8rem; margin: 10px 0; }
.card .lead { font-size: 1.05rem; max-width: 46ch; margin: 0 auto 10px; }
.check { width: 92px; height: 92px; display: block; margin: 0 auto; }
.check circle { fill: none; stroke: var(--ok); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s var(--ease) .2s forwards; }
.check path { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s var(--ease) .8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks h1 { animation: rise .5s var(--ease) 1s both; }
.thanks p { animation: rise .5s var(--ease) 1.15s both; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; left: calc(var(--x) * 1%); width: 9px; height: 14px; border-radius: 2px;
  background: var(--brand); transform: rotate(var(--r)); opacity: 0;
  animation: fall 2.8s cubic-bezier(.3, .6, .5, 1) calc(var(--d) * 90ms + 900ms) forwards;
}
.confetti i:nth-child(3n) { background: var(--brand-2); width: 7px; height: 7px; border-radius: 50%; }
.confetti i:nth-child(3n+1) { background: var(--steel); }
.confetti i:nth-child(4n) { background: #1f8a5b; }
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(var(--r)); }
  100% { opacity: 0; transform: translateY(105vh) translateX(40px) rotate(calc(var(--r) + 540deg)); }
}
.closed .hero-rings { position: absolute; left: 50%; top: 30px; right: auto; bottom: auto; width: 140px; height: 140px; margin-left: -70px; }
.closed .hero-rings i { border-color: var(--brand); }
.big-icon { font-size: 2.6rem; margin: 18px 0 30px; position: relative; }

@media (max-width: 560px) {
  .hero { padding: 24px 18px 20px; border-radius: 16px; }
  .hero h1 { font-size: 1.4rem; }
  .logo { height: 40px; }
  .step { padding: 18px 12px 14px; }
  .q { padding: 14px 6px 16px; }
  .scale { grid-template-columns: 1fr; gap: 6px; }
  .opt-pill span { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 10px 14px; font-size: .92rem; text-align: left; }
  .enps { grid-template-columns: repeat(6, 1fr); }
  .help, .sub-intro { margin-left: 0; }
  .btn { padding: 12px 22px; }
}

/* Cieņa pret lietotājiem, kas izvēlējušies mazāk kustību */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .check circle, .check path { stroke-dashoffset: 0; }
  .confetti { display: none; }
}

/* struktūrvienības izvēlne */
.select-wrap { position: relative; }
.select-wrap::after { content: "▾"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--brand); pointer-events: none; font-size: 1.1rem; }
.select-wrap select {
  width: 100%; appearance: none; -webkit-appearance: none; font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 44px 13px 16px; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.select-wrap select:hover { border-color: var(--brand); }
.select-wrap select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
