/* SecureVault – Deliberately Vulnerable Captive Portal */
/* Aesthetic: Industrial / Terminal — dark, acid-green accent, monospace edge */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:        #080a0c;
  --bg2:       #0f1215;
  --bg3:       #161b20;
  --border:    #1e2530;
  --border2:   #2a3340;
  --accent:    #c8ff00;
  --accent2:   #00ff88;
  --danger:    #ff3b3b;
  --warn:      #ffaa00;
  --text:      #e8edf2;
  --text2:     #8a9aaa;
  --text3:     #4a5a6a;
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
  --radius:    6px;
  --card-shadow: 0 0 0 1px var(--border), 0 4px 32px rgba(0,0,0,0.6);
}

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

html { font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── LOGIN PAGE ─────────────────────────────────────── */

body.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(200,255,0,0.06) 0%, transparent 70%),
    var(--bg);
}

.portal-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 2.5rem 2rem;
  box-shadow: var(--card-shadow);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.brand-icon {
  width: 44px; height: 44px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-icon svg { width: 28px; height: 28px; }

.brand-name {
  display: block;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 1.75rem;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 6px var(--accent2);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Forms */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.optional {
  font-weight: 400;
  color: var(--text3);
  text-transform: none;
  letter-spacing: 0;
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-group input::placeholder { color: var(--text3); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Buttons */
.btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  padding: 0.55rem 1rem;
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

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

.btn-logout {
  font-size: 0.82rem;
  color: var(--text3);
  text-decoration: none;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}
.btn-logout:hover { color: var(--text); border-color: var(--border2); }

.btn-danger {
  padding: 0.4rem 0.75rem;
  background: rgba(255,59,59,0.12);
  color: var(--danger);
  border: 1px solid rgba(255,59,59,0.3);
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(255,59,59,0.22); }

.btn-danger-sm {
  padding: 0.25rem 0.6rem;
  background: rgba(255,59,59,0.1);
  color: var(--danger);
  border: 1px solid rgba(255,59,59,0.25);
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
}

.form-footer {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.2rem;
  font-size: 0.82rem;
}
.form-footer a { color: var(--text2); text-decoration: none; }
.form-footer a:hover { color: var(--accent); }
.divider { color: var(--text3); }

/* Debug panel */
.debug-panel {
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: rgba(255,170,0,0.06);
  border: 1px solid rgba(255,170,0,0.2);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--warn);
  line-height: 1.7;
}

.form-error {
  background: rgba(255,59,59,0.1);
  border: 1px solid rgba(255,59,59,0.25);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 0.82rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
}

.portal-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text3);
  padding: 0.5rem;
}
.portal-footer a { color: var(--text3); }
.portal-footer a:hover { color: var(--accent); }

.hint-text {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 0.75rem;
}

/* ─── TOPBAR ─────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-small {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.session-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
}

.admin-topbar { border-bottom-color: rgba(255,170,0,0.3); background: #0d0e0a; }
.admin-badge {
  font-size: 0.65rem;
  background: rgba(255,170,0,0.15);
  color: var(--warn);
  border: 1px solid rgba(255,170,0,0.3);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.08em;
  margin-left: 0.4rem;
}

/* ─── DASHBOARD ──────────────────────────────────────── */

body.dashboard-page,
body.admin-page,
body.buy-page,
body.tos-page { background: var(--bg); }

.dash-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.welcome-banner {
  margin-bottom: 2rem;
}
.welcome-banner h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.welcome-banner p { color: var(--text2); font-size: 0.9rem; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1rem;
}

.card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
  margin-bottom: 0.6rem;
}

.card-value {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.card-value span { font-size: 1rem; color: var(--text2); }

.card-value-sm {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
  word-break: break-all;
}

.card-sub {
  font-size: 0.75rem;
  color: var(--text3);
}
.card-sub a { color: var(--accent); text-decoration: none; font-size: 0.78rem; }

.usage-bar {
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin-bottom: 0.4rem;
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s;
}

.dash-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.network-info {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 1.25rem;
}
.network-info h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.info-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.info-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
}
.info-table td:first-child { color: var(--text3); width: 40%; }
.info-table td:last-child { color: var(--accent2); }
.info-table tr:last-child td { border-bottom: none; }

/* ─── ADMIN ──────────────────────────────────────────── */

.admin-login-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem;
}

.admin-login-gate .portal-card { max-width: 360px; width: 100%; }
.admin-login-gate h2 { margin-bottom: 1.5rem; font-size: 1.1rem; }

.admin-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.admin-panel {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 1.25rem;
}

.admin-panel.full-width { grid-column: 1 / -1; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.panel-header h3 { font-size: 0.88rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }
.panel-header input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  color: var(--text);
  font-family: var(--mono);
  outline: none;
  width: 200px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--mono);
}
.admin-table th {
  text-align: left;
  color: var(--text3);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-weight: 500;
}
.admin-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.voucher-list {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent2);
  line-height: 2;
}

.voucher-code {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent2);
  display: inline-block;
  margin: 0.1rem;
}

.log-viewer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.8;
  max-height: 220px;
  overflow-y: auto;
}
.log-line { color: var(--text2); }
.log-line:hover { color: var(--text); }
.log-match { color: var(--warn); font-size: 0.8rem; margin-top: 0.5rem; font-family: var(--mono); }

/* ─── BUY PAGE ───────────────────────────────────────── */

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.plan-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.plan-card.selected { border-color: var(--accent); background: rgba(200,255,0,0.04); }
.plan-card.featured { border-color: var(--border2); }

.plan-ribbon {
  position: absolute;
  top: 12px; right: -22px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 2rem;
  transform: rotate(40deg);
  letter-spacing: 0.06em;
}

.plan-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 0.75rem;
}

.plan-price {
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.plan-price span { font-size: 1rem; color: var(--text2); }

.plan-data {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.plan-features { font-size: 0.82rem; color: var(--text2); line-height: 2; }

.payment-form {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 1.75rem;
  max-width: 440px;
  margin-bottom: 2rem;
}
.payment-form h3 { margin-bottom: 1.25rem; font-size: 1rem; }

.success-icon {
  width: 56px; height: 56px;
  background: rgba(0,255,136,0.12);
  border: 2px solid var(--accent2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--accent2);
  margin: 0 auto 1rem;
}

.voucher-code-big {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  display: inline-block;
  margin: 0.5rem 0;
}

/* ─── TOS PAGE ───────────────────────────────────────── */

.tos-container { max-width: 700px; }
.tos-container h1 { margin-bottom: 0.25rem; }
.tos-date { font-size: 0.8rem; color: var(--text3); margin-bottom: 2rem; }
.tos-body h2 { font-size: 1rem; margin: 1.5rem 0 0.5rem; color: var(--text); }
.tos-body p, .tos-body li { font-size: 0.88rem; color: var(--text2); line-height: 1.7; }
.tos-body ul { padding-left: 1.5rem; margin-top: 0.5rem; }
.tos-body li { margin-bottom: 0.3rem; }

.api-docs { display: flex; flex-direction: column; gap: 0.75rem; }
.api-endpoint {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
}
.api-endpoint code {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent2);
  margin-left: 0.5rem;
}
.api-endpoint p { font-size: 0.8rem; color: var(--text2); margin-top: 0.35rem; }
.api-endpoint code + code { margin-left: 0; color: var(--text3); }

.method {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.method.get { background: rgba(0,255,136,0.12); color: var(--accent2); }
.method.post { background: rgba(200,255,0,0.12); color: var(--accent); }
.method.delete { background: rgba(255,59,59,0.12); color: var(--danger); }

/* ─── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
