:root {
  --bg: #000000;
  --panel: #0b0b0b;
  --panel-soft: #121212;
  --line: #242424;
  --text: #f3f3f3;
  --muted: #a8a8a8;
  --primary: #3f6ef9;
  --primary-2: #5c84ff;
  --ok: #4ade80;
  --warn: #fbbf24;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 22% -8%, rgba(64, 92, 190, 0.14), transparent 34%),
    radial-gradient(circle at 87% 116%, rgba(46, 120, 219, 0.12), transparent 32%),
    #000;
}

.space-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.sature-logo {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 3;
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(150, 175, 255, 0.5);
  background: radial-gradient(circle at 20% 20%, rgba(39, 58, 112, 0.4), rgba(8, 11, 20, 0.5));
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(201, 216, 255, 0.2), 0 0 18px rgba(92, 132, 255, 0.26);
  overflow: hidden;
}

.sature-logo::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  top: 9px;
  left: 8px;
  background: #99b5ff;
  box-shadow: 0 0 10px rgba(116, 150, 255, 0.8);
  animation: logoDotPulse 2s ease-in-out infinite;
}

.sature-logo::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  border: 1px solid rgba(146, 171, 255, 0.2);
  pointer-events: none;
}

.logo-word {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.55px;
  font-size: 0.9rem;
  color: #dbe6ff;
  background: linear-gradient(110deg, #b8caff 20%, #ffffff 45%, #88a9ff 70%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: satureGlow 2.8s linear infinite;
  padding-left: 10px;
}

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 14px;
  z-index: 1;
}

.top-shell {
  width: min(100%, 680px);
  border: 1px solid rgba(138, 157, 220, 0.26);
  background: rgba(8, 10, 18, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(162, 183, 255, 0.08), 0 16px 30px rgba(0, 0, 0, 0.45);
}

.shell-footer {
  opacity: 0.86;
}

.shell-title {
  color: #9fb0d8;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-sub {
  color: #8e8e8e;
  font-size: 0.78rem;
}

.trust-row {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.trust-pill {
  border-radius: 999px;
  border: 1px solid #252525;
  background: #0f0f0f;
  padding: 4px 9px;
  font-size: 0.73rem;
  color: #cfcfcf;
}

.ambient-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.08;
  pointer-events: none;
  animation: driftGlow 16s ease-in-out infinite;
}

.ambient-glow-a {
  top: 8%;
  left: 8%;
  background: var(--primary);
}

.ambient-glow-b {
  bottom: 10%;
  right: 10%;
  background: var(--primary-2);
  animation-delay: -7s;
}

.exchange-card,
.order-card {
  position: relative;
  width: min(100%, 680px);
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(9, 12, 21, 0.52), rgba(5, 7, 13, 0.45));
  border: 1px solid rgba(138, 157, 220, 0.28);
  box-shadow: inset 0 1px 0 rgba(180, 198, 255, 0.08), 0 20px 65px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  overflow: hidden;
  animation: none;
}

.exchange-card::before,
.order-card::before {
  content: none;
}

.card-header {
  margin-bottom: 12px;
}

.card-header h1 {
  font-size: 1.25rem;
  letter-spacing: 0.2px;
}

.card-header p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.86rem;
}

.mini-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.mini-step {
  border-radius: 999px;
  border: 1px solid #282828;
  color: #9a9a9a;
  padding: 4px 9px;
  font-size: 0.72rem;
  background: #0b0b0b;
}

.mini-step.active {
  border-color: #5e5e5e;
  color: #ebebeb;
}

.quote-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  max-width: 430px;
  border-radius: 12px;
  border: 1px solid #2f3550;
  background: rgba(14, 17, 29, 0.75);
  overflow: hidden;
  margin-bottom: 10px;
}

.mode-pill {
  border: none;
  border-right: 1px solid #2f3550;
  background: transparent;
  color: #97a2c5;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 11px 10px 10px;
  clip-path: polygon(0 0, 95% 0, 100% 100%, 0 100%);
  transition: background 0.18s ease, color 0.18s ease;
}

