:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --dark: #0b1220;
  --text: #1a1f2e;
  --muted: #616b7f;
  --primary: #5b6cff;
  --primary-dark: #4655e5;
  --card: #ffffff;
  --border: #e3e7f1;
  --shadow: 0 20px 40px rgba(11, 18, 32, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  border: none;
  cursor: pointer;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(245, 247, 251, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.logo {
  font-weight: 700;
  font-size: 1.3rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-weight: 500;
  color: var(--muted);
  flex-wrap: wrap;
}

.language-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(91, 108, 255, 0.08);
}

.language-toggle .ghost {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.language-toggle .ghost.active {
  background: var(--primary);
  color: white;
}

.nav a:hover {
  color: var(--text);
}

.hero {
  padding: 80px 0 40px;
}

.hero-content {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.2;
  margin: 18px 0;
}

.hero-text p {
  color: var(--muted);
  margin-bottom: 24px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(91, 108, 255, 0.12);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.primary {
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  transition: 0.2s ease;
}

.primary.small {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: transparent;
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 12px;
  color: var(--text);
}

.secondary.small {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.ghost.small {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.nav button.ghost {
  padding: 6px 10px;
  border-radius: 10px;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.trust-row strong {
  display: block;
  font-size: 1.2rem;
  color: var(--text);
}

.exchange-card {
  background: var(--card);
  padding: 28px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.rate {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
}

form {
  display: grid;
  gap: 16px;
}

.form-status {
  color: var(--muted);
  font-size: 0.9rem;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.input-group {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

input,
select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid rgba(91, 108, 255, 0.3);
  border-color: var(--primary);
}

.quote {
  background: var(--bg);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.quote strong {
  color: var(--text);
  display: block;
  font-size: 1.1rem;
}

.full {
  width: 100%;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats {
  padding: 40px 0;
}

.stats-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  background: var(--card);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.features,
.steps {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 32px;
}

.section-title p {
  color: var(--muted);
}

.feature-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-grid article,
.step-list li {
  background: var(--card);
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.steps {
  background: #f0f3fb;
}

.step-list {
  display: grid;
  gap: 16px;
  list-style: none;
}

.step-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-list span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.cta {
  padding: 50px 0;
}

.page {
  padding: 80px 0 60px;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-header p {
  color: var(--muted);
}

.auth-card,
.info-card {
  background: var(--card);
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(520px, 90vw);
  margin: 0 auto;
}

.auth-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

.exchange-layout {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: flex-start;
}

.info-card ul {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-left: 18px;
  color: var(--muted);
}

.table-card {
  background: var(--card);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.admin-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tab-btn {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  transition: 0.2s ease;
}

.tab-btn.active {
  color: var(--primary);
  border-color: rgba(91, 108, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(91, 108, 255, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.table-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-action-btn {
  border: 1px solid var(--border);
}

.admin-action-btn:hover {
  color: var(--text);
  border-color: rgba(91, 108, 255, 0.4);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(91, 108, 255, 0.12);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.fee-input {
  width: 100%;
  max-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.fee-row.is-dirty {
  background: rgba(91, 108, 255, 0.08);
}

.fee-row.is-dirty .fee-input {
  border-color: rgba(91, 108, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(91, 108, 255, 0.15);
}

/* Wallet Balances Styles */
.balance-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.total-balance {
  font-size: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.total-balance span {
  font-size: 0.9rem;
  color: var(--muted);
}

.total-balance strong {
  font-size: 2rem;
  color: #1e9e5b;
}

.badge-hot {
  background: #ff6b35;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-deposit {
  background: #4ecdc4;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-error {
  background: #d14343;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.balance-subtotal {
  background: var(--bg);
  font-weight: bold;
  border-top: 2px solid var(--border);
}

.balance-subtotal td {
  padding: 0.75rem 1rem !important;
}

.address-code {
  background: var(--bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.address-code:hover {
  background: var(--border);
}


.log-filters {
  display: grid;
  gap: 16px;
  margin: 16px 0 20px;
}

.log-filter {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.log-filter-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.log-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.danger {
  background: #e24343;
  color: white;
}

.danger:hover {
  background: #c63535;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: rgba(17, 20, 35, 0.6);
  z-index: 1000;
}

.modal.is-visible {
  display: flex;
}

.modal-content {
  background: var(--card);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: min(720px, 94vw);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  margin-top: 16px;
}

.order-info p {
  margin: 8px 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.log-level {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.log-level--error {
  color: #e24343;
}

.log-level--warn {
  color: #e68a00;
}

.log-level--info {
  color: #2f6fed;
}

.log-level--debug {
  color: #6b7280;
}

.log-details {
  font-size: 0.85rem;
}

.log-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}

.log-details pre {
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
}

.mono {
  font-family: \"SFMono-Regular\", Consolas, \"Liberation Mono\", Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.subtle {
  color: var(--muted);
  font-size: 0.95rem;
}

.cta-content {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  background: var(--dark);
  color: white;
  padding: 30px;
  border-radius: 24px;
}

.site-footer {
  padding: 40px 0;
  background: #101827;
  color: #c7d0e0;
}

.footer-content {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.footer-content p {
  color: #9aa6bf;
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .cta-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-group {
    grid-template-columns: 1fr;
  }
}
