@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');

:root {
  --bg:           #1a1a1a;
  --bg-card:      #242424;
  --bg-input:     #2c2c2c;
  --bg-hover:     #2f2f2f;
  --border:       #333333;
  --border-light: #3d3d3d;

  --text-primary:   #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted:     #666666;

  --accent:        #7c6fff;
  --accent-hover:  #9689ff;
  --discord:       #5865f2;
  --discord-hover: #4752c4;
  --danger:        #ff4d4d;
  --danger-hover:  #ff6666;
  --success:       #4caf80;
  --warn:          #e0943a;

  --radius:    10px;
  --radius-sm:  6px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 8px  rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Roboto Mono', monospace;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

body.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 10vh;
  min-height: 100vh;
}

.landing-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.landing-brand {
  position: relative;
  padding-bottom: 26px;
}

.logo {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  user-select: none;
  min-height: 1.15em;
}

.landing-brand-icon {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transform: translateX(-50%);
  user-select: none;
  pointer-events: none;
}

.logo.typing::after {
  content: '|';
  color: var(--accent);
  font-weight: 300;
  margin-left: 3px;
  animation: blink 0.65s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.btn-main-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: center;
}

.btn-gray {
  background: #242424;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 15px;
  font-size: 0.8rem;
  letter-spacing: 0.025em;
}
.btn-gray:hover:not(:disabled) {
  background: #2c2c2c;
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-gray:active:not(:disabled) {
  transform: scale(0.93);
  background: #1e1e1e;
}

.btn-landing-discord {
  padding: 9px 20px;
  font-size: 0.82rem;
}

/* ============================================================
   INTERIOR PAGES
   ============================================================ */

body.page {
  min-height: 100vh;
  padding: 40px 16px 80px;
}

.card-center {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.back-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text-secondary); }

.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.card-footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.card-footer-text a { color: var(--text-secondary); }
.card-footer-text a:hover { color: var(--text-primary); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Roboto Mono', monospace;
  padding: 11px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.input::placeholder { color: var(--text-muted); }

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 111, 255, 0.2);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-discord {
  background: var(--discord);
  color: #fff;
}
.btn-discord:hover:not(:disabled) { background: var(--discord-hover); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.discord-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


.alert {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.85rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.35);
  color: #ff8080;
}

.alert-success {
  background: rgba(76, 175, 128, 0.12);
  border: 1px solid rgba(76, 175, 128, 0.35);
  color: #80d4a8;
}

/* ============================================================
   COMING SOON
   ============================================================ */

.coming-soon-card {
  text-align: center;
  align-items: center;
}

.coming-soon-icon {
  font-size: 3rem;
  opacity: 0.35;
}

.coming-soon-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ============================================================
   ACTIVATION STEPS — success / warning icons
   ============================================================ */

.success-icon {
  font-size: 3rem;
  color: var(--success);
  text-align: center;
}

.warn-icon {
  font-size: 3rem;
  color: var(--warn);
  text-align: center;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.dashboard-wrap {
  max-width: 840px;
  margin: 0 auto;
  padding: 32px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Landing page signed-in bar — fixed top-right */
.landing-session-bar {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

/* Login / activate page signed-in bar */
.page-session-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.signed-in-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.signed-in-label #signed-in-name {
  color: var(--text-secondary);
  font-weight: 600;
}

.dash-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Keys grid */
.keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.key-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.key-card--blacklisted {
  border-color: rgba(255, 77, 77, 0.35);
  opacity: 0.65;
}

.key-card--paused {
  border-color: rgba(224, 148, 58, 0.35);
}

.key-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.key-display {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

/* Badges */
.badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.badge--ok      { background: rgba(76, 175, 128, 0.15); color: var(--success); }
.badge--danger  { background: rgba(255, 77, 77, 0.15);  color: var(--danger);  }
.badge--warn    { background: rgba(224, 148, 58, 0.15); color: var(--warn);    }

.key-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.key-meta-item {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.key-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   SCRIPT MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* Code block */
.code-block {
  background: #111111;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  user-select: all;
}

/* Lua syntax highlight */
.lua-kw   { color: #7c6fff; font-weight: 600; }  /* keywords */
.lua-str  { color: #a8d8a8; }                     /* strings  */
.lua-fn   { color: #87ceeb; }                     /* function calls */
.lua-ident{ color: #e8e8e8; }                     /* identifiers */
.lua-op   { color: #d4d4d4; }                     /* operators / punctuation */

/* ============================================================
   LOADING / STATE MESSAGES
   ============================================================ */

.state-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 0;
}

.state-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   TURNSTILE
   ============================================================ */

.turnstile-wrap {
  display: flex;
  justify-content: center;
}

/* ============================================================
   UTILITY
   ============================================================ */

.hidden { display: none !important; }
