/* Скан-Право — крем / нежно-синий / чёрный, стилистика Apple/Claude */

:root {
  --bg: #F7F3EB;
  --surface: #FFFFFF;
  --ink: #16181D;
  --muted: #8A8F98;
  --accent: #6C8FD8;
  --accent-deep: #4F74C4;
  --accent-soft: #E8EFFA;
  --ok: #3FA268;
  --ok-soft: #E6F4EC;
  --danger: #C85A5A;
  --line: rgba(22, 24, 29, 0.08);
  --shadow: 0 1px 2px rgba(22,24,29,.04), 0 8px 24px rgba(22,24,29,.06);
  --tabbar-h: 62px;
}
:root[data-theme="dark"] {
  --bg: #101216;
  --surface: #1A1D24;
  --ink: #F2EFE7;
  --muted: #9BA1AB;
  --accent: #8FAEE8;
  --accent-deep: #6C8FD8;
  --accent-soft: #232B3C;
  --ok-soft: #1D2E24;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

#app {
  max-width: 480px; margin: 0 auto;
  padding: 12px 18px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
}
.tab, .screen { animation: fadeUp .35s ease both; }
.tab.hidden, .screen.hidden, .hidden { display: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.muted { color: var(--muted); }

/* ---------- заставка при входе (~3 сек) ---------- */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .6s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-mascot {
  width: 168px; height: 168px; border-radius: 50%;
  box-shadow: var(--shadow);
  animation: splashPop .9s cubic-bezier(.34, 1.56, .64, 1) both,
             floaty 3s ease-in-out .9s infinite;
}
@keyframes splashPop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.splash-title {
  font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin-top: 20px;
  animation: fadeUp .6s ease .5s both;
}
.splash-sub {
  color: var(--muted); font-size: 15px; text-align: center; margin-top: 8px; line-height: 1.45;
  animation: fadeUp .6s ease .8s both;
}
.splash-dots { display: flex; gap: 7px; margin-top: 28px; animation: fadeUp .5s ease 1.1s both; }
.splash-dots span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: .2s; }
.splash-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse { 0%,100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---------- нижние вкладки ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  max-width: 480px; margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(12px);
}
.tabbar button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 600;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: color .2s ease, transform .15s ease;
}
.tabbar button span { font-size: 21px; }
.tabbar button.active { color: var(--accent-deep); }
.tabbar button:active { transform: scale(.92); }
body.overlay-open .tabbar { display: none; }

/* ---------- герой ---------- */
.hero { text-align: center; padding: 22px 0 6px; }
.mascot {
  width: 132px; height: 132px; border-radius: 50%;
  box-shadow: var(--shadow);
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; }
.tagline { color: var(--muted); font-size: 15px; margin: 8px 0 18px; letter-spacing: -0.01em; }

/* ---------- кнопки ---------- */
.btn-primary {
  display: block; width: 100%; border: 0; cursor: pointer;
  border-radius: 16px; padding: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; font-family: inherit;
  box-shadow: 0 6px 20px rgba(108,143,216,.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:active { transform: scale(.98); box-shadow: 0 3px 10px rgba(108,143,216,.3); }
.btn-ghost {
  display: block; width: 100%; border: 1px solid var(--line); cursor: pointer;
  border-radius: 16px; padding: 13px; background: var(--surface);
  color: var(--ink); font-size: 15px; font-weight: 550; font-family: inherit;
}
.btn-ghost:active { opacity: .7; }
.row-2 { display: flex; gap: 10px; margin-top: 10px; }
.row-2 > * { flex: 1; }
.btn-qr {
  display: block; width: 100%; margin-top: 10px; cursor: pointer;
  border: 1px dashed var(--accent); border-radius: 16px; padding: 13px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 15px; font-weight: 600; font-family: inherit;
}
.btn-qr:active { opacity: .75; }
.free-note {
  margin-top: 12px; background: var(--ok-soft); color: var(--ink);
  border-radius: 14px; padding: 11px 14px; font-size: 13px; line-height: 1.45; text-align: left;
}
.free-note b { color: var(--ok); }

/* ---------- выбор файлов ---------- */
.picker {
  background: var(--surface); border-radius: 18px; padding: 14px 16px; margin-top: 14px;
  box-shadow: var(--shadow); animation: fadeUp .3s ease both;
}
.picker-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.picker-head b { font-size: 15px; }
.picker-head span { color: var(--muted); font-size: 12px; }
.picker-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 10px; padding: 7px 10px; font-size: 12.5px; font-weight: 600;
  animation: fadeUp .25s ease both;
}
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; padding: 0; }
.picker .btn-primary { margin-top: 10px; }
.picker-hint { color: var(--muted); font-size: 12px; margin-top: 10px; text-align: center; }