.mode-pill:last-child {
  border-right: none;
  clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%);
}

.mode-pill.active {
  color: #eef3ff;
  background: linear-gradient(180deg, #1a284d, #111a32);
}

.rates-meta {
  margin-top: 8px;
  color: #a1a1a1;
  font-size: 0.78rem;
}

.card-footer {
  margin-top: 8px;
  color: #8a8a8a;
  font-size: 0.71rem;
  border-top: 1px dashed #2b2b2b;
  padding-top: 8px;
}

.pair-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.switch-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -4px 0;
  z-index: 2;
}

.swap-card {
  position: relative;
  background: rgba(8, 10, 18, 0.52);
  border: 1px solid rgba(138, 157, 220, 0.23);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
  animation: none;
}

.swap-card.dropdown-active {
  z-index: 5;
}

.swap-card:hover {
  border-color: rgba(121, 145, 222, 0.55);
}

.top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.2px;
}

.network-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 10px;
}

.network-row label {
  font-size: 0.72rem;
  color: var(--muted);
}

.network-select {
  min-width: 128px;
  border: 1px solid rgba(104, 128, 196, 0.45);
  background: linear-gradient(180deg, rgba(20, 28, 50, 0.9), rgba(16, 22, 40, 0.82));
  color: var(--text);
  border-radius: 8px;
  padding: 6px 30px 6px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8da8f5 50%),
    linear-gradient(135deg, #8da8f5 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.network-select:hover {
  border-color: #6f8ee8;
}

.network-select:focus {
  outline: 2px solid rgba(116, 152, 255, 0.5);
  outline-offset: 1px;
}

.amount-row input {
  width: 100%;
  margin-top: 6px;
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  border: none;
  background: transparent;
  color: var(--text);
}

.amount-row input:focus,
.wallet:focus,
.dropdown input:focus {
  outline: 2px solid rgba(92, 132, 255, 0.45);
  outline-offset: 2px;
}

