/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --bg-card:   #1a1d27;
  --border:    #2a2d3a;
  --text:      #e8eaf0;
  --muted:     #8b90a0;
  --accent:    #4f8ef7;
  --accent-h:  #3a7ae8;
  --green:     #3ecf8e;
  --red:       #f56565;
  --radius:    8px;
  --max-w:     1100px;
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --surface:   #1a1d27;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
.nav__logo:hover { opacity: 0.85; }
.nav__logo-img {
  height: 28px;
  width: auto;
  display: block;
  max-width: 140px;
  object-fit: contain;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__links a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.15s;
}

.nav__links a:hover { color: var(--text); text-decoration: none; }

.nav__links a:last-child {
  background: var(--accent);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background 0.15s;
}

.nav__links a:last-child:hover { background: var(--accent-h); }

/* ── Main ── */
main { flex: 1; }

/* ── Hero ── */
.hero {
  position: relative;
  text-align: center;
  padding: 8rem 2rem 6rem;
  background-image: url('/img/hero.png');
  background-size: cover;
  background-position: center 30%;
  margin-bottom: 0;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(10,10,15,0.55) 0%,
    rgba(10,10,15,0.45) 50%,
    rgba(10,10,15,0.85) 100%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #e8eaf0 0%, #8b90a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 2.5rem;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover { background: var(--accent-h); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Features ── */
.features {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

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

/* ── Pricing ── */
.pricing {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}

.pricing h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.pricing__subtitle {
  color: var(--muted);
  margin-bottom: 3rem;
}

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  text-align: left;
}

.pricing__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pricing__card--featured {
  border-color: var(--accent);
}

.pricing__card h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.pricing__price {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.pricing__price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
}

.pricing__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.pricing__features li {
  font-size: 0.9rem;
  color: var(--muted);
  padding-left: 1.25rem;
  position: relative;
}

.pricing__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* ── Auth forms ── */
.auth {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auth h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.auth form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.auth input[type="email"],
.auth input[type="password"],
.auth input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s;
}

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

.auth button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}

.auth button[type="submit"]:hover { background: var(--accent-h); }

