:root {
  --bg: #060b18;
  --page: #081123;
  --panel: rgba(14, 24, 43, 0.92);
  --panel-soft: rgba(22, 35, 58, 0.86);
  --field: #1d2a3d;
  --border: rgba(125, 150, 194, 0.18);
  --border-strong: rgba(125, 150, 194, 0.32);
  --text: #f7f9ff;
  --muted: #93a2ba;
  --blue: #347bff;
  --green: #18d59b;
  --purple: #9159ff;
  --gold: #ffc36d;
  --danger: #ff6680;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-size: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(56, 118, 255, 0.2), transparent 28%),
    radial-gradient(circle at 78% 70%, rgba(145, 89, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #0a1325 0%, #060b18 100%);
  overflow-x: hidden;
}

body.auth-busy {
  overflow: hidden;
}

button,
input,
select {
  min-width: 0;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

button:not(:disabled):active,
a:active {
  transform: translateY(1px) scale(0.99);
}

.is-clicking {
  animation: addm1-click-pulse 0.32s ease;
}

@keyframes addm1-click-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(80, 137, 255, 0.42);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(80, 137, 255, 0);
  }
}

.shell {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 38px;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: calc(100vh - 110px);
  display: grid;
  place-content: center;
  padding: 32px 18px;
  text-align: center;
}

.brand-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 22px;
  color: white;
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(145deg, #3978ff, #6f4cff);
  box-shadow: 0 20px 45px rgba(54, 120, 255, 0.35);
}

.brand-mark span {
  color: var(--green);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  min-width: 42px;
  margin: 0;
  border-radius: 10px;
  font-size: 24px;
}

.login-view h1 {
  margin: 0;
  font-size: 34px;
}

.login-view p {
  margin: 6px 0 22px;
  color: var(--muted);
}

.glass-panel,
.terminal-card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-panel {
  width: min(420px, calc(100vw - 44px));
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 14px;
  text-align: left;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.auth-panel.is-processing {
  opacity: 0.42;
  filter: saturate(0.65);
  pointer-events: none;
  user-select: none;
}

.auth-processing {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 9, 21, 0.78);
  backdrop-filter: blur(14px) saturate(0.8);
}

.processing-card {
  width: min(330px, calc(100vw - 48px));
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 26px 22px;
  border: 1px solid rgba(125, 150, 194, 0.24);
  border-radius: 18px;
  background: rgba(12, 22, 41, 0.92);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
  text-align: center;
}

.processing-logo {
  width: 72px;
  height: 72px;
  margin-bottom: 4px;
  animation: addm1-processing-spin 1.05s linear infinite;
  transform-origin: 50% 50%;
}

.processing-card strong {
  font-size: 18px;
}

.processing-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

@keyframes addm1-processing-spin {
  to {
    transform: rotate(360deg);
  }
}

label {
  color: #b8c5da;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(145, 164, 198, 0.2);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input::placeholder {
  color: rgba(184, 197, 218, 0.58);
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(54, 120, 255, 0.15);
}

.auth-panel button,
.primary-action {
  min-height: 42px;
  color: white;
  font-weight: 900;
  border-radius: 11px;
  background: linear-gradient(135deg, #247cff, #5848f7);
  box-shadow: 0 18px 36px rgba(47, 113, 255, 0.24);
}

.auth-panel button:not(:disabled):hover,
.primary-action:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 44px rgba(47, 113, 255, 0.3);
}

small {
  color: var(--muted);
  line-height: 1.45;
}

.site-header {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(26px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(59, 76, 111, 0.28);
  background: rgba(7, 13, 29, 0.96);
}

.site-header strong {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-links a,
.site-links button {
  color: #9caac1;
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 8px;
}

.site-links button {
  color: white;
}

.site-links a:hover,
.site-links button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.brand-strip {
  height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border-bottom: 1px solid rgba(59, 76, 111, 0.28);
  background: linear-gradient(180deg, rgba(22, 35, 58, 0.84), rgba(11, 20, 39, 0.78));
}

.brand-strip strong {
  margin-top: 2px;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.brand-strip small {
  font-size: 10px;
  letter-spacing: 0.22em;
}

.subnav {
  max-width: 1180px;
  display: flex;
  gap: 18px;
  margin: 10px auto 0;
  padding: 0 22px;
}

.link-button {
  color: #9caac1;
  background: transparent;
  border-bottom: 2px solid transparent;
  padding: 0 0 5px;
  font-weight: 800;
}

.link-button:hover {
  color: white;
}

.link-button.active {
  color: #91b7ff;
  border-color: var(--blue);
}

.ops-strip {
  max-width: 1180px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  margin: 10px auto 0;
  padding: 0 22px;
}

.ops-item,
.ops-action {
  min-height: 48px;
  border: 1px solid rgba(125, 150, 194, 0.2);
  border-radius: 12px;
  background: rgba(14, 24, 43, 0.74);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.ops-item {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 12px;
}

.ops-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ops-item strong {
  color: #f7f9ff;
  font-size: 14px;
}

.ops-item.ready strong {
  color: #76f3c8;
}

.ops-item.waiting strong {
  color: #ffcf8c;
}

.ops-action {
  min-width: 132px;
  padding: 0 14px;
  color: #d7e4f6;
  font-weight: 900;
}

.ops-action:hover {
  background: rgba(34, 65, 120, 0.42);
}

.terminal-shell {
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 0 22px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 18px;
}

.terminal-card {
  min-width: 0;
  border-radius: 16px;
  padding: 18px;
}

.terminal-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.12;
}

.terminal-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field-row {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.field-row.two {
  grid-template-columns: 1fr 1fr;
}

.field-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.primary-action {
  width: 100%;
  margin-top: 14px;
}

.mini-status {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 195, 109, 0.3);
  color: #ffcf8c;
  background: rgba(255, 195, 109, 0.09);
  text-align: center;
  font-weight: 800;
}

.compact-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.compact-title h2 {
  margin-bottom: 6px;
}

.health-pill {
  min-width: max-content;
  padding: 8px 12px;
  border-radius: 999px;
  color: #b9c8df;
  border: 1px solid rgba(145, 164, 198, 0.2);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.health-pill.ready {
  color: #76f3c8;
  background: rgba(32, 211, 155, 0.12);
  border-color: rgba(32, 211, 155, 0.3);
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}

.provider-card {
  min-height: 96px;
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  grid-template-rows: 34px auto auto;
  gap: 4px;
  padding: 12px 8px 10px;
  border-radius: 13px;
  color: #99b9ff;
  border: 1px solid rgba(67, 120, 255, 0.38);
  background: rgba(34, 65, 120, 0.38);
  overflow: visible;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.provider-card:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: rgba(145, 183, 255, 0.68);
  box-shadow: 0 14px 32px rgba(52, 123, 255, 0.16);
}

.provider-card strong,
.provider-card small {
  overflow-wrap: anywhere;
  text-align: center;
}

.provider-card strong {
  font-size: 14px;
}

.provider-card small {
  color: rgba(222, 232, 255, 0.66);
  font-size: 11px;
}

.provider-card[data-provider="ramp"] {
  color: #67e7b8;
  border-color: rgba(32, 211, 155, 0.38);
  background: rgba(25, 106, 85, 0.36);
}

.provider-card[data-provider="onramper"] {
  color: #ffaf86;
  border-color: rgba(255, 126, 94, 0.32);
  background: rgba(105, 49, 39, 0.36);
}

.provider-card.active {
  color: #ffd188;
  border-color: rgba(255, 195, 109, 0.95);
  background: linear-gradient(160deg, rgba(100, 58, 168, 0.72), rgba(55, 35, 98, 0.88));
  box-shadow: 0 0 0 2px rgba(255, 195, 109, 0.14), 0 18px 46px rgba(145, 89, 255, 0.24);
}

.provider-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.provider-card.active .provider-icon {
  background: rgba(255, 210, 136, 0.16);
  border-color: rgba(255, 210, 136, 0.36);
  box-shadow: 0 10px 24px rgba(255, 184, 92, 0.16);
}

.active-ribbon {
  position: absolute;
  top: -10px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #ff9d5a, #d86eff);
  font-size: 10px;
  font-weight: 900;
}

.provider-banner {
  margin: 6px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #f1dbff;
  background: linear-gradient(90deg, rgba(91, 61, 174, 0.82), rgba(132, 73, 191, 0.72));
  border: 1px solid rgba(188, 132, 255, 0.32);
  text-align: center;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.crypto-card .field {
  margin-top: 8px;
}

.provider-action {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  color: #dffcf2;
  border-radius: 12px;
  background: linear-gradient(135deg, #08755e, #0b8f67);
  font-weight: 900;
}

.provider-action:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(24, 213, 155, 0.2);
}

.provider-action:disabled {
  color: #8fa1ba;
  background: rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.submit-note {
  display: none;
  margin-top: 0;
  text-align: center;
}

.status-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(32, 211, 155, 0.35);
  background: rgba(32, 211, 155, 0.08);
  color: #cffbed;
  line-height: 1.6;
}

.status-box.error {
  border-color: rgba(255, 107, 122, 0.45);
  background: rgba(255, 107, 122, 0.1);
  color: #ffd5da;
}

.status-box a {
  display: inline-flex;
  margin-top: 12px;
  color: white;
  font-weight: 900;
}

.quote-box,
.kyc-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(125, 150, 194, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #dce8ff;
}

.quote-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.quote-box strong {
  color: #ffd188;
}

.kyc-panel h3 {
  margin: 0 0 4px;
  color: #f5f8ff;
  font-size: 17px;
}

.kyc-panel p,
.kyc-panel small {
  color: #aab8d2;
}

.kyc-panel .field-row {
  margin-top: 10px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  color: #c4d1e7;
  font-size: 13px;
  line-height: 1.45;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #247cff;
}

.secondary-action {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border-radius: 12px;
  color: #eef6ff;
  background: linear-gradient(135deg, rgba(36, 124, 255, 0.92), rgba(85, 69, 247, 0.92));
  font-weight: 900;
}

.homepage-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 900;
  width: min(440px, calc(100vw - 34px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border: 1px solid rgba(125, 150, 194, 0.26);
  border-radius: 14px;
  color: #edf5ff;
  background: rgba(11, 20, 39, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
  font-weight: 800;
  animation: toast-in 0.22s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.ghost {
  color: #afbdd4;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 10px 16px;
}

.primary-small {
  min-height: 42px;
  padding: 0 18px;
  color: white;
  font-weight: 900;
  border-radius: 999px;
  background: linear-gradient(135deg, #247cff, #5545f7);
}

.history-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(145, 164, 198, 0.18);
}

#transactions {
  display: block;
}

.section-title.compact {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.history-panel .section-title.compact h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.history-panel .section-title.compact p {
  margin-bottom: 8px;
  font-size: 13px;
}

.orders-list {
  display: grid;
  gap: 8px;
}

.order-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(145, 164, 198, 0.18);
  border-radius: 12px;
  background: rgba(8, 17, 32, 0.42);
}

.order-row strong {
  display: block;
  margin-bottom: 6px;
}

.order-row span,
.order-row small {
  color: var(--muted);
}

.site-footer {
  min-height: 40px;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 8px 22px;
  color: rgba(184, 197, 218, 0.8);
  background: rgba(9, 18, 34, 0.94);
  border-top: 1px solid rgba(59, 76, 111, 0.28);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 26px;
}

.site-footer a {
  color: #9caac1;
  text-decoration: none;
}

@media (max-width: 980px) {
  .terminal-shell {
    margin-top: 18px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-header {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .site-links,
  .subnav {
    flex-wrap: wrap;
  }

  .brand-strip {
    height: 68px;
  }

  .terminal-shell {
    margin-top: 14px;
    padding: 0 14px;
  }

  .terminal-card {
    padding: 16px;
  }

  .terminal-card h2 {
    font-size: 22px;
  }

  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 14px;
  }

  .field-row.two,
  .field-row.three {
    grid-template-columns: 1fr;
  }

  .compact-title,
  .section-title.compact,
  .order-row {
    grid-template-columns: 1fr;
  }

  #transactions {
    margin-left: 14px;
    margin-right: 14px;
  }
}

@media (max-width: 430px) {
  .site-links {
    gap: 18px;
  }

  .subnav {
    gap: 14px;
    padding: 0 14px;
  }

  .provider-grid {
    gap: 8px;
  }

  .provider-card {
    min-height: 78px;
    padding: 7px 6px;
  }

  .ops-strip {
    grid-template-columns: 1fr;
  }
}
