/* Dark fintech UI (responsive, no frameworks) */

:root {
  --bg-0: #070b12;
  --bg-1: #0a0f18;
  --card-0: #121a25;
  --card-1: #0f1621;
  --text: #e8eef7;
  --muted: #a6b2c4;
  --border: #233044;
  --shadow: 0 12px 38px rgba(0,0,0,0.45);

  --primary: #2ecc71;
  --primary-2: #26b863;
  --danger: #e05252;
  --danger-2: #c64545;
  --secondary: #1a2534;
  --secondary-2: #162030;

  --focus: rgba(46, 204, 113, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% 0%, rgba(255,255,255,0.06), rgba(255,255,255,0.0) 60%),
    radial-gradient(900px 500px at 20% 30%, rgba(46,204,113,0.08), rgba(46,204,113,0.0) 70%),
    radial-gradient(900px 500px at 80% 40%, rgba(59,130,246,0.08), rgba(59,130,246,0.0) 70%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

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

.brand {
  font-weight: 800;
  letter-spacing: 0.3px;
  font-size: 16px;
  opacity: 0.95;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.card {
  background: linear-gradient(180deg, var(--card-0), var(--card-1));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}

h3 {
  margin: 0;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.25px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  display: block;
  margin: 14px 0;
}

input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7,11,18,0.65);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

input:focus {
  border-color: rgba(46,204,113,0.65);
  box-shadow: 0 0 0 4px var(--focus);
}

button {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7,11,18,0.35);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.04s ease, filter 0.12s ease, background 0.12s ease;
}

button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.2); }

.primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-color: rgba(46,204,113,0.55);
  color: #06110a;
  font-weight: 800;
}

.danger {
  background: linear-gradient(180deg, var(--danger), var(--danger-2));
  border-color: rgba(224,82,82,0.55);
  color: #140707;
  font-weight: 800;
}

.secondary {
  background: linear-gradient(180deg, var(--secondary), var(--secondary-2));
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 12px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
}

.hidden { display: none !important; }

.auth-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  padding: 10px 14px;
  border-radius: 12px;
}

.tab.active {
  background: rgba(7,11,18,0.55);
  border-color: rgba(46,204,113,0.35);
}

.wizard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.wizard-desc { margin-top: 6px; max-width: 46ch; }

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(7,11,18,0.35);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.step {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 18px;
}

.step:first-of-type {
  border-top: none;
  padding-top: 0;
}

.step-desc {
  text-align: center;
  margin-top: 8px;
}

.summary {
  background: rgba(7,11,18,0.45);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
}

.address-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(7,11,18,0.45);
}

.address-row .mono {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 14px auto 12px auto;
  border-radius: 999px;
  border: 4px solid rgba(255,255,255,0.12);
  border-top-color: rgba(46,204,113,0.85);
  animation: spin 0.9s linear infinite;
}

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

.history-table-wrap {
  margin-top: 14px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(7,11,18,0.35);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.history-table th,
.history-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
  font-size: 13px;
}

.history-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.25px;
}

.history-table tr:last-child td { border-bottom: none; }

.right { text-align: right; }

.actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(7,11,18,0.25);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
}

.status-waiting .status-dot { background: rgba(59,130,246,0.9); }
.status-not-received .status-dot { background: rgba(224,82,82,0.9); }
.status-paid .status-dot { background: rgba(46,204,113,0.95); }
.status-done .status-dot { background: rgba(46,204,113,0.65); }
.status-draft .status-dot { background: rgba(255,255,255,0.35); }

.history-cards {
  display: none;
  margin-top: 14px;
  gap: 12px;
}

.history-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(7,11,18,0.35);
}

.history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.history-card-grid {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

@media (max-width: 720px) {
  .container { padding: 16px; }
  .card { padding: 18px; }
  .brand { font-size: 15px; }
  h3 { font-size: 17px; }
  input { padding: 11px 13px; }
  .row { flex-direction: column; align-items: stretch; }
  .row button { width: 100%; }
  .auth-form button { width: 100%; }
  .actions { width: 100%; justify-content: stretch; }
  .history-table-wrap { display: none; }
  .history-cards { display: grid; }
}

.footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  opacity: 0.9;
}
