* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #0F1A2A;
  background: #F5F1EA;
  -webkit-font-smoothing: antialiased;
}

.portal {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 64px 16px 32px;
  display: flex;
  flex-direction: column;
}

.brand { display: flex; justify-content: center; padding: 8px 0 28px; }
.brand .logo {
  height: 96px; width: auto; display: inline-flex; align-items: center; justify-content: center;
}
.brand .logo img { height: 100%; width: auto; }

.heading { text-align: center; margin: 0 0 6px; font-size: 24px; font-weight: 600; line-height: 1.2; color: #0F1A2A; }
.subheading { text-align: center; margin: 0 0 24px; font-size: 16px; font-weight: 400; color: #6B6558; }

/* Тарифы — 3 кнопки в ряд */
.tariffs { display: flex; flex-direction: row; gap: 10px; }
.tariff {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #E3DCC9;
  border-radius: 22px;
  padding: 18px 8px;
  min-height: 130px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: center;
  transition: background 100ms ease-out, border-color 100ms ease-out, transform 100ms ease-out;
}
.tariff:hover { background: #FAF3E5; border-color: #1B6FD4; }
.tariff:active { transform: scale(0.98); background: #F2EDDF; }
.tariff[disabled] { opacity: 0.5; cursor: not-allowed; }
.tariff .ico {
  color: #1B6FD4; flex: none;
  width: 40px; height: 40px;
  background: #E3EEF8;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tariff .name { font-size: 16px; font-weight: 700; }
.tariff .name small { display: block; font-size: 11px; font-weight: 500; color: #6B6558; margin-top: 3px; }
.tariff .price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Акцент «популярный» — для basic */
.tariff[data-id="basic"] { border-color: #F2A93B; position: relative; }
.tariff[data-id="basic"] .ico { background: #FCEFD6; color: #C28319; }
.tariff[data-id="basic"]::before {
  content: "★ ПОПУЛЯРНЫЙ";
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: #F2A93B; color: #1A1A1A;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px;
  white-space: nowrap;
}
.tariff[data-id="basic"]:hover { background: #FCEFD6; border-color: #F2A93B; }

/* CTA-кнопка */
.btn {
  height: 48px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  transition: background 100ms ease-out;
}
.btn-primary { background: #1B6FD4; color: #fff; }
.btn-primary:hover { background: #155BB0; }
.btn-primary:active { background: #0F4488; transform: scale(0.99); }

.foot { margin-top: auto; padding-top: 32px; text-align: center; }
.foot a { color: #6B6558; font-size: 14px; text-decoration: none; }
.foot a:hover { color: #1B6FD4; text-decoration: underline; }

.center-card {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 24px 8px;
}
.icon-circle {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.icon-circle svg { width: 48px; height: 48px; }
.icon-circle.brand { background: #EAF1FA; color: #1B6FD4; animation: pulse 1.4s ease-in-out infinite; }
.icon-circle.ok { background: #E6F4EC; color: #1E8E4E; }
.icon-circle.err { background: #FBEAE7; color: #C0392B; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.88); opacity: 0.6; }
}

.big-title { font-size: 24px; font-weight: 700; margin: 0 0 10px; line-height: 1.2; }
.big-meta { font-size: 18px; font-weight: 500; color: #6B6558; margin: 0 0 4px; line-height: 1.4; }
.big-meta strong { color: #0F1A2A; font-weight: 600; }
.fine-print { font-size: 14px; color: #94A3B8; margin-top: 18px; }

.progress-card {
  background: #fff;
  border: 1px solid #E3DCC9;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}
.progress-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.progress-row .lbl { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: #6B6558; font-weight: 500; }
.progress-row .val { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: #0F1A2A; }
.bar { background: #F2EDDF; height: 8px; border-radius: 999px; overflow: hidden; }
.bar .fill { background: #1B6FD4; height: 100%; border-radius: 999px; transition: width 200ms ease-out, background 200ms ease-out; }
.bar .fill.warn { background: #F2A93B; }
.bar-meta { display: flex; justify-content: space-between; font-size: 13px; color: #6B6558; margin-top: 10px; font-variant-numeric: tabular-nums; }

.gap-md { display: flex; flex-direction: column; gap: 16px; }
.spacer { height: 24px; }

.warn-block {
  display: flex; align-items: flex-start; gap: 10px;
  background: #FCEFD6;
  border: 1px solid #F2A93B;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #6B4A17;
  font-size: 14px;
  line-height: 1.4;
}
.warn-block svg { flex: none; color: #C28319; margin-top: 1px; }

.error { color: #C0392B; font-size: 14px; text-align: center; margin: 12px 0 0; }

.screen { display: none; flex-direction: column; flex: 1; }
.screen.active { display: flex; animation: fadeIn 150ms ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Прячем лого на не-tariffs экранах */
body:has(#screen-tariffs:not(.active)) .brand { display: none; }

/* Мок-страница оплаты */
.kaspi-mock {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 16px;
}
.kaspi-mock .card {
  background: #fff;
  border: 1px solid #E3DCC9;
  border-radius: 22px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.kaspi-logo {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #6B6558;
  margin-bottom: 16px;
}
.kaspi-amount {
  font-size: 32px;
  font-weight: 700;
  color: #0F1A2A;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.kaspi-label {
  font-size: 16px;
  color: #6B6558;
  margin-bottom: 24px;
}
.kaspi-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kaspi-actions button {
  height: 48px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.kaspi-actions .btn-primary { background: #1B6FD4; color: #fff; }
.kaspi-actions .btn-secondary {
  background: transparent; color: #6B6558; border: 1px solid #E3DCC9;
}
.kaspi-note {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 24px;
  line-height: 1.5;
}
