:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: #121a31;
  --panel-2: #18223d;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --line: #273451;
  --accent: #7dd3fc;
  --accent-2: #a7f3d0;
  --danger: #fca5a5;
  --warning: #fcd34d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #172554 0, var(--bg) 40%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 32px clamp(20px, 5vw, 64px) 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -0.02em;
}

main {
  padding: 0 clamp(20px, 5vw, 64px) 48px;
}

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

.badge {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent-2);
}

.badge.muted {
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.08), rgba(167, 243, 208, 0.04));
  padding: 24px;
  border-radius: 20px;
  margin: 20px 0 36px;
}

.hero p {
  color: var(--muted);
  max-width: 70ch;
  margin-bottom: 0;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.flow span {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 10px;
  border-radius: 10px;
}

.flow b {
  color: var(--accent);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 12px;
}

.section-head p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 14px;
}

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

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h3 {
  margin: 0;
  font-size: 18px;
}

.card p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
  flex: 1;
}

.price {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 20px;
}

.row {
  display: flex;
  gap: 8px;
}

input,
button {
  font: inherit;
}

input[type="number"] {
  width: 72px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #082f49;
  font-weight: 700;
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.orders {
  display: grid;
  gap: 10px;
}

.order {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

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

.status {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.status.PAID,
.status.FULFILLED {
  color: var(--accent-2);
  border-color: rgba(167, 243, 208, 0.4);
}

.status.PENDING {
  color: var(--warning);
  border-color: rgba(252, 211, 77, 0.4);
}

.status.CANCELLED,
.status.FAILED {
  color: var(--danger);
  border-color: rgba(252, 165, 165, 0.4);
}

.notice {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 16px;
  border-radius: 12px;
  margin-top: 20px;
}

.notice.error {
  border-color: rgba(252, 165, 165, 0.5);
  color: var(--danger);
}

.notice.success {
  border-color: rgba(167, 243, 208, 0.5);
  color: var(--accent-2);
}

.hidden {
  display: none;
}

footer {
  padding: 0 clamp(20px, 5vw, 64px) 32px;
  color: var(--muted);
  font-size: 13px;
}

code {
  color: var(--accent);
}

@media (max-width: 760px) {
  .topbar,
  .hero,
  .section-head,
  .order {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    display: flex;
  }

  .hero {
    display: flex;
  }

  .flow {
    justify-content: flex-start;
  }
}

/* Auth */
.auth-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  margin: 20px 0 8px;
}

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

.auth-head h2 {
  margin: 0;
}

.auth-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input[type="email"],
input[type="password"] {
  flex: 1 1 220px;
  min-width: 180px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
}

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

.auth-user .row {
  align-items: center;
}

.auth-message {
  margin: 10px 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 14px;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--accent-2);
}

/* Admin table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 900px;
}

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

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.table td button {
  padding: 8px 12px;
  font-size: 13px;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px 14px;
}

.audit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.audit-head small {
  color: var(--muted);
}

.audit-item pre {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.status.PARTIALLY_REFUNDED,
.status.REFUNDED {
  color: var(--accent);
  border-color: rgba(125, 211, 252, 0.4);
}

.status.DISPUTED,
.status.NONE {
  color: var(--danger);
  border-color: rgba(252, 165, 165, 0.4);
}

@media (max-width: 760px) {
  .auth-user,
  .auth-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
