/* Kviku KZ — Apple Wallet / Telegram Mini App Aesthetic (BeMob Ready) */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-subtle: #f7f7fa;
  --control-bg: #efeff4;
  --ink: #1c1c1e;
  --muted: #8e8e93;
  --secondary: #636366;
  --accent: #007aff;
  --accent-hover: #0066d6;
  --accent-soft: rgba(0, 122, 255, 0.1);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.12);
  --indigo: #5856d6;
  --indigo-soft: rgba(88, 86, 214, 0.1);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, 0.12);
  --hairline: rgba(60, 60, 67, 0.11);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-CTA: 0 10px 24px rgba(0, 122, 255, 0.25);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

/* App Shell */
.app-shell {
  width: min(520px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 2px;
}

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

.brand img {
  height: 32px;
  width: auto;
  display: block;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

/* Main Squircle Card (Calculator) */
.squircle-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 26px 22px 22px;
  box-shadow: var(--shadow-card);
}

.amount-header {
  text-align: center;
  padding-bottom: 18px;
}

.amount-caption {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.amount-display {
  font-size: clamp(42px, 9vw, 52px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  display: block;
}

.amount-display small {
  font-size: 0.65em;
  font-weight: 600;
  color: var(--muted);
}

.due-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: var(--control-bg);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
}

.due-pill strong {
  color: var(--ink);
  font-weight: 600;
}

/* Tactile iOS Slider */
.slider-wrap {
  margin: 8px 0 14px;
}

input[type="range"] {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--control-bg);
  cursor: pointer;
  margin: 0;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.08);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

/* Amount Quick Pills */
.amount-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}

.pill-btn {
  border: 0;
  background: var(--control-bg);
  color: var(--secondary);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pill-btn:hover {
  color: var(--ink);
}

.pill-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* iOS Segmented Control for Term */
.seg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 2px;
}

.seg-header output {
  font-weight: 600;
  color: var(--ink);
}

.ios-segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--control-bg);
  padding: 3px;
  border-radius: 14px;
  gap: 3px;
  margin-bottom: 22px;
}

.seg-item {
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 6px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.seg-item.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Primary Telegram / Apple Pay Button */
.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  background: var(--accent);
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-CTA);
  transition: transform 0.12s ease, background 0.16s ease;
}

.cta-button:hover {
  background: var(--accent-hover);
}

.cta-button:active {
  transform: scale(0.985);
}

.cta-subnote {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

.cta-subnote strong {
  color: var(--secondary);
  font-weight: 600;
}

/* 5-Step Compact Flow Strip */
.flow-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.flow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.flow-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.flow-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.flow-step {
  background: var(--card-subtle);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}

.flow-step.active {
  background: var(--accent-soft);
}

.flow-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: var(--control-bg);
  color: var(--secondary);
  margin-bottom: 4px;
}

.flow-step.active .flow-num {
  background: var(--accent);
  color: #ffffff;
}

.flow-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Advantages Block in Apple / Telegram Inset Grouped Style */
.advantages-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px 18px 6px;
  box-shadow: var(--shadow-card);
}

.advantages-head {
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--hairline);
}

.advantages-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 3px;
}

.advantages-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ios-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--hairline);
}

.ios-row:last-child {
  border-bottom: 0;
}

.ios-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ios-icon.blue {
  background: var(--accent-soft);
  color: var(--accent);
}

.ios-icon.indigo {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.ios-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.ios-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.ios-row-text {
  flex: 1;
  min-width: 0;
}

.ios-row-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.ios-row-text span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.45;
}

/* Minimal FAQ Accordion */
.mini-faq {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 2px 18px;
  box-shadow: var(--shadow-card);
}

.mini-faq details {
  border-bottom: 0.5px solid var(--hairline);
}

.mini-faq details:last-child {
  border-bottom: 0;
}

.mini-faq summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 14px 24px 14px 0;
  position: relative;
}

.mini-faq summary::-webkit-details-marker {
  display: none;
}

.mini-faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 11px;
  font-size: 18px;
  color: var(--muted);
  font-weight: 400;
}

.mini-faq details[open] summary::after {
  content: "−";
}

.mini-faq p {
  font-size: 12px;
  color: var(--muted);
  padding: 0 0 14px;
  line-height: 1.55;
}

/* Secondary Bottom CTA Card */
.bottom-cta-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.bottom-cta-info small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.bottom-cta-info strong {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bottom-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  transition: background 0.16s ease;
}

.bottom-cta-btn:hover {
  background: var(--accent-hover);
}

/* Minimal Footer */
.app-footer {
  text-align: center;
  padding: 8px 12px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--secondary);
  font-weight: 500;
}

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

/* iOS Sheet Modal for BeMob Preview */
dialog {
  border: 0;
  border-radius: 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  padding: 24px;
  width: min(400px, calc(100% - 32px));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dialog-head h2 {
  font-size: 18px;
  font-weight: 700;
}

.dialog-close {
  border: 0;
  background: var(--control-bg);
  color: var(--secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

dialog p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.code-box {
  background: var(--control-bg);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--ink);
  word-break: break-all;
  margin-bottom: 16px;
}

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

@media (max-width: 420px) {
  .amount-pills {
    grid-template-columns: repeat(3, 1fr);
  }
  .flow-label {
    font-size: 10px;
  }
}