/* ---------- статистика ---------- */
.stats { display: flex; gap: 8px; margin: 22px 0 6px; }
.stat {
  flex: 1; background: var(--surface); border-radius: 16px; padding: 12px 10px;
  text-align: center; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 18px; letter-spacing: -0.02em; color: var(--accent-deep); }
.stat span { font-size: 11px; color: var(--muted); line-height: 1.3; display: block; margin-top: 3px; }

/* ---------- секции ---------- */
.sect { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; margin: 26px 0 12px; }
.sect-sub { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 18px; }
.page-sub { color: var(--muted); margin: 6px 0 20px; }

/* ---------- карусель сценариев ---------- */
.carousel {
  display: flex; gap: 12px; overflow-x: auto; padding: 8px 18px 16px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  margin: 0 -18px;
}
.carousel::-webkit-scrollbar { display: none; }
.scene-card {
  flex: 0 0 244px; scroll-snap-align: start; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 0; overflow: hidden; text-align: left; font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow);
  animation: cardFloat 7s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -1.2s);
  transition: transform .15s ease;
}
@keyframes cardFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.scene-card:active { transform: scale(.97); animation-play-state: paused; }
.scene-card .img-wrap { display: block; height: 152px; overflow: hidden; }
.scene-card img {
  width: 100%; height: 152px; object-fit: cover; display: block; background: #FAF7E8;
  animation: kenburns 14s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -2.3s);
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translateX(-6px); } }
.sc-body { display: block; padding: 12px 14px 14px; }
.sc-body b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.sc-body span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 4px; min-height: 50px; }
.sc-body i { display: block; font-style: normal; font-size: 13px; font-weight: 650; color: var(--accent-deep); margin-top: 8px; }

/* ---------- карточка-ссылка ---------- */
.card-link {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px;
  background: var(--accent-soft); border: 0; border-radius: 18px; padding: 14px 16px;
  cursor: pointer; font-family: inherit; color: var(--ink); text-align: left;
}
.card-link:active { opacity: .8; }
.t-ico { font-size: 26px; }
.cl-text b { display: block; font-size: 15px; font-weight: 650; }
.cl-text span { font-size: 12px; color: var(--muted); }
.chev { margin-left: auto; font-size: 22px; color: var(--muted); }

