/* ============================================================================
   QFORGE — Command Center theme (v2)
   Extracted from the original inline styles and extended for the productionized
   site. Same visual identity: orange-on-black terminal. Mobile-first, max 600px.
   ============================================================================ */

:root {
  --orange: #ff4500;
  --orange-soft: #ff6a33;
  --bg: #0a0a0a;
  --card: #161616;
  --card-2: #111;
  --border: #333;
  --border-soft: #222;
  --text: #fff;
  --muted: #888;
  --muted-2: #555;
  --green: #69f0ae;
  --blue: #55aaff;
  --red: #ff5555;
  --maxw: 600px;
  --radius: 15px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: sans-serif;
  margin: 0;
  padding: 0 0 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); }

/* ---- Top brand / hero (static, crawlable) ---- */
header.brand { width: 100%; max-width: var(--maxw); padding: 28px 20px 8px; text-align: center; }
.brand h1 {
  color: var(--orange); letter-spacing: -2px; margin: 0; font-size: 2.2em;
}
.brand .tagline { color: var(--muted); font-size: 13px; margin-top: 6px; letter-spacing: 0.5px; }

.hero { width: 100%; max-width: var(--maxw); padding: 12px 20px 0; }
.hero p { color: #bbb; font-size: 14px; line-height: 1.6; text-align: center; margin: 10px 0 0; }
.hero p strong { font-weight: normal; color: #ddd; }
.hero .pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.hero .pill {
  font-size: 11px; color: var(--orange); border: 1px solid var(--orange);
  border-radius: 999px; padding: 6px 12px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ---- Navigation ---- */
nav {
  width: 100%; max-width: var(--maxw); display: flex; background: var(--card-2);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
  overflow-x: auto; margin-top: 18px;
}
nav a {
  flex: 1; min-width: 100px; text-align: center; padding: 15px 0; font-size: 11px;
  font-weight: bold; color: var(--muted-2); text-transform: uppercase; transition: 0.3s;
  white-space: nowrap; text-decoration: none; display: block; cursor: pointer;
}
nav a:hover { background: #151515; color: var(--muted); }
nav a.active { color: var(--orange); border-bottom: 2px solid var(--orange); background: #1a1a1a; }
nav a.locked { opacity: 0.3; cursor: not-allowed; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); padding: 20px; }
.card {
  background: var(--card); padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.5); margin-bottom: 20px;
}

h2 {
  font-size: 1.2em; color: var(--orange); margin: 0 0 15px; text-transform: uppercase;
  border-left: 3px solid var(--orange); padding-left: 10px;
}
h3 { color: var(--text); font-size: 1em; margin: 0 0 8px; }

/* ---- Forms / buttons ---- */
button {
  background: var(--orange); color: #fff; border: none; padding: 15px; width: 100%;
  border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 14px;
}
button:hover { filter: brightness(1.2); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost { background: none; border: 1px solid var(--border); color: var(--orange); }
button.link { background: none; color: var(--muted-2); text-decoration: underline; font-size: 11px; }

input, select, textarea {
  background: #222; border: 1px solid #444; color: #fff; padding: 12px; margin: 5px 0;
  width: 100%; border-radius: 8px; font-size: 15px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange); }
textarea { height: 120px; font-family: monospace; resize: vertical; }
label { font-size: 10px; color: #666; font-weight: bold; text-transform: uppercase; }

.row { display: flex; gap: 8px; margin-top: 5px; }
.row > * { flex: 1; }

hr { border: 0; border-top: 1px solid var(--border-soft); margin: 20px 0; }

/* ---- Posts / downloads ---- */
.post-card { background: var(--card-2); border: 1px solid var(--border-soft); padding: 15px; border-radius: 12px; margin-bottom: 15px; }
.code-box {
  background: #000; padding: 12px; color: #0f0; font-family: monospace; font-size: 11px;
  overflow-x: auto; border-radius: 8px; margin-top: 10px; white-space: pre; border: 1px solid var(--border);
}
.dl-btn {
  background: #1a1a1a; color: var(--orange); text-decoration: none; display: inline-block;
  padding: 12px 20px; border-radius: 8px; border: 1px solid var(--orange); font-size: 13px;
  font-weight: bold; margin-top: 10px; text-align: center; cursor: pointer;
}
.dl-btn:hover { background: var(--orange); color: #fff; }
.dl-btn.disabled { opacity: 0.4; cursor: not-allowed; border-color: #444; color: #666; pointer-events: none; }

.empty-state { color: #666; font-size: 12px; text-align: center; padding: 30px 10px; line-height: 1.6; }

/* ---- Admin table ---- */
table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 10px; }
th, td { border: 1px solid var(--border); padding: 8px; text-align: left; }
th { color: var(--orange); }
td input { padding: 5px; width: 90%; background: #000; border: none; color: #fff; }

/* ---- Calculator ---- */
.calc-risk-btn { background: #222; border: 1px solid #444; color: var(--muted); padding: 10px; flex: 1; border-radius: 6px; cursor: pointer; text-align: center; }
.calc-risk-btn.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.calc-table tr:nth-child(even) { background: #1a1a1a; }
.calc-table td { border-bottom: 1px solid var(--border-soft); border-top: none; border-left: none; border-right: none; font-size: 12px; vertical-align: middle; }
.calc-warning { color: var(--red); font-size: 10px; display: block; margin-top: 2px; }
.calc-suggestion { color: var(--blue); font-size: 10px; display: block; margin-top: 2px; }
.calc-lot-big { font-size: 14px; font-weight: bold; color: var(--green); }
.tp-info { font-size: 10px; color: #aaa; display: block; margin-top: 3px; }

/* ---- Messages ---- */
.msg-box { border: 1px solid var(--border); padding: 10px; margin-bottom: 10px; border-radius: 8px; background: var(--card-2); }
.msg-header { display: flex; justify-content: space-between; font-size: 10px; color: #666; margin-bottom: 5px; border-bottom: 1px solid var(--border-soft); padding-bottom: 5px; }
.msg-body { font-size: 12px; color: #ddd; white-space: pre-wrap; }
.msg-type { color: var(--orange); font-weight: bold; }

/* ---- Utility ---- */
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 12px; }
.mt { margin-top: 15px; }

/* ---- Toast (replaces silent console.log failures) ---- */
#toast {
  position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%);
  background: #000; border: 1px solid var(--orange); color: var(--orange);
  font-family: monospace; font-size: 12px; padding: 12px 18px; border-radius: 10px;
  z-index: 1000; max-width: 90%; text-align: center; opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
#toast.show { opacity: 1; }
#toast.err { border-color: var(--red); color: var(--red); }

/* ---- Diagnosis bar ---- */
.diag-bar {
  position: fixed; bottom: 0; width: 100%; max-width: var(--maxw); background: #000;
  border-top: 1px solid var(--orange); color: var(--orange); font-family: monospace;
  font-size: 10px; padding: 12px; text-align: center; z-index: 999;
}

/* ---- Loader ---- */
#loader {
  position: fixed; inset: 0; background: var(--bg); display: flex; justify-content: center;
  align-items: center; z-index: 9999;
}
#loader h2 { color: var(--orange); font-family: monospace; border: none; padding: 0; }

footer {
  width: 100%; max-width: var(--maxw); padding: 20px; text-align: center;
  color: var(--muted-2); font-size: 11px; line-height: 1.7;
}
footer a { color: var(--muted); text-decoration: none; }
