/* Knowledge Partner — shared stylesheet
   Palette matches the logo: near-black ground, gold accent, off-white text. */

:root {
  --bg:        #0b0b0d;
  --bg-panel:  #17171b;
  --bg-panel2: #1f1f24;
  --border:    #2c2c33;
  --text:      #f1efe9;
  --text-dim:  #a9a7a1;
  --gold:      #d4af37;
  --gold-dim:  #b9962e;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --green:     #4caf6d;
  --red:       #e0645b;
  --radius:    12px;
  --shadow:    0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

header.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.brand img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  border-radius: 6px;
}

.brand .gold { color: var(--gold); }

nav.site-nav a {
  color: var(--text-dim);
  margin-left: 24px;
  font-weight: 500;
  font-size: 0.95rem;
}
nav.site-nav a:hover { color: var(--gold); text-decoration: none; }

/* ---------- Hero ---------- */

.hero {
  padding: 64px 0 48px;
  text-align: center;
  background:
    radial-gradient(ellipse at top, var(--gold-soft), transparent 60%);
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 14px;
  line-height: 1.25;
}

.hero h1 .gold { color: var(--gold); }

.hero p.lead {
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
}

.hero-banner {
  max-width: 880px;
  width: 100%;
  border-radius: var(--radius);
  margin: 0 auto 8px;
  display: block;
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-gold {
  background: linear-gradient(180deg, #e6c458, var(--gold-dim));
  color: #1a1400;
}
.btn-gold:hover { box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Subject grid ---------- */

.section { padding: 48px 0; }
.section-title {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.section-sub {
  color: var(--text-dim);
  margin-bottom: 28px;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card .code {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card h3 { margin: 0; font-size: 1.15rem; }
.card p.desc { color: var(--text-dim); font-size: 0.92rem; margin: 0; flex-grow: 1; }

.card .price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

/* ---------- Unit list ---------- */

.subject-hero {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
}

.unit-list { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }

.unit-row {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.unit-row .unit-num {
  color: var(--gold);
  font-weight: 700;
  min-width: 68px;
}

.unit-row .unit-title { flex-grow: 1; font-weight: 500; }

.unit-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.buy-box {
  position: sticky;
  bottom: 0;
  background: var(--bg-panel2);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 32px;
}

.buy-box .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.email-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="email"], input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  min-width: 260px;
}
input[type="email"]:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
}

/* ---------- Misc panels ---------- */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 560px;
  margin: 48px auto;
  text-align: center;
}

.panel.success { border-color: var(--green); }
.panel.error { border-color: var(--red); }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-paid { background: rgba(76, 175, 109, 0.15); color: var(--green); }
.badge-pending { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
.badge-failed { background: rgba(224, 100, 91, 0.15); color: var(--red); }

.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.alert-error { background: rgba(224, 100, 91, 0.12); border: 1px solid rgba(224, 100, 91, 0.4); color: #ffb3ac; }
.alert-success { background: rgba(76, 175, 109, 0.12); border: 1px solid rgba(76, 175, 109, 0.4); color: #a8e6ba; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  text-align: center;
  margin-top: 40px;
}

footer.site-footer a { color: var(--text-dim); }

/* ---------- Admin ---------- */

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.admin-table th, table.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
table.admin-table th {
  background: var(--bg-panel2);
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}
table.admin-table tr:last-child td { border-bottom: none; }

.login-box {
  max-width: 380px;
  margin: 90px auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.login-box label { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 0.88rem; }
.login-box input { width: 100%; margin-bottom: 16px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .site-header .container { height: auto; padding: 14px 20px; flex-direction: column; gap: 10px; }
  nav.site-nav a { margin: 0 10px; }
}
