/* ============================================================
   Swift-J Learn storefront — brand styling
   Palette: #f7f7f7 bg · #1a1a1a text · electric green #00e676
   ============================================================ */

:root {
  --bg: #f7f7f7;
  --ink: #1a1a1a;
  --green: #00e676;
  --green-dark: #01c961;
  --muted: #555d66;
  --faint: #8a9099;
  --panel: #ffffff;
  --border: #e3e3e3;
  --danger: #a63a3e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 99;
  background: var(--ink); color: var(--green); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

/* ---------- header ---------- */
.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 19px; }
.brand-logo { height: 38px; width: auto; max-width: 100%; display: block; }
.brand-name em { color: var(--green); font-style: normal; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: #fff; text-decoration: none; font-size: 14.5px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); color: var(--green); }
.nav .btn { text-decoration: none; }
.currency-switch {
  background: var(--ink); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.currency-switch:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.coupon-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.coupon-row input { flex: 1; min-width: 170px; border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 14px; }
.coupon-row input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
#coupon-msg { min-height: 18px; }
#coupon-msg strong { color: var(--green-dark); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; border-radius: 10px; padding: 12px 20px;
  transition: transform .08s ease, background .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green); color: #000; }
.btn-primary:hover { background: var(--green-dark); }
.btn-dark { background: var(--ink); color: var(--green); }
.btn-dark:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- hero ---------- */
.hero {
  padding: 64px 0 28px; text-align: center;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; margin: 0 0 14px; }
.hero h1 em { color: var(--green-dark); font-style: normal; }
.hero p { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 auto; }
.hero-logo { height: 46px; width: auto; max-width: 340px; display: block; margin: 0 auto 16px; }

/* ---------- layout / panels ---------- */
h2.section-title { font-size: 22px; margin: 40px 0 16px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.panel + .panel { margin-top: 18px; }

.notice { border-radius: 10px; padding: 12px 16px; font-size: 14.5px; margin-bottom: 16px; }
.notice-info { background: #e8f7ff; border: 1px solid #bcdff2; color: #0b4a66; }
.notice-ok   { background: #e5ffe9; border: 1px solid #b9ecc2; color: #0c5a1d; }
.notice-warn { background: #fff4e0; border: 1px solid #f0d9a8; color: #6b4a00; }
.notice-err  { background: #ffecec; border: 1px solid #f0b9b9; color: #8d1f24; }

/* ---------- course grid ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.course-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.course-card .c-emoji { font-size: 34px; line-height: 1; }
.course-card h3 { margin: 2px 0 0; font-size: 17px; }
.course-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.course-card .c-price { font-weight: 800; font-size: 15.5px; }
.c-status { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.c-status.soon { background: #eee; color: var(--muted); }
.c-status.paid { background: #e5ffe9; color: #0c5a1d; }
.c-status.pending { background: #fff4e0; color: #6b4a00; }
.c-status.active { background: #e8f7ff; color: #0b4a66; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--green); border-color: transparent; }
.form-stack { display: grid; gap: 14px; }

.checks { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.checks li { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }

/* ---------- auth ---------- */
.auth-wrap { max-width: 440px; margin: 34px auto; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-tabs button {
  flex: 1; padding: 10px; font: inherit; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--panel); border-radius: 10px;
}
.auth-tabs button.active { background: var(--ink); color: var(--green); border-color: var(--ink); }

/* ---------- dashboard ---------- */
.account-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .account-grid { grid-template-columns: 1fr; } }
.profile-card { text-align: center; }
.profile-card .avatar { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.profile-card h3 { margin: 4px 0; word-break: break-word; }
.profile-card .email { color: var(--muted); font-size: 13.5px; word-break: break-word; }

.my-course { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; background: #fff; }
.my-course .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.my-course .title { font-weight: 800; font-size: 16.5px; margin: 0; }
.my-course .meta { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.my-course .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.code-chip {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 800; letter-spacing: 1.5px; font-size: 15px;
  background: var(--ink); color: var(--green); padding: 8px 14px; border-radius: 10px;
  display: inline-flex; align-items: center; gap: 10px;
}
.progress-track { height: 8px; background: #e8e8e8; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--green); border-radius: 999px; }

/* ---------- misc ---------- */
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.kicker { color: var(--green-dark); font-weight: 800; text-transform: uppercase; letter-spacing: 2px; font-size: 12px; }

.site-footer { margin-top: 60px; border-top: 1px solid var(--border); padding: 26px 0 40px; }
.footer-logo { height: 30px; width: auto; max-width: 220px; display: block; margin-bottom: 12px; opacity: .9; }
.site-footer p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.copyright { color: var(--faint); font-size: 12px; margin-top: 10px; }
.footer-contact a { color: var(--green-dark); text-decoration: none; font-weight: 600; }
.footer-contact a:hover { text-decoration: underline; }

/* ---------- contact & support section ---------- */
.support { margin-top: 46px; }
.support-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.support-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.support-card h3 { margin: 0 0 6px; font-size: 15.5px; }
.support-card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.support-card a { color: var(--green-dark); font-weight: 700; }
.support-note { margin-top: 14px; }
@media (max-width: 760px) { .support-grid { grid-template-columns: 1fr; } }

/* ---------- floating support widget (WhatsApp + chatbot) ---------- */
#support-widget {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.fab-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.wa-fab {
  display: inline-flex; align-items: center; gap: 8px;
  background: #25d366; color: #073b1f; text-decoration: none;
  font-weight: 800; font-size: 13.5px; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,.22); transition: transform .12s ease, box-shadow .12s ease;
}
.wa-fab:hover { transform: translateY(-2px); }
.chat-fab {
  position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: var(--green); box-shadow: 0 6px 18px rgba(0,0,0,.28);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-dot {
  position: absolute; top: 8px; right: 9px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--green); border: 2px solid var(--ink);
}
.chat-dot[hidden] { display: none; }

.chat-panel {
  width: min(360px, calc(100vw - 36px)); height: min(480px, calc(100vh - 150px));
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 14px; }
.chat-avatar { width: 34px; height: 34px; border-radius: 9px; }
.chat-head-text { flex: 1; line-height: 1.25; }
.chat-head-text strong { display: block; font-size: 14.5px; }
.chat-head-text small { color: var(--green); font-size: 11.5px; }
.chat-close { background: none; border: 0; color: #fff; font-size: 17px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.chat-close:hover { background: rgba(255,255,255,.14); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fafafa; }
.chat-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.chat-msg.bot { align-self: flex-start; background: #eceff3; color: var(--ink); border-bottom-left-radius: 5px; }
.chat-msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg a { color: var(--green-dark); font-weight: 700; }
.chat-msg.me a { color: var(--green); }
.chat-typing { color: var(--faint); letter-spacing: 4px; font-weight: 800; }
.chat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px 0; border-top: 1px solid var(--border); background: var(--panel); }
.chat-chip {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 6px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--muted);
}
.chat-chip:hover { border-color: var(--green-dark); color: var(--green-dark); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: var(--panel); }
.chat-form input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; }
.chat-form input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.chat-send { padding: 10px 14px; }
@media (max-width: 560px) {
  #support-widget { right: 12px; bottom: 12px; }
  .wa-fab span { display: none; }
  .wa-fab { padding: 11px; }
}

/* ---- Legal pages (privacy.html / terms.html) ---- */
.legal-page { background: var(--bg, #fff); }
.legal { max-width: 760px; padding-top: 30px; padding-bottom: 20px; }
.legal h1 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 6px; }
.legal h2 { font-size: 19px; margin: 26px 0 10px; color: var(--ink); }
.legal p, .legal li { font-size: 15px; line-height: 1.65; color: var(--muted); }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin: 4px 0; }
.legal a { color: var(--green-dark); font-weight: 600; }
.legal section + section { margin-top: 6px; }
.legal > .small { margin-bottom: 18px; }

/* ---- Brand / legal disclaimer ---- */
.disclaimer {
  margin: 26px 0 0;
  padding: 16px 18px;
  border: 1px dashed var(--border);
  border-left: 3px solid var(--green-dark);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 60%, #fff 40%);
}
.disclaimer h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: .4px; text-transform: uppercase; color: var(--green-dark); }
.disclaimer p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.disclaimer p:last-child { margin: 0; }
.disclaimer small a { color: var(--green-dark); font-weight: 700; }

/* ---- Content protection (js/guards.js) ---- */
.no-select, .no-select * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* keep forms, code chips and copy buttons fully usable */
.no-select input, .no-select textarea, .no-select select,
.no-select code, .no-select [data-copy], .no-select .code-chip,
.no-select .copyable, .no-select [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
#protect-toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 1200;
  max-width: 90vw;
  text-align: center;
}
#protect-toast.show { opacity: 1; }
#protect-toast.warn { background: #a33; }

/* When printed or saved as PDF, hide the whole page and show a
   notice instead — nothing copyable ever reaches the print output,
   even if print is opened from the browser menu. */
@media print {
  body * { display: none !important; }
  body::after {
    content: "© Swift-J Learn — this page is protected and printing is disabled. For help, contact swiftjlearn@gmail.com";
    display: flex !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #333;
  }
}