/* ---------- как это работает ---------- */
.steps-how { list-style: none; counter-reset: n; }
.steps-how li { counter-increment: n; position: relative; padding: 0 0 18px 46px; }
.steps-how li::before {
  content: counter(n);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.steps-how li:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px;
  width: 2px; background: var(--line);
}
.steps-how b { display: block; font-size: 15px; letter-spacing: -0.01em; }
.steps-how span { font-size: 13px; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { background: var(--surface); border-radius: 16px; margin-bottom: 8px; box-shadow: var(--shadow); overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 16px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "＋"; color: var(--accent-deep); font-size: 17px;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
.faq.expanded summary::after { transform: rotate(135deg); }
.faq .faq-wrap { height: 0; overflow: hidden; transition: height .4s cubic-bezier(.4, 0, .2, 1); }
.faq p { padding: 0 16px 14px; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- история ---------- */
.history-item {
  background: var(--surface); border: 0; width: 100%; text-align: left; font-family: inherit; color: var(--ink);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; font-size: 14px;
  box-shadow: var(--shadow); transition: transform .12s ease;
}
.history-item:active { transform: scale(.98); }
.history-item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.history-item .refund { color: var(--ok); font-weight: 650; white-space: nowrap; margin-left: 10px; }
.badge { font-size: 11px; font-weight: 700; border-radius: 7px; padding: 2px 8px; margin-left: 8px; }
.badge.pending { background: #FFF3D6; color: #B07D18; }
.badge.error { background: #FBE9E9; color: var(--danger); }
.badge.clean { background: var(--ok-soft); color: var(--ok); }
.empty { text-align: center; padding: 30px 10px; }
.empty-img { width: 180px; border-radius: 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.empty p { color: var(--muted); margin-bottom: 16px; }

/* ---------- профиль ---------- */
.user-card { display: flex; align-items: center; gap: 14px; }
.user-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.segmented {
  display: flex; background: var(--surface); border-radius: 14px; padding: 4px;
  box-shadow: var(--shadow);
}
.segmented button {
  flex: 1; border: 0; border-radius: 11px; padding: 10px 6px; cursor: pointer;
  background: transparent; color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 600;
  transition: all .25s ease;
}
.segmented button.active { background: var(--accent-soft); color: var(--accent-deep); }
.link-card {
  display: flex; align-items: center; width: 100%; text-decoration: none; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink); border: 0; text-align: left;
}
.link-card:active { opacity: .7; }
.about-card { display: flex; gap: 12px; align-items: flex-start; }
.about-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.support-mascot { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }

/* ---------- калькулятор ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field i { color: var(--muted); font-weight: 400; font-style: normal; }
.field input {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  padding: 14px; font-size: 18px; font-family: inherit; outline: none;
}
.field input:focus { border-color: var(--accent); }
.kb-done {
  display: block; width: 100%; border: 0; cursor: pointer; margin-bottom: 12px;
  border-radius: 12px; padding: 11px; background: var(--accent-soft);
  color: var(--accent-deep); font-size: 14px; font-weight: 650; font-family: inherit;
}
.calc-out { background: var(--surface); border-radius: 18px; padding: 6px 16px; margin: 6px 0 16px; box-shadow: var(--shadow); }
.calc-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.calc-row i { color: var(--muted); font-style: normal; font-size: 12px; }
.calc-total { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0 11px; font-size: 15px; font-weight: 700; }
.calc-total b { color: var(--accent-deep); font-size: 20px; letter-spacing: -0.02em; }
.calc-note { color: var(--muted); font-size: 12px; padding-bottom: 12px; }
#calc-upload { margin-top: 4px; margin-bottom: 10px; }

/* ---------- прогресс ---------- */
#screen-progress { text-align: center; padding-top: 16px; }
.progress-art {
  width: 100%; max-width: 320px; border-radius: 22px; box-shadow: var(--shadow);
  animation: floaty 5s ease-in-out infinite;
}
.steps { list-style: none; text-align: left; max-width: 320px; margin: 24px auto 0; }
.steps li {
  position: relative; padding: 9px 0 9px 34px; color: var(--muted); font-size: 15px;
  transition: color .3s ease;
}
.steps li::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line);
  transition: all .3s ease;
}
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active::before {
  border-color: var(--accent); border-top-color: transparent;
  animation: spin .8s linear infinite;
}
.steps li.done { color: var(--ink); }
.steps li.done::before {
  border-color: var(--ok); background: var(--ok);
  content: "✓"; color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: none;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }
.fact-card {
  background: var(--accent-soft); border-radius: 18px; padding: 14px 18px;
  max-width: 320px; margin: 22px auto 0; text-align: left;
}
.fact-label {
  font-size: 11px; font-weight: 700; color: var(--accent-deep);
  text-transform: uppercase; letter-spacing: .06em;
}
#fact-text { font-size: 14px; margin-top: 5px; line-height: 1.45; transition: opacity .4s ease; }
.progress-note { color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------- результат ---------- */
.card { background: var(--surface); border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.doc-card { margin-top: 18px; }
.doc-card .doc-type { font-weight: 750; font-size: 17px; letter-spacing: -0.01em; }
.doc-card .doc-meta { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.45; }

.clean-banner {
  background: var(--ok-soft); border-radius: 20px; padding: 24px 20px; text-align: center;
  margin-top: 18px; animation: fadeUp .4s ease both;
}
.clean-ico { font-size: 42px; margin-bottom: 8px; }
.clean-banner b { font-size: 19px; letter-spacing: -0.01em; }
.clean-banner p { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

.refund-banner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff; border-radius: 18px; padding: 18px; text-align: center; margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(108,143,216,.35);
}
.refund-banner .amount { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.refund-banner .label { font-size: 12px; opacity: .9; margin-top: 3px; }

.violation {
  background: var(--surface); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  border-left: 3px solid var(--danger); box-shadow: var(--shadow);
  animation: fadeUp .35s ease both;
}
.violation .v-head { display: flex; justify-content: space-between; gap: 8px; }
.violation .v-title { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.violation .v-refund { color: var(--ok); font-weight: 700; white-space: nowrap; }
.violation .v-desc { font-size: 14px; opacity: .85; margin-top: 6px; }
.violation .v-norm {
  display: inline-block; margin-top: 8px; font-size: 12px;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 7px; padding: 3px 9px; font-weight: 550;
}
.prospects { font-size: 14px; border-left: 3px solid var(--accent); }
#btn-claim { margin-top: 4px; }

.disclaimer { font-size: 11px; color: var(--muted); text-align: center; margin-top: 20px; line-height: 1.45; }

.error-card { text-align: center; padding: 26px 20px; margin-top: 30px; }
.error-img { width: 200px; max-width: 70%; border-radius: 20px; margin-bottom: 12px; }
.error-card p { margin: 6px 0 18px; line-height: 1.5; }

.demo-badge {
  background: #E8A13C; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 7px; padding: 2px 8px; display: inline-block; margin-bottom: 8px;
}
