:root {
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --purple: #a855f7;
  --green: #22c55e;
  --orange: #f97316;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--slate-950);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body.auth-busy {
  overflow: hidden;
}

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

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

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
}

a {
  color: inherit;
}

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

.shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.preview-banner {
  display: none !important;
}

.login-view {
  min-height: calc(100vh - 96px);
  display: grid;
  place-content: center;
  padding: 32px 18px;
  text-align: center;
  background: linear-gradient(135deg, var(--slate-950), var(--slate-900), var(--slate-950));
}

.brand-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 22px;
  color: #fff;
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(145deg, #2563eb, #5b21b6);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.34);
}

.brand-mark span {
  color: #34d399;
}

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

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

.glass-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.auth-panel {
  width: min(420px, calc(100vw - 44px));
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 16px;
  text-align: left;
}

.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(2, 6, 23, 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(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 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;
}

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

.addm1-brandbar {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.addm1-brandbar a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.addm1-brandbar img {
  width: auto;
  height: 44px;
  display: block;
}

.subnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(15, 23, 42, 0.95);
}

.subnav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.subnav-divider {
  color: #334155;
}

.link-button {
  padding: 0;
  color: #94a3b8;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

.link-button.active {
  padding-bottom: 2px;
  color: var(--blue);
  border-color: var(--blue);
  font-weight: 600;
}

.site-header {
  width: 100%;
  border-bottom: 1px solid var(--slate-800);
  background: rgba(51, 58, 74, 0.94);
  backdrop-filter: blur(18px);
}

.site-header-inner {
  max-width: 1152px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 12px 16px;
}

.company-link {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}

.site-links a,
.site-links button {
  color: #cbd5e1;
  background: transparent;
  text-decoration: none;
}

.site-links .home-link {
  color: #fff;
  font-weight: 600;
}

.site-links a:hover,
.site-links button:hover {
  color: #fff;
}

.hidden-control {
  display: none;
}

.ops-strip {
  display: none;
}

.terminal-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 96px;
  background: linear-gradient(135deg, var(--slate-950) 0%, var(--slate-900) 50%, var(--slate-950) 100%);
}

.workspace-grid {
  width: 100%;
  max-width: 1024px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.terminal-card {
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--slate-800);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px);
}

.auth-card h1 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.auth-card p,
.crypto-card p {
  margin: 0;
}

.auth-card > p {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 16px;
}

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

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

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

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

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

label {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 12px;
  border: 1px solid var(--slate-700);
  border-radius: 12px;
  color: #fff;
  background: var(--slate-800);
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

input:focus,
select:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6);
}

.status-banner {
  display: block;
  margin-top: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.1);
  font-size: 13px;
}

.status-banner.error {
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.primary-action {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(90deg, #2563eb, #4f46e5);
  font-weight: 700;
}

.primary-action:not(:disabled):hover {
  opacity: 0.9;
}

.secure-note {
  margin-top: 12px !important;
  color: rgba(71, 85, 105, 0.95);
  font-size: 12px;
  text-align: center;
}

.history-panel {
  display: none;
}

.crypto-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crypto-card h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.provider-label {
  margin-bottom: 12px !important;
  color: var(--muted);
  font-size: 12px;
}

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

.provider-card {
  min-height: 82px;
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.2);
  text-align: center;
  opacity: 0.65;
}

.provider-card:hover {
  opacity: 0.9;
}

.provider-card.active {
  transform: scale(1.05);
  opacity: 1;
}

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

.provider-card small {
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.35;
}

.provider-card[data-provider="moonpay"] {
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(147, 51, 234, 0.2);
}

.provider-card[data-provider="ramp"] {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(22, 163, 74, 0.2);
}

.provider-card[data-provider="onramper"] {
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.3);
  background: rgba(234, 88, 12, 0.2);
}

.provider-card.active[data-provider="alchemy"] {
  border-color: rgb(59, 130, 246);
  background: rgba(59, 130, 246, 0.25);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}

.provider-card.active[data-provider="moonpay"] {
  border-color: rgb(168, 85, 247);
  background: rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.35);
}

.provider-card.active[data-provider="ramp"] {
  border-color: rgb(34, 197, 94);
  background: rgba(34, 197, 94, 0.25);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}

.provider-card.active[data-provider="onramper"] {
  border-color: rgb(249, 115, 22);
  background: rgba(249, 115, 22, 0.25);
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.35);
}

.active-ribbon {
  display: none;
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 10;
  padding: 2px 6px;
  border-radius: 9999px;
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.provider-card.active .active-ribbon {
  display: inline-block;
}

.provider-banner {
  display: none;
}

.wallet-field {
  margin-top: 16px;
}

.network-field {
  display: none;
}

.quote-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.06);
  font-size: 12px;
}

.quote-box strong {
  color: #34d399;
}

.provider-action {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  border-radius: 12px;
  color: #fff;
  background: #059669;
  font-weight: 700;
}

.provider-action:not(:disabled):hover {
  opacity: 0.9;
}

.provider-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submit-note {
  margin-top: 8px !important;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.status-box {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
  font-size: 13px;
}

.status-box.error {
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.status-box a {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.system-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-800);
}

.system-status span {
  color: var(--muted);
  font-size: 14px;
}

.health-pill {
  padding: 4px 12px;
  border-radius: 9999px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  font-size: 14px;
}

.health-pill::before {
  content: "● ";
}

.health-pill:not(.ready) {
  color: #f87171;
  background: rgba(239, 68, 68, 0.25);
}

.homepage-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  max-width: 340px;
  padding: 12px 16px;
  border: 1px solid #10b981;
  border-radius: 8px;
  color: #e2e8f0;
  background: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

@media (max-width: 1024px) {
  .workspace-grid {
    max-width: 672px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header-inner,
  .subnav {
    padding-inline: 16px;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-links {
    flex-wrap: wrap;
    gap: 16px;
  }

  .terminal-shell {
    padding: 32px 16px 80px;
  }

  .terminal-card {
    padding: 24px;
  }

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

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