/*
 * Ghost Aperture Design System
 * Shared stylesheet — include in every GA site
 * Each page picks what it needs; nothing is forced.
 *
 * Usage: <link rel="stylesheet" href="/shared/ghostaperture.css">
 */

/* ─── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:   #0a0a0f;
  --bg2:  #12121a;
  --bg3:  #1a1a26;
  --bg4:  #0e0e16;

  /* Borders */
  --brd:  #1e1e2e;
  --brd2: #2a2a3e;

  /* Text */
  --t1: #e2e2f0;
  --t2: #7a7a96;
  --t3: #4a4a64;

  /* Accent — cyan */
  --acc:  #00d4aa;
  --accd: #00d4aa33;
  --accg: #00d4aa22;

  /* Semantic colors */
  --red:  #ff4466;
  --redd: #ff446633;
  --yel:  #ffaa22;
  --yeld: #ffaa2233;
  --blu:  #4488ff;
  --blud: #4488ff33;
  --grn:  #00d4aa;  /* alias for success */
  --grnd: #00d4aa33;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

code, pre, .mono, kbd {
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Layout Helpers ───────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header Component ─────────────────────────────────────────── */
/*
  Usage:
  <div class="ga-header">
    <div class="ga-header-left">
      <div class="ga-logo">👻</div>
      <h1>Ghost <span class="acc">Aperture</span></h1>
    </div>
    <div class="ga-header-right">
      <!-- buttons, status, etc -->
    </div>
  </div>
*/
.ga-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--brd);
  margin-bottom: 24px;
}

.ga-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ga-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ga-logo {
  width: 36px;
  height: 36px;
  background: var(--acc);
  border-radius: 9px;
  box-shadow: 0 0 20px var(--accd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ga-header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--t1);
}

/* ─── Divider ──────────────────────────────────────────────────── */
.ga-divider {
  width: 1px;
  height: 20px;
  background: var(--brd2);
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--brd2);
  border-radius: 7px;
  background: var(--bg2);
  color: var(--t1);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  background: var(--bg3);
  border-color: var(--acc);
  text-decoration: none;
}

.btn-acc {
  background: var(--acc);
  color: var(--bg);
  border-color: var(--acc);
}
.btn-acc:hover {
  background: #00efc0;
  border-color: #00efc0;
  color: var(--bg);
}

.btn-danger {
  background: var(--redd);
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--t2);
}
.btn-ghost:hover {
  background: var(--bg2);
  border-color: var(--brd2);
  color: var(--t1);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 9px;
}

.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ─── Forms ────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  letter-spacing: .5px;
  text-transform: uppercase;
}

input, textarea, select {
  background: var(--bg2);
  border: 1px solid var(--brd2);
  border-radius: 7px;
  color: var(--t1);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--accd);
}

input::placeholder, textarea::placeholder {
  color: var(--t3);
}

input[type="password"] {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
}

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 24px;
}

.card-sm {
  padding: 16px;
  border-radius: 9px;
}

/* ─── Alerts / Flash Messages ──────────────────────────────────── */
/*
  Usage:
  <div class="alert alert-error">Wrong password. Try again.</div>
  <div class="alert alert-success">Logged in!</div>
  <div class="alert alert-warn">Check your email.</div>
  <div class="alert alert-info">FYI something happened.</div>
*/
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error   { background: var(--redd); border-color: var(--red); color: var(--red); }
.alert-success { background: var(--grnd); border-color: var(--grn); color: var(--grn); }
.alert-warn    { background: var(--yeld); border-color: var(--yel); color: var(--yel); }
.alert-info    { background: var(--blud); border-color: var(--blu); color: var(--blu); }

/* ─── Status Dot ───────────────────────────────────────────────── */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--t3);
  flex-shrink: 0;
}
.status-dot.online  { background: var(--acc); box-shadow: 0 0 6px var(--acc); }
.status-dot.offline { background: var(--red); }
.status-dot.warn    { background: var(--yel); }

/* ─── Typography Utilities ─────────────────────────────────────── */
.acc    { color: var(--acc); }
.t2     { color: var(--t2); }
.t3     { color: var(--t3); }
.red    { color: var(--red); }
.yel    { color: var(--yel); }
.blu    { color: var(--blu); }

.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.text-lg  { font-size: 16px; }
.mono     { font-family: 'JetBrains Mono', monospace; }
.bold     { font-weight: 700; }
.muted    { color: var(--t2); }

/* ─── Login Card (used only by login page) ─────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: 16px;
  padding: 32px;
}

.login-card .ga-logo {
  margin: 0 auto 16px;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.5px;
  text-align: center;
  margin-bottom: 4px;
}

.login-card .subtitle {
  font-size: 13px;
  color: var(--t2);
  text-align: center;
  margin-bottom: 28px;
}

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

/* ─── Selection ────────────────────────────────────────────────── */
::selection { background: var(--accd); color: var(--acc); }
