@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #07080a;
  --surface: #0e1013;
  --card: #121419;
  --card-soft: #171a20;
  --line: #282c34;
  --line-soft: #1b1e24;
  --text: #f7f8fa;
  --muted: #9097a3;
  --blue: #3977f6;
  --blue-bright: #5d91ff;
  --cyan: #70a1ff;
  --good: #43d68b;
  --danger: #ff6874;
  --warning: #f8c46a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% -10%, rgba(43, 92, 180, .28), transparent 34rem),
    radial-gradient(circle at -10% 35%, rgba(26, 61, 122, .16), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", Inter, ui-sans-serif, system-ui, sans-serif;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  content: "";
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1160px, calc(100% - 40px)); margin: auto; padding: 20px 0 80px; }

.header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: 11px; color: white; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: linear-gradient(145deg, #568cff, #204ea9); box-shadow: inset 0 1px rgba(255,255,255,.25), 0 10px 28px rgba(36,95,220,.28); font-weight: 800; }
.brand b, .brand small { display: block; }
.brand b { letter-spacing: .12em; }
.brand small { margin-top: 1px; color: #79818e; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.online { color: #b9c1cc; font-size: 12px; }
.online i, .welcome-strip i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 14px var(--good); }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: #111318; color: #aeb5c0; font-size: 16px; letter-spacing: .08em; }
.icon-btn:hover { border-color: #3a404b; color: white; }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: center; min-height: 470px; gap: 70px; padding: 68px 30px 54px; }
.kicker { color: #6d99f5; font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.hero h1 { max-width: 680px; margin: 20px 0 22px; font-size: clamp(44px, 6vw, 78px); line-height: .98; letter-spacing: -.055em; }
.hero h1 em { color: #73a0ff; font-style: normal; }
.hero p { max-width: 620px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 30px; color: #b0b7c2; font-size: 12px; }
.hero-trust span::first-letter { color: var(--good); }
.hero-orbit { position: relative; width: min(380px, 100%); aspect-ratio: 1; justify-self: center; border: 1px solid rgba(98,143,233,.18); border-radius: 50%; background: radial-gradient(circle, rgba(45,91,178,.25), transparent 54%); box-shadow: inset 0 0 80px rgba(40,83,166,.08); }
.hero-orbit::before, .hero-orbit::after { position: absolute; inset: 15%; border: 1px solid rgba(95,139,225,.15); border-radius: 50%; content: ""; }
.hero-orbit::after { inset: 32%; }
.orbit-core { position: absolute; inset: 32%; display: grid; place-content: center; place-items: center; border: 1px solid #678ee0; border-radius: 35%; background: linear-gradient(145deg, #376fdc, #142d60); box-shadow: 0 30px 80px rgba(28,77,175,.5), inset 0 1px rgba(255,255,255,.25); transform: rotate(8deg); }
.orbit-core span { font-size: 58px; font-weight: 800; line-height: 1; }
.orbit-core small { margin-top: 8px; color: #b9ccf5; font-size: 7px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.coin { position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; min-width: 105px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(15,18,24,.92); box-shadow: 0 18px 48px rgba(0,0,0,.45); backdrop-filter: blur(14px); animation: coin-float 5s ease-in-out infinite; }
.coin img { width: 34px; height: 34px; object-fit: contain; }
.coin-ton img { width: 58px; }
.coin small { color: #aeb6c2; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.coin-ton { top: 4%; left: 8%; }
.coin-usdt { top: 38%; right: -7%; animation-delay: -1.5s; }
.coin-sol { bottom: 5%; left: 5%; animation-delay: -3s; }
@keyframes coin-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.welcome-strip { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(15,17,21,.7); color: var(--muted); font-size: 12px; }
.welcome-strip strong { color: white; }
.welcome-strip i { margin-left: auto; }

.tabs { position: sticky; top: 12px; z-index: 10; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 4px; margin: 18px 0 42px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: rgba(13,15,19,.88); box-shadow: 0 18px 50px rgba(0,0,0,.28); backdrop-filter: blur(18px); }
.tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 45px; border: 0; border-radius: 11px; background: transparent; color: #858d99; font-size: 12px; font-weight: 700; transition: .2s ease; }
.tabs button span { color: #667080; font-size: 15px; }
.tabs button:hover { color: white; }
.tabs button.active { background: linear-gradient(145deg, #232833, #191d25); box-shadow: inset 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.2); color: white; }
.tabs button.active span { color: #79a4ff; }
.panel { display: none; animation: panel-in .28s ease; }
.panel.active { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.section-heading h2 { margin: 8px 0 0; font-size: clamp(30px, 4vw, 45px); letter-spacing: -.045em; }
.section-heading p { max-width: 390px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.exchange-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); align-items: start; gap: 18px; }
.exchange-main { display: grid; gap: 14px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: #0c0e12; }
.segmented button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.segmented button.active { background: #20242c; box-shadow: inset 0 1px rgba(255,255,255,.06); color: white; }
.asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.asset { position: relative; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; overflow: hidden; min-height: 88px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, #14171c, #0e1014); color: white; text-align: left; transition: .2s ease; }
.asset::after { position: absolute; right: -25px; bottom: -35px; width: 90px; height: 90px; border-radius: 50%; background: rgba(56,115,237,.1); content: ""; }
.asset-logo { display: grid !important; width: 44px; height: 44px; place-items: center; border: 1px solid #2d333d; border-radius: 13px; background: #0b0d11; }
.asset-logo img { width: 28px; height: 28px; object-fit: contain; }
.asset[data-asset="TON"] .asset-logo img { width: 38px; }
.asset-copy { min-width: 0; }
.asset-copy strong, .asset-copy small { display: block; }
.asset strong { font-size: 16px; }
.asset-copy small { max-width: 100%; margin-top: 5px; overflow: hidden; color: #747d89; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-rate { position: relative; z-index: 1; color: #b9c4d6; font-size: 11px; white-space: nowrap; }
.asset:hover { transform: translateY(-2px); border-color: #414854; }
.asset.active { border-color: #477ff0; background: linear-gradient(145deg, #1b2e53, #111a2c); box-shadow: inset 0 0 0 1px rgba(85,139,248,.2), 0 12px 34px rgba(23,72,168,.18); }
.asset.active span { color: #92a9d3; }
.card { border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(20,23,28,.98), rgba(13,15,19,.98)); box-shadow: 0 22px 60px rgba(0,0,0,.24); }
.form-card { display: grid; gap: 17px; padding: 22px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 8px; color: #8f97a3; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
input, select { width: 100%; min-height: 49px; padding: 0 15px; border: 1px solid #2b3039; border-radius: 12px; outline: 0; background: #0c0e12; color: white; transition: .2s; }
input:focus, select:focus { border-color: #4a7ce2; box-shadow: 0 0 0 3px rgba(57,119,246,.1); }
.amount-control { display: flex; align-items: center; padding-right: 15px; border: 1px solid #2b3039; border-radius: 14px; background: #0a0c0f; }
.amount-control:focus-within { border-color: #4a7ce2; box-shadow: 0 0 0 3px rgba(57,119,246,.1); }
.amount-control input { height: 64px; border: 0; background: transparent; font-size: 25px; font-weight: 800; }
.amount-control input:focus { box-shadow: none; }
.amount-control span { color: #78a3fa; font-size: 13px; font-weight: 800; }
.primary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #3977f6, #285cc6); box-shadow: 0 14px 32px rgba(42,99,215,.25), inset 0 1px rgba(255,255,255,.18); color: white; font-size: 13px; font-weight: 800; transition: .2s ease; }
.primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary:disabled { cursor: wait; opacity: .75; }
.primary.loading span { opacity: .35; }
.primary.loading b { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; font-size: 0; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.primary b { font-size: 20px; }
.benefits { padding: 26px; }
.benefits h3 { margin: 10px 0 24px; font-size: 24px; letter-spacing: -.035em; }
.benefits ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.benefits li { display: flex; gap: 13px; padding: 17px 0; border-top: 1px solid var(--line-soft); }
.benefits li > i { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 10px; background: #19243a; color: #76a1f8; font-size: 10px; font-style: normal; font-weight: 800; }
.benefits b, .benefits small { display: block; }
.benefits b { font-size: 12px; }
.benefits small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.quote { max-width: 750px; margin-top: 18px; padding: 24px; }
.quote-head, .quote-row, .quote-total, .order-head { display: flex; align-items: center; justify-content: space-between; }
.quote-head { margin-bottom: 15px; font-weight: 800; }
.quote-row { padding: 9px 0; color: var(--muted); font-size: 12px; }
.quote-row b { color: white; }
.quote-total { margin: 12px 0 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.quote-total b { color: #79a6ff; font-size: 22px; }
.pill { padding: 6px 10px; border: 1px solid rgba(85,141,250,.2); border-radius: 30px; background: rgba(45,91,177,.16); color: #8cb1fb; font-size: 10px; }
.warning { color: var(--warning); font-size: 11px; line-height: 1.55; }
.stack { display: grid; gap: 10px; }
.order { padding: 19px; }
.order p { margin: 7px 0; color: var(--muted); font-size: 11px; }
.order > strong { font-size: 14px; }
.order-filter { max-width: 400px; margin-bottom: 15px; }
.reserve-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.reserve { padding: 28px 16px; text-align: center; }
.reserve img { width: 44px; height: 44px; margin-bottom: 12px; object-fit: contain; }
.reserve .uah-mark { display: grid; width: 44px; height: 44px; margin: 0 auto 12px; place-items: center; border-radius: 50%; background: linear-gradient(145deg,#ffd958,#a8790d); color: #111; font-size: 24px; font-weight: 800; }
.reserve span { color: var(--muted); font-size: 12px; }
.reserve b { display: block; margin-top: 10px; font-size: 23px; }
.reserve small { display: block; margin-top: 6px; color: #666e79; font-size: 9px; }
.empty { padding: 55px 20px; border: 1px dashed #2b3039; border-radius: 18px; color: var(--muted); text-align: center; }
.hidden { display: none !important; }

dialog { width: min(92%, 440px); padding: 0; border: 0; background: transparent; color: white; }
dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(8px); }
.dialog-card { display: grid; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.dialog-card h2, .dialog-card p { margin: 0; }
.dialog-card p { color: var(--muted); }
.ghost { min-height: 45px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: white; }
.toast { position: fixed; bottom: 25px; left: 50%; z-index: 20; max-width: 90%; padding: 12px 18px; overflow: hidden; border: 1px solid #34435e; border-radius: 30px; background: #171d28; color: white; opacity: 0; pointer-events: none; transform: translate(-50%,20px); text-overflow: ellipsis; white-space: nowrap; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 800px) {
  .shell { width: min(100% - 24px, 620px); padding-top: max(12px, env(safe-area-inset-top)); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 60px 10px 38px; }
  .hero-orbit { display: flex; width: 100%; height: auto; aspect-ratio: auto; justify-content: space-between; gap: 7px; padding: 10px; border-radius: 18px; background: rgba(14,17,22,.7); }
  .hero-orbit::before, .hero-orbit::after, .orbit-core { display: none; }
  .hero-orbit .coin { position: static; flex: 1; min-width: 0; padding: 9px; animation: none; }
  .hero-orbit .coin img { width: 28px; height: 28px; }
  .hero-orbit .coin-ton img { width: 45px; }
  .hero h1 { font-size: clamp(43px, 12vw, 62px); }
  .hero p { font-size: 14px; }
  .welcome-strip { flex-wrap: wrap; }
  .welcome-strip i { margin-left: 0; }
  .tabs { top: 8px; grid-template-columns: repeat(4, 1fr); margin-bottom: 28px; }
  .tabs button { flex-direction: column; gap: 2px; min-height: 54px; padding: 5px 2px; font-size: 9px; }
  .tabs button span { font-size: 14px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 10px; }
  .exchange-layout { grid-template-columns: 1fr; }
  .benefits { display: none; }
  .reserve-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .header { min-height: 58px; }
  .online { display: none; }
  .hero { padding-top: 45px; }
  .hero h1 { margin-top: 14px; font-size: 43px; }
  .hero-trust { gap: 12px; }
  .welcome-strip > span:last-child, .welcome-strip i { display: none; }
  .segmented button { padding: 0 7px; font-size: 10px; }
  .asset { grid-template-columns: 38px 1fr; min-height: 82px; padding: 12px 10px; }
  .asset-logo { width: 38px; height: 38px; }
  .asset-logo img { width: 24px; height: 24px; }
  .asset-rate { grid-column: 2; margin-top: -5px; }
  .asset strong { font-size: 13px; }
  .exchange-fields, .field-grid { grid-template-columns: 1fr; }
  .form-card { padding: 17px; }
  .quote { padding: 18px; }
}
