/* RSTechie Skills — forest green theme */
:root {
  --forest-900: #1e5631;
  --forest-700: #2f855a;
  --forest-400: #6fa77a;
  --forest-50: #eef6f0;
  --accent: #c2570c;
  --ink: #1a202c;
  --muted: #5b6b62;
  --line: #d6e5da;
  --bg: #ffffff;
  --card: #ffffff;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --ok-bg: #e6f4ea;
  --radius: 14px;
  --btn-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --forest-900: #9fd3ad;
    --forest-700: #6cc08a;
    --forest-400: #4f9c69;
    --forest-50: #16241b;
    --accent: #f08a43;
    --ink: #e7efe9;
    --muted: #a3b5a9;
    --line: #2b3d31;
    --bg: #0f1712;
    --card: #142019;
    --danger: #ff8a80;
    --danger-bg: #3a1714;
    --ok-bg: #173323;
    --btn-ink: #0f1712;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
a, button, .btn, .option, label { touch-action: manipulation; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--forest-700); }
h1, h2, h3 { color: var(--forest-900); line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin-top: 1.8em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 440px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.skip { position: absolute; left: -9999px; }
.logo-dark { display: none; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px; z-index: 10; }

.site-header { border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--forest-900); font-weight: 800; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav a:not(.btn), .admin-nav a { text-decoration: none; font-weight: 600; color: var(--ink); }
.nav { align-items: center; }
.nav a:hover { color: var(--forest-700); }
.admin-nav { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.admin-nav a { white-space: nowrap; }
.admin .grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.admin .grid .card { padding: 14px; }
.admin .grid .price { margin: 4px 0; }
.admin-nav a[aria-current="page"] { color: var(--forest-700); border-bottom: 2px solid var(--forest-700); }

main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; background: var(--forest-50); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-row nav { display: flex; gap: 16px; flex-wrap: wrap; }

.hero { padding: 32px 0 8px; }
.hero p.lead { font-size: 1.15rem; max-width: 720px; }
.kicker { text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; font-weight: 700; color: var(--forest-700); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-top: 0; }
.card.tint { background: var(--forest-50); }
.price { font-size: 1.6rem; font-weight: 800; color: var(--forest-900); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin: 12px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--forest-700); color: var(--btn-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }

.btn { white-space: nowrap; display: inline-block; border: 0; border-radius: 10px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--forest-700); color: var(--btn-ink); }
.btn:hover { filter: brightness(1.08); }
.btn-accent { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--forest-700); border: 1px solid var(--line); }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }

form.stack label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); color: var(--ink);
}
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--forest-400); outline-offset: 1px; }
.field-error { color: var(--danger); font-size: .9rem; margin: 4px 0 0; }
.help { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.inline { display: inline-flex; align-items: center; gap: 10px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.flash-ok { background: var(--ok-bg); }
.flash-error { background: var(--danger-bg); color: var(--danger); }

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--forest-50); color: var(--forest-900); }
.badge.warn { background: var(--danger-bg); color: var(--danger); }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 6px 0; }
.legal { max-width: 800px; }
.legal h2 { font-size: 1.25rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 18px 18px; margin: 0 0 18px; }
legend { font-weight: 800; color: var(--forest-900); padding: 0 6px; }

