:root {
  --orange: #FF6B1A;
  --orange-deep: #E85A0C;
  --orange-soft: #FFE4D1;
  --cream: #FFF7F0;
  --cream-2: #F8EDE3;
  --white: #FFFFFF;
  --text: #2C2C2C;
  --muted: #6E6760;
  --line: rgba(44, 44, 44, 0.08);
  --shadow: 0 10px 28px rgba(255, 107, 26, 0.1);
  --radius: 24px;
  --high: #1F9D55;
  --medium: #C79212;
  --low: #D64545;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(120% 80% at 50% -10%, #FFD7BD 0%, transparent 55%),
    var(--cream);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--orange-deep);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: calc(18px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  overflow-x: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--orange);
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(255, 107, 26, 0.28);
}

.brand-mark svg {
  display: block;
}

.brand-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.title {
  text-align: center;
  margin-inline: auto;
  width: 100%;
  max-width: 100%;
  font-size: clamp(16px, 4.2vw + 0.35rem, 28px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
  animation: rise 0.45s ease both;
}

.lead {
  margin-top: 8px;
  margin-inline: auto;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  max-width: 30ch;
  animation: rise 0.45s ease 0.05s both;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.assess {
  margin-top: 20px;
  padding: 16px 18px 14px;
  animation: rise 0.45s ease 0.1s both;
}

.card-kicker {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.assess-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

[hidden] {
  display: none !important;
}

.assess-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--high);
  box-shadow: 0 0 0 6px rgba(31, 157, 85, 0.16);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.assess-label {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  transition: color 0.25s ease;
}

.assess[data-level="high"] .assess-dot {
  background: var(--high);
  box-shadow: 0 0 0 6px rgba(31, 157, 85, 0.16);
}

.assess[data-level="high"] .assess-label {
  color: var(--high);
}

.assess[data-level="medium"] .assess-dot {
  background: var(--medium);
  box-shadow: 0 0 0 6px rgba(199, 146, 18, 0.16);
}

.assess[data-level="medium"] .assess-label {
  color: var(--medium);
}

.assess[data-level="low"] .assess-dot {
  background: var(--low);
  box-shadow: 0 0 0 6px rgba(214, 69, 69, 0.16);
}

.assess[data-level="low"] .assess-label {
  color: var(--low);
}

.fine-print {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.calc {
  margin-top: 12px;
  padding: 22px 18px 18px;
  min-height: 268px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rise 0.45s ease 0.14s both;
}

.amount {
  text-align: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.slider-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.slider-wrap {
  margin-top: 18px;
  padding: 10px 0;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-x;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--orange) var(--progress, 31%),
    var(--orange-soft) var(--progress, 31%)
  );
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  margin-top: -12px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--orange);
  box-shadow: 0 4px 12px rgba(255, 107, 26, 0.35);
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--orange-soft);
}

input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--orange);
}

input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--orange);
  box-shadow: 0 4px 12px rgba(255, 107, 26, 0.35);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.slider-scale span:last-child {
  text-align: right;
}

.repay {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.repay-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.repay-value {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 10px 20px rgba(255, 107, 26, 0.28);
}

.btn-primary:hover {
  background: var(--orange-deep);
}

.btn-check {
  margin-top: 14px;
  animation: rise 0.45s ease 0.18s both;
}

.btn-ghost {
  background: var(--cream);
  color: var(--text);
  margin-top: 16px;
  min-height: 48px;
  font-size: 15px;
}

.btn-telegram {
  margin-top: 10px;
}

.btn:disabled {
  opacity: 0.65;
  pointer-events: none;
}

.state-view {
  text-align: center;
  padding: 18px 4px 6px;
  animation: rise 0.4s ease both;
}

.state-title {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 800;
}

.state-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.loader {
  width: 48px;
  height: 48px;
  margin: 8px auto 0;
  border-radius: 50%;
  border: 4px solid var(--orange-soft);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}

.app-code {
  margin-top: 8px;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  animation: rise 0.45s ease 0.22s both;
}

.benefit {
  background: var(--white);
  border-radius: 20px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 92px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 6px 18px rgba(44, 44, 44, 0.04);
}

.benefit-wide {
  grid-column: 1 / -1;
  min-height: 0;
  flex-direction: row;
  align-items: center;
}

.benefit-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--orange);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.transfer-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.footer-links {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-weight: 700;
}

.legal-page .title {
  max-width: none;
  font-size: 26px;
}

.legal-content {
  margin-top: 18px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

.legal-content h2 {
  font-size: 16px;
  margin: 16px 0 8px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.legal-content p + p {
  margin-top: 10px;
}

.legal-content ul {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--text);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 389px) {
  .amount,
  .app-code {
    font-size: 36px;
  }

  .repay-value {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
