/* V&S guides portal — same palette and type as vands.co.za so the portal reads
   as part of the brand rather than a bolted-on tool. */

:root {
  --yellow:       #F5C015;
  --yellow-light: #FDF3C7;
  --yellow-dark:  #D4A012;
  --black:        #0F0F0F;
  --white:        #FFFFFF;
  --off-white:    #F0EFEC;
  --charcoal:     #1C1C1E;
  --slate:        #3D3D3D;
  --mid:          #737373;
  --soft:         #B0B0B0;
  --border:       #D8D7D3;
  --teal:         #1A7F74;
  --danger:       #A32B1F;

  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, -apple-system, sans-serif;

  --sp-xs: 4px; --sp-s: 8px; --sp-m: 16px; --sp-l: 24px;
  --sp-xl: 40px; --sp-2xl: 64px;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--black);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0 0 var(--sp-s); }
h2 { font-size: 1.35rem; margin: 0 0 var(--sp-m); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 var(--sp-l); }

/* ── header ── */

.site-header {
  background: var(--black);
  color: var(--white);
  padding: var(--sp-m) 0;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-m); flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.25rem;
  color: var(--white); text-decoration: none;
}
.brand span { color: var(--yellow); }
.site-nav { display: flex; align-items: center; gap: var(--sp-l); flex-wrap: wrap; }
.site-nav a { color: var(--soft); text-decoration: none; font-size: 0.9rem; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--yellow); }
.site-nav form { margin: 0; }

main { padding: var(--sp-xl) 0 var(--sp-2xl); }

.page-intro { color: var(--slate); margin: 0 0 var(--sp-xl); max-width: 60ch; }

/* ── cards & guide list ── */

.product-group { margin-bottom: var(--sp-xl); }
.product-group h2 { display: flex; align-items: baseline; gap: var(--sp-s); }
.product-group h2 .count { font-family: var(--sans); font-size: 0.8rem; color: var(--mid); }

.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-m); }

.guide {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-l);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-l); flex-wrap: wrap;
}
.guide h3 { margin: 0 0 var(--sp-xs); font-size: 1.05rem; font-weight: 600; }
.guide p { margin: 0 0 var(--sp-s); color: var(--slate); font-size: 0.925rem; }
.guide .meta { margin: 0; }
.guide .actions { display: flex; gap: var(--sp-s); flex-shrink: 0; }

/* ── small utilities ──
   These exist as classes rather than style="" attributes because the
   Content-Security-Policy refuses inline styles as well as inline script. */

.meta       { font-size: 0.8rem; color: var(--mid); }
.count-note { font-size: 0.85rem; color: var(--mid); }
.muted      { color: var(--mid); }
.nowrap     { white-space: nowrap; }
.flush      { margin: 0; }
.section-gap { margin-bottom: var(--sp-xl); }

.viewer-frame {
  width: 100%; height: 78vh; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
}

/* ── buttons ── */

.btn {
  display: inline-block; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
  padding: 10px var(--sp-l); text-decoration: none; text-align: center;
  transition: background 0.18s, color 0.18s;
}
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-primary:hover { background: var(--yellow-dark); }
.btn-ghost { background: transparent; color: var(--black); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--black); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--border); }
.btn-danger:hover { border-color: var(--danger); }
/* Sign out sits on the black header, so it needs the inverse of .btn-ghost.
   Declared after it: same specificity, so source order decides. */
.btn-signout { color: var(--soft); border-color: var(--slate); }
.btn-signout:hover { color: var(--white); border-color: var(--soft); }
.btn-small { padding: 6px var(--sp-m); font-size: 0.8rem; }

/* ── forms ── */

.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-xl);
}

.card-narrow { max-width: 30rem; }

.field { margin-bottom: var(--sp-m); }
.field label { display: block; font-size: 0.825rem; font-weight: 500; margin-bottom: var(--sp-xs); }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--sans); font-size: 0.95rem;
  padding: 10px var(--sp-m); border: 1px solid var(--border);
  border-radius: 8px; background: var(--white); color: var(--black);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--yellow); outline-offset: 1px; border-color: transparent;
}
.field .hint { font-size: 0.775rem; color: var(--mid); margin-top: var(--sp-xs); }

.checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--sp-s);
}
.checkbox-grid label {
  display: flex; align-items: center; gap: var(--sp-s);
  font-weight: 400; font-size: 0.9rem; margin: 0;
}
.checkbox-grid input { width: auto; }

/* ── login ── */

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-l); background: var(--black);
}
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { display: block; text-align: center; margin-bottom: var(--sp-l); font-size: 1.5rem; }
.login-card .card { padding: var(--sp-xl); }
.login-card h1 { font-size: 1.5rem; text-align: center; }
.login-card .page-intro { text-align: center; font-size: 0.9rem; margin-bottom: var(--sp-l); }
.login-card .btn { width: 100%; }
.login-foot { text-align: center; color: var(--soft); font-size: 0.8rem; margin-top: var(--sp-l); }
.login-foot a { color: var(--yellow); }

/* ── messages ── */

.notice {
  border-radius: 8px; padding: var(--sp-m); margin-bottom: var(--sp-l);
  font-size: 0.9rem; border: 1px solid;
}
.notice-error { background: #FBECEA; border-color: #E3B7B1; color: var(--danger); }
.notice-ok { background: var(--yellow-light); border-color: var(--yellow-40, #FAE070); color: var(--slate); }

.empty {
  background: var(--white); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: var(--sp-2xl) var(--sp-l);
  text-align: center; color: var(--mid);
}

/* ── tables (admin) ── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 0.9rem; }
th, td { text-align: left; padding: var(--sp-m); border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mid); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
table form { margin: 0; display: inline; }

.tag {
  display: inline-block; background: var(--off-white); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; margin: 2px 2px 2px 0;
}
.tag-support { background: var(--yellow-light); border-color: var(--yellow); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-m); margin-bottom: var(--sp-m); flex-wrap: wrap;
}

.upload-progress { font-size: 0.85rem; color: var(--mid); margin-top: var(--sp-s); }

@media (max-width: 620px) {
  h1 { font-size: 1.6rem; }
  .card { padding: var(--sp-l); }
  .guide { flex-direction: column; }
  .guide .actions { width: 100%; }
  .guide .actions .btn { flex: 1; }
}