.auth p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* ── Flash messages ── */
.flash {
  max-width: var(--max-w);
  margin: 1rem auto;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.flash--error {
  background: rgba(245, 101, 101, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
}

.flash--success {
  background: rgba(62, 207, 142, 0.1);
  border: 1px solid var(--green);
  color: var(--green);
}

/* ── Error pages ── */
.error {
  max-width: 540px;
  margin: 6rem auto;
  padding: 2rem;
  text-align: center;
}

.error h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.error p { color: var(--muted); margin-bottom: 1.5rem; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer nav {
  display: flex;
  gap: 1.5rem;
}

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

/* ── Dashboard ── */
.dashboard {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem;
}

.dashboard h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}


.dashboard-header { margin-bottom: 2rem; }
.dashboard-email { color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }

/* Plan status card */
.plan-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.plan-status-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.plan-name {
  font-size: 1.2rem;
  font-weight: 700;
}
.plan-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-badge--trialing { background: rgba(79,142,247,0.15); color: var(--accent); }
.plan-badge--active   { background: rgba(34,197,94,0.15);  color: #22c55e; }
.plan-badge--past_due { background: rgba(239,68,68,0.15);  color: #ef4444; }
.plan-warning { color: #ef4444; font-size: 0.9rem; margin: 0; }

/* Instances */
.instances-section { margin-bottom: 2rem; }
.instances-section h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.instances-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  color: var(--muted);
}

/* Upgrade section */
.upgrade-section { margin-bottom: 2rem; }
.upgrade-section h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.upgrade-subtitle { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

/* Pricing grid (dashboard) */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}
.pricing-card--featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.pricing-card-badge {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.pricing-card-header h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.pricing-price { display: flex; align-items: baseline; gap: 0.15rem; }
.price-amount { font-size: 2rem; font-weight: 800; }
.price-period { color: var(--muted); font-size: 0.9rem; }
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.pricing-features li { font-size: 0.88rem; color: var(--muted); padding-left: 1.1rem; position: relative; }
.pricing-features li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Buttons */
.btn { display: inline-block; padding: 0.6rem 1.25rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: opacity 0.15s; text-decoration: none; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--muted); padding: 0.4rem 0; }
.btn-ghost:hover { color: var(--text); opacity: 1; }
.btn-full { width: 100%; text-align: center; }

/* Alerts */
.alert { padding: 0.85rem 1.25rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: 0.9rem; }
.alert-error { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* Logout */
.logout-form { margin-top: 1rem; }
.logout-btn { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav { padding: 1rem; }
  .hero { padding: 3rem 1rem 2rem; }
  .features, .pricing { padding: 2rem 1rem; }
  .footer { flex-direction: column; text-align: center; }
}

/* Credential prompt banner */
.credential-prompt {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #fcd34d;
}
.credential-prompt strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #fbbf24;
}
.credential-prompt p {
  margin: 0;
  color: #e5e7eb;
  line-height: 1.5;
}
.credential-prompt code {
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.85em;
  color: #fcd34d;
}

/* Alert variants */
.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #fcd34d;
  font-size: 0.9rem;
}
.alert-warning strong { color: #fbbf24; }
.alert-link {
  color: #fbbf24;
  text-decoration: underline;
  margin-left: 0.5rem;
}
.alert-link:hover { color: #fff; }

/* ── btn-sm ── */
.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* ── Slug input ── */
.slug-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.slug-input-group label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.slug-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.slug-input-wrap:focus-within {
  border-color: var(--accent);
}
.input-slug {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  min-width: 0;
}
.input-slug::placeholder { color: var(--muted); }
.slug-suffix {
  background: rgba(255,255,255,0.04);
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.55rem 0.65rem;
  white-space: nowrap;
  user-select: none;
}

/* ── Engine picker ── */
.engine-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.engine-picker-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.engine-picker-options {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.engine-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.engine-option:not(:last-child) {
  border-right: 1px solid var(--border);
}
.engine-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.engine-option {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.5rem;
  width: 100%;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
}
.engine-option span {
  font-size: 0.85rem;
  font-weight: 500;
  color: inherit;
  pointer-events: none;
}
.engine-option:has(input:checked) {
  background: rgba(79,142,247,0.30) !important;
  color: #fff !important;
  border-bottom: 2px solid var(--accent);
}
.engine-option:hover:not(:has(input:checked)) {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

/* ── Instance cards ── */
.instances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.instance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s;
}
.instance-card--running  { border-color: rgba(62, 207, 142, 0.35); }
.instance-card--stopped  { border-color: var(--border); }
.instance-card--error    { border-color: rgba(239, 68, 68, 0.35); }

.instance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.instance-engine {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.instance-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.instance-badge--running      { background: rgba(62,207,142,0.15);  color: var(--green); }
.instance-badge--stopped      { background: rgba(139,144,160,0.15); color: var(--muted); }
.instance-badge--provisioning { background: rgba(79,142,247,0.15);  color: var(--accent); }
.instance-badge--error        { background: rgba(239,68,68,0.15);   color: var(--red); }

.instance-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.instance-subdomain {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.instance-address {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  font-family: monospace;
}
.instance-address strong {
  color: var(--muted);
  font-weight: 600;
}

.instance-card-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ── Admin ── */
.admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.admin-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
}
.admin-tile--warn { border-color: rgba(239,68,68,0.4); }
.admin-tile-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.35rem;
}
.admin-tile--warn .admin-tile-value { color: var(--red); }
.admin-tile-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.admin-section {
  margin-bottom: 3rem;
}
.admin-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.admin-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  color: var(--text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-muted { color: var(--muted) !important; font-size: 0.8rem; }
.admin-meta {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-empty {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 1.5rem !important;
}

.alert-success {
  background: rgba(62, 207, 142, 0.1);
  border: 1px solid rgba(62, 207, 142, 0.35);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: var(--green);
  font-size: 0.9rem;
}

/* ── Admin tile drilldown ── */
.admin-tile--link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.admin-tile--link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.admin-tile--link .admin-tile-value,
.admin-tile--link .admin-tile-label {
  color: inherit;
}
.admin-tile--link .admin-tile-label { color: var(--muted); }

/* ── Admin filter tabs ── */
.admin-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.admin-filter-tab {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: capitalize;
  transition: border-color 0.15s, color 0.15s;
}
.admin-filter-tab:hover { border-color: var(--accent); color: var(--text); }
.admin-filter-tab.active { border-color: var(--accent); color: var(--accent); background: rgba(79,142,247,0.08); }

/* ── btn-danger ── */
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.35);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.28);
  border-color: var(--red);
}

/* ── Instance card play theme row ── */
.instance-theme-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0 0;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.instance-theme-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.input-theme {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}
.input-theme:focus { outline: none; border-color: var(--accent); }

/* ── Legal pages ── */
.legal-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
.legal-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.legal-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.legal-meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.faq-sections {
  margin-top: 1rem;
}
.faq-section {
  margin-bottom: 3rem;
}
.faq-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.faq-item {
  margin-bottom: 1.75rem;
}
.faq-item h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.faq-item p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0;
}
.legal-body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2rem 0 0.6rem;
  color: var(--text);
}
.legal-body p, .legal-body li {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--muted);
}
.legal-body a { color: var(--accent); }
.legal-body ul {
  padding-left: 1.4rem;
  margin: 0.4rem 0 0.8rem;
}
.legal-body li { margin-bottom: 0.3rem; }

/* ── Cookie consent banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  z-index: 1000;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}
.cookie-banner-text {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
  min-width: 200px;
}
.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Dashboard background ── */
.dashboard {
  position: relative;
  min-height: 100vh;
}
body:has(.dashboard) {
  background-image: url('/img/dashboard-bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body:has(.dashboard)::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.82);
  pointer-events: none;
  z-index: 0;
}
body:has(.dashboard) .dashboard { position: relative; z-index: 1; }

/* ── Delete account ── */
.delete-account-section { margin-top: 1.5rem; }
.btn-delete-account {
  background: none;
  border: 1px solid #4a2020;
  color: #a05050;
  font-size: 0.75rem;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-delete-account:hover { border-color: #ef4444; color: #ef4444; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay.visible { display: flex; }
.modal-box {
  background: #0a0000;
  border: 2px solid #ef4444;
  border-radius: 10px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 40px rgba(239,68,68,0.4), 0 0 80px rgba(239,68,68,0.15);
}
.modal-title { font-size: 1.25rem; color: #ef4444; margin-bottom: 1rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.modal-body { font-size: 0.875rem; color: #e0e0e0; margin-bottom: 0.75rem; line-height: 1.6; }
.modal-body strong { color: #ef4444; font-weight: 800; }
.input-delete-confirm {
  width: 100%;
  margin: 0.5rem 0 1.25rem;
  padding: 0.5rem 0.75rem;
  background: #1a0000;
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  font-weight: 700;
}
.input-delete-confirm::placeholder { color: #7f1d1d; letter-spacing: 0.15em; }
.input-delete-confirm:focus { outline: none; box-shadow: 0 0 0 2px rgba(239,68,68,0.4); }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
.btn-confirm-delete {
  background: #7f1d1d;
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-confirm-delete:hover:not(:disabled) { background: #ef4444; color: #fff; }
.btn-confirm-delete:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-link { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ── Plan status card additions ── */
.plan-meta { font-size: 0.8rem; color: var(--muted, #888); margin: 0.4rem 0; }
.plan-trial-warning { font-size: 0.82rem; color: #f59e0b; margin: 0.4rem 0; }
.plan-trial-warning strong { color: #fbbf24; }
.plan-resources {
  font-size: 0.78rem;
  color: var(--muted, #888);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin: 0.75rem 0;
}
.plan-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 600px) {
  .plan-resource-grid { grid-template-columns: repeat(2, 1fr); }
}
.plan-resource-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.plan-resource-label {
  font-size: 0.7rem;
  color: var(--muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-resource-value {
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--accent, #4f8ef7);
  font-weight: 600;
}
.resource-at-limit {
  color: #f59e0b;
}
.plan-upgrade-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted, #888);
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 0.25rem;
}
.plan-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

/* ── Billing manage page ── */
.manage-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.manage-back {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted, #888);
  text-decoration: none;
  margin-bottom: 1.25rem;
}
.manage-back:hover { color: var(--accent, #4f8ef7); }
.manage-header { margin-bottom: 2rem; }
.manage-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.35rem; }
.manage-sub { font-size: 0.88rem; color: var(--muted, #888); }
.manage-sub strong { color: var(--text, #e2e8f0); }

.manage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .manage-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .manage-grid { grid-template-columns: 1fr; } }

.manage-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: border-color 0.2s;
}
.manage-card--current {
  border-color: var(--accent, #4f8ef7);
  background: rgba(79,142,247,0.05);
}
.manage-card--featured {
  border-color: rgba(79,142,247,0.35);
}
.manage-card-badge {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  white-space: nowrap;
}
.manage-card-badge--current {
  background: var(--accent, #4f8ef7);
  color: #fff;
}
.manage-card-badge--popular {
  background: rgba(79,142,247,0.15);
  color: var(--accent, #4f8ef7);
  border: 1px solid rgba(79,142,247,0.3);
}
.manage-card-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text, #e2e8f0);
  margin-bottom: 0.35rem;
}
.manage-card-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text, #e2e8f0);
  line-height: 1;
}
.manage-card-price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted, #888);
}
.manage-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted, #888);
  flex: 1;
}
.manage-card-features li::before {
  content: '✓ ';
  color: var(--accent, #4f8ef7);
  font-weight: 700;
}
.manage-card-action {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.btn-manage {
  width: 100%;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
}
.btn-manage--current {
  background: rgba(79,142,247,0.12);
  color: var(--accent, #4f8ef7);
  border: 1px solid var(--accent, #4f8ef7);
  cursor: default;
  opacity: 0.7;
}
.btn-manage--upgrade {
  background: var(--accent, #4f8ef7);
  color: #fff;
}
.btn-manage--upgrade:hover { opacity: 0.88; }
.btn-manage--downgrade {
  background: rgba(255,255,255,0.05);
  color: var(--muted, #888);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-manage--downgrade:hover { color: var(--text, #e2e8f0); border-color: rgba(255,255,255,0.2); }
.btn-manage-link {
  background: none;
  border: none;
  color: var(--muted, #888);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  padding: 0;
  text-decoration: underline;
}
.btn-manage-link:hover { color: var(--text, #e2e8f0); }

/* ── Upgrade confirmation modal ── */
#upgradeModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#upgradeModal .modal-box {
  border-color: rgba(79,142,247,0.4);
  box-shadow: 0 0 40px rgba(79,142,247,0.15), 0 0 80px rgba(79,142,247,0.07);
}
.modal-box {
  background: #13181f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.modal-box h3 { font-size: 1.1rem; font-weight: 700; }
.modal-box p { font-size: 0.88rem; color: var(--text, #e2e8f0); }
.modal-note { font-size: 0.78rem; color: var(--muted, #888); }
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ── Coming soon badge ── */
.coming-soon {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(79,142,247,0.12);
  color: #4f8ef7;
  border: 1px solid rgba(79,142,247,0.25);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  vertical-align: middle;
  margin-left: 0.3rem;
}

/* ── Custom Domain ── */
.instance-card-domain { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.custom-domain-form {}
.custom-domain-input-row { display:flex; gap:0.5rem; align-items:center; margin-bottom:0.4rem; }
.input-domain { flex:1; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:0.4rem 0.75rem; color:var(--text); font-size:0.9rem; }
.input-domain:focus { outline:none; border-color:var(--accent); }
.custom-domain-hint { font-size:0.78rem; color:var(--muted); margin:0; }
.custom-domain-hint code { color:var(--accent); background:rgba(79,142,247,0.1); padding:0.1rem 0.3rem; border-radius:3px; }
.custom-domain-error { font-size:0.78rem; color:var(--red); margin:0.3rem 0 0; }
.custom-domain-success { font-size:0.78rem; color:var(--green); margin:0.3rem 0 0; }
.custom-domain-active { display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; font-size:0.9rem; }
.custom-domain-label { color:var(--muted); font-size:0.78rem; }
.custom-domain-value { color:var(--accent); font-weight:500; }
.btn-link--danger { color:var(--red); font-size:0.78rem; }
.btn-link--danger:hover { opacity:0.8; }

.custom-domain-guide-link { color:var(--accent); font-size:0.78rem; white-space:nowrap; }