.lead { font-size: 1.1rem; }
.options { list-style: none; padding: 0; margin: 16px 0; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; cursor: pointer; background: var(--card); }
.option:hover { border-color: var(--forest-400); }
.option input { margin-top: 4px; }
.option.is-correct { border-color: var(--forest-700); background: var(--ok-bg); font-weight: 700; }
.option.is-wrong { border-color: var(--danger); background: var(--danger-bg); }
.q-prompt { font-size: 1.25rem; }
h1.q-prompt { font-size: clamp(1.25rem, 3vw, 1.6rem); }
.countdown { font-size: 3.2rem; font-weight: 800; color: var(--forest-700); margin: 8px 0; }
.promo { display: flex; gap: 16px; align-items: center; border-radius: var(--radius); padding: 20px; margin: 28px auto; max-width: 720px; background: var(--forest-900); color: #fff; }
.promo h3 { color: #fff; margin: 0 0 6px; }
.promo p { margin: 0 0 12px; }
.promo img { width: 120px; border-radius: 10px; flex-shrink: 0; }
.promo-accent { background: var(--accent); }
.promo-accent .btn-accent { background: var(--forest-900); }
.promo-dark { background: #1a202c; }
@media (prefers-color-scheme: dark) { .promo { background: #23412d; } .promo-dark { background: #000; } }
@media (max-width: 520px) { .promo { flex-direction: column; align-items: flex-start; } .promo img { width: 100%; } }
.topic-list { padding-left: 18px; margin: 8px 0; }
.streak { background: var(--forest-50); border-radius: 10px; padding: 8px 12px; display: inline-block; }
.day section { margin: 22px 0; }
.day h2 { margin-top: 0; font-size: 1.25rem; }
.score-card .price { font-size: 2.4rem; margin: 0; }
.archive li { margin: 6px 0; }
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.15); z-index: 20; }
.cookie-bar p { margin: 0 0 6px; font-size: .92rem; }
.bar { height: 14px; background: var(--forest-700); border-radius: 4px; }
.mentor { display: flex; gap: 18px; align-items: center; }
.mentor-photo { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; }
.badge.gold { background: #f6e7b4; color: #6b4e00; }
.task { margin-bottom: 10px; }
.task.done { border-color: var(--forest-400); background: var(--ok-bg); }
.lesson-list li { margin: 6px 0; }
.slides { position: relative; background: #000; border-radius: var(--radius); padding: 8px; }
.slide { display: none; width: 100%; border-radius: 8px; background: #fff; }
.slide.is-on { display: block; }
.slide-nav { justify-content: space-between; align-items: center; background: var(--card); border-radius: 10px; padding: 6px 10px; margin: 8px 0 0; }
.video-wrap { position: relative; margin-bottom: 12px; }
.video-wrap video { width: 100%; border-radius: var(--radius); background: #000; display: block; }
.video-wrap .wm { position: absolute; top: 10%; left: 5%; color: rgba(255,255,255,.35); font-weight: 700; pointer-events: none; animation: wm 22s linear infinite alternate; }
@keyframes wm { 0% { top: 8%; left: 5%; } 33% { top: 70%; left: 55%; } 66% { top: 30%; left: 70%; } 100% { top: 80%; left: 10%; } }
details > summary { cursor: pointer; }
@media (prefers-color-scheme: dark) {
  .logo-light { display: none; }
  .logo-dark { display: inline; }
}

.code-box { font: 700 1.6rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--forest-50); border: 1px dashed var(--forest-400); border-radius: 10px; padding: 14px; text-align: center; color: var(--forest-900); }
.qr { width: 220px; max-width: 100%; margin: 8px auto; background: #fff; padding: 8px; border-radius: 10px; }
.qr svg { width: 100%; height: auto; display: block; }

/* ---------- Phone first: app-style header + bottom tab bar ---------- */
.header-me, .header-me-btn, .tabbar { display: none; }
.header-me { width: 38px; height: 38px; border-radius: 50%; background: var(--forest-700); color: var(--btn-ink); font-weight: 800; text-decoration: none; place-items: center; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  justify-content: space-around; align-items: stretch;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--card); background: color-mix(in srgb, var(--card) 92%, transparent); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
}
.tabbar a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 14px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .01em; }
.tabbar svg { width: 54px; height: 30px; padding: 3px 15px; border-radius: 999px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.tabbar a[aria-current="page"] { color: var(--forest-700); }
.tabbar a[aria-current="page"] svg { background: var(--forest-50); }
.tabbar a:active svg { transform: scale(.9); }

@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .site-header { padding-top: env(safe-area-inset-top); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); background: var(--card); background: color-mix(in srgb, var(--card) 90%, transparent); }
  .header-row { min-height: 56px; flex-wrap: nowrap; }
  .brand span { font-size: 1rem; white-space: nowrap; }
  .brand img { width: 32px; height: auto; }
  .nav { display: none; }
  .header-me { display: grid; }
  .header-me-btn { display: inline-block; }
  .tabbar { display: flex; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  main { padding-top: 16px; padding-bottom: 28px; }
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.3rem; margin-top: 1.4em; }
  .hero { padding: 12px 0 0; }
  .hero p.lead, .lead { font-size: 1.02rem; }
  .card { padding: 16px; border-radius: 16px; }
  .grid { gap: 12px; }
  .btn { min-height: 46px; padding: 12px 18px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 40px; padding: 8px 14px; }
  .btn-row { gap: 10px; }
  .btn-row > .btn { flex: 1 1 100%; }
  .card .btn-sm { margin-top: 4px; }
  .option { min-height: 52px; padding: 14px; align-items: center; border-radius: 12px; }
  .option input { margin-top: 0; width: 20px; height: 20px; flex-shrink: 0; }
  input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], select, textarea { min-height: 48px; font-size: 16px; }
  .inline { flex-wrap: wrap; }
  .inline input { max-width: none !important; flex: 1 1 160px; }
  .countdown { font-size: 2.6rem; }
  .code-box { font-size: 1.35rem; }
  .site-footer { padding: 20px 0 8px; }
  .footer-row nav { gap: 6px 16px; }
  .footer-row nav a { padding: 6px 0; }
  .cookie-bar { bottom: calc(80px + env(safe-area-inset-bottom)); }
  table.data { font-size: .88rem; }
  .mentor { flex-direction: column; align-items: flex-start; }
}
@media (display-mode: standalone) {
  .site-header { position: sticky; }
  .skip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.install-card[hidden] { display: none; }

/* ---------- Dashboard: app home screen ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.stat { background: var(--forest-50); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat strong { display: block; font-size: 1.3rem; color: var(--forest-900); line-height: 1.2; }
.stat span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.pro-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; margin: 0 0 16px; border-radius: 16px; background: linear-gradient(120deg, var(--forest-900), var(--forest-700)); color: #fff; text-decoration: none; }
.pro-banner .pro-price { background: rgba(255,255,255,.18); border-radius: 999px; padding: 4px 12px; font-weight: 800; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pro-banner { background: linear-gradient(120deg, #23412d, #2f855a); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; min-height: 120px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; transition: transform .12s ease, border-color .12s ease; }
.tile:hover { border-color: var(--forest-400); }
.tile:active { transform: scale(.97); }
.tile strong { color: var(--forest-900); font-size: 1rem; line-height: 1.3; }
.tile .small { color: var(--muted); line-height: 1.35; }
.tile-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 6px; }
.tile-primary { background: var(--forest-50); border-color: var(--forest-400); }
@media (max-width: 760px) {
  .stats { gap: 6px; }
  .stat { padding: 10px 4px; }
  .stat strong { font-size: 1.1rem; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 112px; padding: 14px; }
  .dash h1 { margin-bottom: .1em; }
}
