/* DataLeeks — clean, shop-like styling. Fully self-contained: no @import,
   no web fonts, no external images. Everything is inline or same-origin. */

:root {
  --leek-dark: #2f6b2f;
  --leek: #4c9a4c;
  --leek-light: #7cc47c;
  --leek-pale: #e8f4e6;
  --cream: #fbfaf4;
  --ink: #253023;
  --muted: #6b7a68;
  --line: #d8e4d2;
  --white: #ffffff;
  --danger: #b5473b;
  --warn-bg: #fff4d6;
  --warn-line: #e6c765;
  --warn-ink: #7a5a12;
  --shadow: 0 1px 3px rgba(30, 60, 30, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
}

/* --- Training banner: sticky, unmissable --------------------------------- */
.training-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-bottom: 2px solid var(--warn-line);
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* --- Header / nav -------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--leek-dark);
}

.brand .logo { width: 34px; height: 44px; flex: none; }

.brand .wordmark { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.brand .tagline { font-size: 0.72rem; color: var(--muted); font-weight: 500; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--leek-dark);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
}
.site-nav a:hover { background: var(--leek-pale); }

/* the disabled Admin item (VULN #2) */
.nav-disabled {
  color: var(--muted) !important;
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* --- Layout ------------------------------------------------------------- */
main { max-width: 960px; margin: 1.5rem auto; padding: 0 1.25rem; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; color: var(--leek-dark); font-size: 1.15rem; }
.card h3 { color: var(--leek-dark); font-size: 1rem; margin-bottom: 0.4rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- Login -------------------------------------------------------------- */
.login-wrap { display: flex; justify-content: center; margin-top: 2.5rem; }
.login-card { width: 100%; max-width: 380px; }

label { display: block; font-weight: 600; font-size: 0.85rem; margin: 0.7rem 0 0.25rem; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus { outline: 2px solid var(--leek-light); border-color: var(--leek); }

.demo-hint {
  background: var(--leek-pale);
  border: 1px dashed var(--leek-light);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  margin: 0.9rem 0;
}

button, .btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  background: var(--leek);
  color: white;
}
button:hover, .btn:hover { background: var(--leek-dark); }
button.secondary {
  background: var(--white);
  color: var(--leek-dark);
  border: 1px solid var(--line);
}
button.secondary:hover { background: var(--leek-pale); }
button.danger { background: var(--danger); }

/* --- Offers / products -------------------------------------------------- */
.offer-list, .order-list { list-style: none; padding: 0; margin: 0; }
.offer-list li, .order-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.offer-list li:last-child, .order-list li:last-child { border-bottom: none; }
.price-now { color: var(--leek-dark); font-weight: 700; }
.price-was { color: var(--muted); text-decoration: line-through; font-size: 0.85rem; }

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--leek-pale);
  color: var(--leek-dark);
  white-space: nowrap;
}

.order-detail {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.order-detail pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.3rem 0 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

/* --- Tables (admin) ----------------------------------------------------- */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
th { background: var(--leek-pale); color: var(--leek-dark); position: sticky; top: 0; }

/* --- Flags / scoring ---------------------------------------------------- */
.flag-bar {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -1px 4px rgba(30, 60, 30, 0.08);
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.flag-bar input[type="text"] { flex: 1; min-width: 200px; width: auto; }
.flag-bar .progress { font-weight: 700; color: var(--leek-dark); white-space: nowrap; }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  max-width: 340px;
  background: var(--ink);
  color: white;
  padding: 0.7rem 0.9rem;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  font-size: 0.88rem;
  z-index: 60;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: var(--leek-dark); }
.toast.err { background: var(--danger); }

.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.flag-code { color: var(--leek-light); font-weight: 700; }

/* --- Hints -------------------------------------------------------------- */
.hint-list { list-style: none; padding: 0; margin: 0; }
.hint-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.hint-list li:last-child { border-bottom: none; }
.hint-text { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.88rem; }

/* --- Scoreboard --------------------------------------------------------- */
.team-input-row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; }
.team-input-row > div { flex: 1; min-width: 200px; }
.captured-flags { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--leek-dark); }

/* --- Footer / privacy --------------------------------------------------- */
.site-footer {
  max-width: 960px;
  margin: 2rem auto 3rem;
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
}
.site-footer strong { color: var(--ink); }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.error-text { color: var(--danger); font-weight: 600; }
