.swap-home {
  --home-panel: #f2f2f4;
  --home-accent: #b91d0d;
  --home-bg: #10141c;
  background: radial-gradient(ellipse at 85% 0, #191d26, var(--home-bg) 60%);
}

.swap-home .container { width: min(1600px, calc(100% - 40px)); }
.swap-home .site-header { position: relative; border: 0; background: linear-gradient(#0c1118, #171a22); color: white; }
.swap-home .header-inner { height: 113px; gap: clamp(24px, 4vw, 68px); }
.swap-home .brand { gap: 9px; font-size: clamp(23px, 2.8vw, 34px); }
.swap-home .brand small { color: #fff; font-size: 9px; }
.swap-home .brand-mark { border-radius: 50%; }
.swap-home .main-nav { gap: clamp(16px, 2.5vw, 42px); }
.swap-home .main-nav a { color: #fff; font-family: var(--font-display); font-size: 13px; }
.swap-home .main-nav a:hover, .swap-home .main-nav .active { color: #ff6c5c; }
.swap-home .header-actions .btn { border-radius: 999px; }
.swap-home .menu-btn { margin-left: 0; color: var(--black); }

.home-content { padding-top: 40px; padding-bottom: 36px; }
.home-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.home-panel, .home-notice { background: var(--home-panel); border-radius: 25px; }
.home-announcements { margin-bottom: 42px; }
.home-notice { display: flex; align-items: center; gap: 20px; min-height: 90px; padding: 18px 24px; }
.home-notice p { flex: 1; margin: 0 0 0 24px; font-size: clamp(16px, 1.8vw, 26px); font-weight: 700; line-height: 1.25; }
.home-icon-btn, .home-notice-icon, .home-title-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 13px;
  background: var(--home-accent);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.home-icon-btn { cursor: pointer; }
.home-icon-btn:hover { background: var(--red-dark); }
.home-icon-btn:disabled { opacity: .55; cursor: default; }
.home-notice-close { flex: none; width: 33px; height: 33px; border: 0; border-radius: 11px; background: #e5e5e8; font-size: 24px; line-height: 1; cursor: pointer; }
.home-notice-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.home-notice-dots span { width: 8px; height: 8px; border-radius: 50%; background: #633832; }
.home-notice-dots .current { background: var(--home-accent); }

.home-workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.home-calculator { min-height: 468px; padding: 53px 25px 36px; }
.home-calculator-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .53fr) minmax(0, 1fr); gap: clamp(12px, 2.2vw, 34px); }
.home-currency h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 30px; font-size: clamp(16px, 1.55vw, 25px); letter-spacing: -.04em; }
.home-title-icon { width: 30px; height: 30px; border-radius: 6px; font-family: var(--font-body); font-size: 19px; }
.home-currency-select, .home-amount { display: flex; align-items: center; min-width: 0; min-height: 61px; border-radius: 25px; background: #fff; }
.home-currency-select { position: relative; }
.home-coin { position: absolute; left: 19px; display: grid; place-items: center; height: 29px; width: 29px; border-radius: 50%; background: #16835c; color: #fff; font-size: 17px; font-weight: 700; pointer-events: none; }
.home-coin[data-code="BTC"] { background: #e28415; }
.home-coin[data-code="ETH"], .home-coin[data-code="LTC"] { background: #515c91; }
.home-coin[data-code="TON"], .home-coin[data-code="USDC"] { background: #2574ba; }
.home-currency-select select { width: 100%; min-width: 0; min-height: 61px; padding: 0 18px 0 60px; border: 0; border-radius: inherit; background: transparent; cursor: pointer; font-size: 15px; }
.home-amount { gap: 8px; margin-top: 20px; padding: 0 19px 0 clamp(18px, 2.8vw, 40px); }
.home-amount input, .home-amount output { flex: 1; min-width: 0; width: 100%; min-height: 61px; border: 0; background: transparent; font-size: 20px; font-weight: 700; }
.home-amount output { display: flex; align-items: center; overflow-wrap: anywhere; }
.home-amount span { font-size: 12px; color: var(--grey); }
.home-field-note { margin: 12px 0 0; font-size: 11px; color: #565e6a; line-height: 1.5; }
.home-field-note b { color: var(--black); }
.home-field-note[data-error] { color: var(--red-dark); }
.home-swap-column { display: flex; flex-direction: column; align-items: center; text-align: center; }
.home-swap-column > :first-child { margin-top: 2px; }
.home-rate-type { margin-top: 8px; padding: 7px 12px; border-radius: 999px; background: #fff; font-size: 11px; font-weight: 700; }
.home-swap { margin: 35px 0 10px; }
.home-swap-column #calcRate { display: inline-block; }

.home-confirm { grid-column: 2; grid-row: 1 / span 2; min-height: 610px; display: flex; flex-direction: column; padding: 40px 25px 28px; }
.home-confirm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.home-confirm h2 { margin: 0; font-family: var(--font-body); font-size: clamp(19px, 1.8vw, 27px); letter-spacing: -.02em; }
.home-summary { display: grid; gap: 12px; margin: 0; }
.home-summary div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; min-height: 48px; border-radius: 25px; background: #fff; font-size: 13px; }
.home-summary dt { color: #525965; }
.home-summary dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.home-order-fields { margin: 20px 0 12px; }
.home-order-fields .field { margin-bottom: 12px; }
.home-order-fields .input, .home-order-fields .select { min-height: 44px; background-color: #fff; }
.home-order-fields .field-hint { margin: 0; }
.home-confirm-action { margin-top: auto; padding: 14px; text-align: center; border: 1px solid #e4a39a; background: #fff; border-radius: 15px; }
.home-confirm-action .btn { border-radius: 999px; min-height: 52px; font-family: var(--font-body); text-transform: none; font-size: 14px; letter-spacing: 0; }
.home-confirm-action a { display: inline-block; margin-top: 10px; color: var(--red-dark); font-size: 12px; text-decoration: underline; }

.home-conditions { padding: 36px clamp(25px, 5vw, 72px); }
.home-conditions h2 { font-family: var(--font-body); letter-spacing: -.02em; font-size: clamp(26px, 3vw, 42px); }
.home-conditions ol { padding-left: 21px; }
.home-conditions li + li { margin-top: 8px; }
.home-footer { color: #fff; border-top: 1px solid var(--line-dark); }
.home-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 0; }
.home-footer h2 { font-family: var(--font-body); font-size: 16px; }
.home-footer a:not(.brand) { margin-right: 12px; text-decoration: underline; }
.swap-home :focus-visible { outline: 2px solid #386cd1; outline-offset: 3px; }

@media (max-width: 1110px) {
  .swap-home .menu-btn { display: grid; place-items: center; }
  .swap-home .main-nav { display: none; }
  .swap-home .main-nav.mobile-open a { color: var(--black); }
  .swap-home .header-inner { height: 76px; gap: 16px; }
  .swap-home .header-actions { margin-left: auto; }
  .home-workspace { gap: 22px; }
  .home-calculator-fields { grid-template-columns: minmax(0, 1fr) 89px minmax(0, 1fr); }
}

@media (max-width: 830px) {
  .home-workspace { grid-template-columns: minmax(0, 1fr); }
  .home-calculator { min-height: auto; padding-top: 32px; }
  .home-confirm { grid-column: auto; grid-row: auto; min-height: auto; }
  .home-confirm-head { margin-bottom: 20px; }
  .home-content { padding-top: 22px; }
  .home-announcements { margin-bottom: 24px; }
  .home-notice p { margin-left: 0; }
}

@media (max-width: 540px) {
  .swap-home .container { width: calc(100% - 24px); }
  .swap-home .header-inner { gap: 8px; }
  .swap-home .brand { font-size: clamp(11px, 3.5vw, 17px); }
  .swap-home .brand small { font-size: 7px; letter-spacing: .11em; }
  .swap-home .brand-mark { display: none; }
  .swap-home .header-actions { gap: 5px; }
  .swap-home .header-actions .btn { min-height: 34px; padding: 0 9px; font-size: 10px; }
  .swap-home .header-actions a[href="/exchange.html"] { display: none; }
  .swap-home .menu-btn { width: 35px; height: 35px; flex: 0 0 35px; }
  .home-notice { gap: 8px; padding: 12px; min-height: 72px; }
  .home-notice .home-notice-icon { display: none; }
  .home-notice .home-icon-btn, .home-notice-close { width: 30px; height: 32px; border-radius: 8px; font-size: 17px; }
  .home-notice p { font-size: 13px; }
  .home-calculator-fields { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .home-currency h2 { margin-bottom: 12px; font-size: 19px; }
  .home-amount { margin-top: 10px; }
  .home-swap-column { flex-direction: row; justify-content: space-between; gap: 8px; }
  .home-swap-column > :first-child { display: none; }
  .home-swap-column > * { margin: 0; }
  .home-swap { width: 40px; height: 40px; transform: rotate(90deg); }
  .home-calculator, .home-confirm, .home-conditions { padding: 22px 18px; }
  .home-footer-inner { flex-wrap: wrap; }
}

.auth-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 25px;
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow);
  overflow: auto;
}

.auth-dialog::backdrop {
  background: rgba(6, 10, 18, .54);
  backdrop-filter: blur(7px);
}

@media (prefers-reduced-motion: no-preference) {
  .auth-dialog[open]::backdrop { animation: auth-backdrop-in 200ms ease-out both; }

  @keyframes auth-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}
.swap-home:has(.auth-dialog[open]) { overflow: hidden; }
.auth-dialog-content { position: relative; padding: 32px clamp(20px, 7vw, 36px) 26px; }
.auth-dialog h2 { margin: 0 42px 24px 0; font-size: clamp(21px, 5vw, 25px); }
.auth-dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: var(--paper);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.auth-dialog .field { margin-bottom: 14px; }
.auth-dialog .input { min-height: 46px; }
.auth-dialog .auth-alt { margin: 15px 0 0; }
.auth-alt button { padding: 0; border: 0; background: none; color: var(--red-dark); font-weight: 600; cursor: pointer; }
.auth-alt button:hover { text-decoration: underline; }
.auth-consent { margin-bottom: 15px; }
