:root {
  --ink: #1a1a2e;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
  --bg: #fafafa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.wrap {
  max-width: 480px;
  margin: 8vh auto;
  padding: 0 20px;
}

.wrap.wide {
  max-width: 720px;
  margin-top: 5vh;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button.secondary { background: white; color: var(--ink); border: 1px solid var(--border); }
button.secondary:hover { background: #f3f4f6; }
button.danger { background: white; color: var(--danger); border: 1px solid #fecaca; }
button.danger:hover { background: #fef2f2; }

.full { width: 100%; margin-top: 20px; }

.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 16px;
  display: none;
}
.error.show { display: block; }

.foot {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
.foot a { color: var(--accent); text-decoration: none; }

/* Dashboard-specific */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge.active { background: #dcfce7; color: var(--success); }
.badge.inactive { background: #fef3c7; color: #92400e; }

.alias-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.alias-form input { flex: 1; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 4px; border-bottom: 1px solid var(--border); }
td { padding: 10px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.revoked { color: var(--muted); text-decoration: line-through; }
.empty-state { text-align: center; color: var(--muted); padding: 32px 0; font-size: 14px; }

.subscribe-block {
  text-align: center;
  padding: 32px 0;
}
.price { font-size: 32px; font-weight: 700; margin: 8px 0; }
.price span { font-size: 14px; font-weight: 400; color: var(--muted); }

.renew-note {
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 20px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
  text-align: center;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 12px;
}
.plan-card .plan-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.plan-card .price { font-size: 26px; margin: 6px 0 14px; }
.plan-card button { width: 100%; }
.plan-line {
  font-size: 12px;
  color: var(--muted);
}
