/* =============================================================
   site.css — shared design tokens, navigation, and footer
   used by every public-facing page (index, education, purchase,
   license-manager, success, cancel, unsubscribe).
   Keep this file small — page-specific styling stays per-page.
   ============================================================= */

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

/* --- Tokens --- */
:root {
  --ink: #111;
  --ink-2: #444;
  --muted: #888;
  --line: #ececec;
  --line-2: #f4f4f4;
  --bg: #fff;
  --card: #fafafa;
  --success: #166534;
  --success-bg: #f0fdf4;
  --error: #991b1b;
  --error-bg: #fef2f2;
}

html, body { background: var(--bg); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* --- Layout --- */
.wrap        { max-width: 720px; width: 100%; margin: 0 auto; padding: 0 24px; }
.wrap--wide  { max-width: 960px; }

main { flex: 1; padding: 56px 0 40px; }

/* --- Navigation (unified top bar) --- */
.nav { padding: 22px 0; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.nav-links a {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 500; }

/* --- Footer (unified) --- */
.foot {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.foot-inner a {
  color: var(--ink-2);
  text-decoration: none;
}
.foot-inner a:hover { color: var(--ink); }
.foot-links { display: flex; gap: 18px; }

/* --- Section heading utilities --- */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

/* --- Generic buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--card);
}
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #000;
  border-color: #000;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-block { width: 100%; }

/* --- Form inputs --- */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--ink); }
.input::placeholder { color: #b8b8b8; }

/* --- Spinner --- */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: site-spin 0.6s linear infinite;
  vertical-align: -1px;
  margin-right: 6px;
}
@keyframes site-spin { to { transform: rotate(360deg); } }

/* --- Inline messages --- */
.msg { font-size: 13px; margin-top: 10px; display: none; }
.msg.is-success { display: block; color: var(--success); }
.msg.is-error   { display: block; color: var(--error); }

/* --- Mobile nav --- */
@media (max-width: 640px) {
  main { padding: 36px 0 28px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12px; }
  .foot-inner { flex-direction: column; gap: 10px; text-align: center; }
}
@media (max-width: 480px) {
  /* Drop GitHub on small screens — 5 nav items plus logo gets tight */
  .nav-links .nav-github { display: none; }
}
@media (max-width: 360px) {
  /* On the smallest phones, also drop License (still reachable via footer) */
  .nav-links a[href="/license-manager"] { display: none; }
  .nav-links { gap: 12px; }
}
