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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #4ade80;
  --accent-dim: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --mono: 'Courier New', Courier, monospace;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  color: var(--accent);
}

header p {
  color: var(--text-dim);
  margin-top: 0.5rem;
}

main {
  width: 100%;
  max-width: 600px;
}

footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

footer p + p {
  margin-top: 0.25rem;
}

/* Screens */
.screen {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.screen.active {
  display: block;
}

.screen h2 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

/* Fields */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--mono);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Button groups */
.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-group button {
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.btn-group button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-group button.selected {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* Info, errors, warnings */
.hint {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.info {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.error {
  color: var(--error);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.warning {
  color: var(--warning);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

/* Payment */
.payment-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.address-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
  margin: 1rem 0;
  cursor: pointer;
  transition: border-color 0.15s;
}

.address-box:hover {
  border-color: var(--accent);
}

.timer {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.timer strong {
  color: var(--accent);
}

.timer strong.urgent {
  color: var(--error);
}

/* Progress */
.progress-info {
  margin-bottom: 1.5rem;
}

.progress-info p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.progress-info span {
  font-family: var(--mono);
  color: var(--accent);
}

.progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s;
}

/* Results */
.result-box {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-box table {
  width: 100%;
  border-collapse: collapse;
}

.result-box td {
  padding: 0.5rem 0;
  vertical-align: top;
}

.result-box td:first-child {
  color: var(--text-dim);
  white-space: nowrap;
  padding-right: 1rem;
  width: 120px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
}

.result-box h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* Tables (estimate) */
#screen-estimate table {
  width: 100%;
  margin-bottom: 1.5rem;
}

#screen-estimate td {
  padding: 0.5rem 0;
}

#screen-estimate td:first-child {
  color: var(--text-dim);
}

#screen-estimate td:last-child {
  text-align: right;
  font-family: var(--mono);
  color: var(--accent);
}

/* Verify status */
#verify-status {
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

#verify-status.success {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.1);
}

#verify-status.error {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

#verify-status.loading {
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }

  .screen {
    padding: 1.5rem 1rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group button {
    width: 100%;
  }

  header h1 {
    font-size: 1.5rem;
  }
}