.coin-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(16, 22, 40, 0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.coin-box:hover,
.coin-box:focus {
  border-color: #5c75bb;
  background: rgba(19, 29, 54, 0.62);
}

.coin-box img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

.coin-icon-fallback {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #d6e3ff;
  border: 1px solid #3c5280;
  background: radial-gradient(circle at 20% 20%, #25457a, #111d35);
}

.caret {
  margin-left: auto;
  color: var(--muted);
}

.switch {
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 50%;
  border: 1px solid #303f68;
  background: #121827;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.switch:hover {
  border-color: #5b78c6;
  transform: rotate(180deg);
}

.switch:disabled {
  transform: none !important;
  border-color: #2a2a2a;
  background: #101010;
}

.dropdown {
  display: none;
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(100% + 8px);
  margin-top: 0;
  border-radius: 12px;
  border: 1px solid rgba(126, 149, 222, 0.36);
  background: linear-gradient(180deg, rgba(11, 14, 25, 0.96), rgba(9, 12, 20, 0.94));
  backdrop-filter: blur(12px);
  padding: 8px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(173, 193, 255, 0.08);
  animation: fadeIn 0.18s ease;
  z-index: 9;
}

.dropdown.open {
  display: block;
}

.dropdown input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(111, 136, 211, 0.35);
  background: rgba(18, 24, 44, 0.75);
  color: var(--text);
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.list {
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.list::-webkit-scrollbar {
  width: 8px;
}

.list::-webkit-scrollbar-track {
  background: transparent;
}

.list::-webkit-scrollbar-thumb {
  background: rgba(104, 126, 196, 0.6);
  border-radius: 999px;
}

.coin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  color: #d3d3d3;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.coin-item:hover {
  background: rgba(28, 39, 72, 0.7);
  transform: translateX(1px);
}

.coin-item.selected {
  background: #151e33;
  border: 1px solid #33497f;
}

.coin-item img {
  width: 18px;
  height: 18px;
}

.coin-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.coin-check {
  min-width: 18px;
  text-align: right;
  color: #89a6ff;
  font-weight: 700;
}

.dropdown-empty {
  color: #949494;
  text-align: center;
  padding: 10px 8px;
  font-size: 0.8rem;
}

.field-row {
  margin-top: 0;
}

.field-row label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.quote-summary {
  margin-top: 10px;
  border: 1px solid rgba(138, 157, 220, 0.2);
  border-radius: 10px;
  background: rgba(12, 16, 29, 0.45);
  padding: 9px 10px;
}

.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #a9b4d1;
  padding: 3px 0;
}

.quote-row strong {
  color: #e6ecff;
  font-size: 0.8rem;
}

.wallet {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b0b0b;
  color: var(--text);
}

.exchange-btn,
.action-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(92deg, #2f4d9d, #4f72d8);
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 10px 22px rgba(22, 38, 82, 0.46);
}

.exchange-btn:hover,
.action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.exchange-btn:disabled,
.action-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-message.error {
  color: #ff8f8f;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}

.chip {
  border: 1px solid #333;
  background: #131313;
  border-radius: 999px;
  padding: 4px 10px;
  color: #d0d0d0;
  font-size: 0.76rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-box {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 11px;
}

.detail-box .label {
  color: var(--muted);
  font-size: 0.76rem;
}

.detail-box .value {
  margin-top: 4px;
  word-break: break-word;
}

.timeline-box {
  margin-top: 10px;
}

.timeline-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 44, 0.35);
  padding: 6px 8px;
  font-size: 0.74rem;
  color: #c8d6ff;
}

.address-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.address-row input {
  flex: 1;
}

.copy-btn {
  width: 110px;
}

.tracker {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.step {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101a30;
  color: var(--muted);
  padding: 8px;
  text-align: center;
  font-size: 0.78rem;
}

.step.active {
  color: #efefef;
  border-color: #5b5b5b;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.step.done {
  color: #d9ffe8;
  border-color: #1f8d56;
}

.qr-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.qr-wrap img {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}

.back-link {
  display: inline-block;
  margin-top: 14px;
  color: #99b6f8;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes satureGlow {
  0% {
    background-position: 200% center;
    filter: drop-shadow(0 0 4px rgba(120, 152, 255, 0.25));
  }
  100% {
    background-position: -20% center;
    filter: drop-shadow(0 0 10px rgba(120, 152, 255, 0.45));
  }
}

@keyframes logoDotPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

@keyframes driftGlow {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(14px, -12px) scale(1.08);
  }
}

@media (max-width: 620px) {
  .sature-logo {
    top: 10px;
    right: 10px;
    padding: 6px 12px 6px 10px;
  }

  .logo-word {
    font-size: 0.8rem;
  }

  .page {
    padding: 16px 10px;
    padding-top: 50px;
  }

  .top-shell {
    border-radius: 14px;
    margin-top: 8px;
  }

  .exchange-card,
  .order-card {
    padding: 14px;
    border-radius: 14px;
  }

  .card-header h1 {
    font-size: 1.1rem;
  }

  .quote-mode {
    max-width: 100%;
  }

  .mode-pill {
    font-size: 0.72rem;
    padding: 10px 6px;
  }

  .amount-row input {
    font-size: 1.5rem;
  }

  .pair-grid {
    gap: 10px;
  }

  .switch-wrap {
    margin: -2px 0;
  }

  .switch {
    margin: 2px auto;
    transform: rotate(90deg);
  }

  .switch:hover {
    transform: rotate(270deg);
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .fields-grid {
    grid-template-columns: 1fr;
  }

  .address-row {
    flex-direction: column;
  }

  .copy-btn {
    width: 100%;
  }

  .tracker {
    flex-wrap: wrap;
    gap: 6px;
  }

  .step {
    flex: 1 1 40%;
    font-size: 0.7rem;
    padding: 6px;
  }

  .mini-steps {
    gap: 4px;
  }

  .mini-step {
    font-size: 0.66rem;
    padding: 3px 7px;
  }

  .trust-row {
    gap: 5px;
  }

  .trust-pill {
    font-size: 0.66rem;
    padding: 3px 7px;
  }

  .qr-wrap img {
    width: 120px;
    height: 120px;
  }
}