:root {
  --black: #0c0c0d;
  --black-2: #161617;
  --black-3: #1f1f21;
  --gold: #ff6a00;
  --gold-light: #ff9d3d;
  --text: #f2ede1;
  --text-dim: #b8b2a3;
  --stage-l: #5aa9ff;
  --stage-d: #e0a83e;
  --stage-p: #3ecf6e;
  --danger: #e05a5a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: "Segoe UI", Arial, "Heebo", sans-serif;
  direction: rtl;
  line-height: 1.55;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, var(--black-2), var(--black));
  border-bottom: 1px solid #2c2712;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  color: var(--gold);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand .brand-sub { font-size: 0.75rem; color: var(--text-dim); font-weight: 400; }

.nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; order: 1; }
.brand { order: 2; }
.nav-toggle { display: none; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .brand { font-size: 0.95rem; gap: 6px; order: 1; }
  .brand .brand-sub { display: none; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 2;
    width: 40px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #4a4322;
    background: transparent;
    color: var(--gold-light);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
  }

  .nav {
    order: 3;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 4px;
    margin-top: 10px;
  }
  .nav.open { display: flex; }
  .nav a, .nav span, .nav form { width: 100%; }
  .nav a { padding: 8px 4px; font-size: 0.9rem; border-bottom: 1px solid #232325; }
}
.nav a { color: var(--text); font-size: 0.95rem; }
.nav a:hover { color: var(--gold-light); }

.nav-dropdown { position: relative; }
.nav-dropdown summary {
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  padding: 4px 2px;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: ' ▾'; font-size: 0.75em; }
.nav-dropdown summary:hover { color: var(--gold-light); }
.nav-dropdown[open] summary { color: var(--gold-light); }
.nav-dropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--black-2, #17171a);
  border: 1px solid #4a4322;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  z-index: 30;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.5);
}
.nav-dropdown .dropdown-menu a { white-space: nowrap; padding: 6px 8px; border-radius: 6px; }
.nav-dropdown .dropdown-menu a:hover { background: rgba(212,175,55,0.1); }
.nav-dropdown .dropdown-menu form { margin: 0; }
.nav-dropdown .dropdown-menu form button {
  all: unset;
  display: block;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
}
.nav-dropdown .dropdown-menu form button:hover { background: rgba(212,175,55,0.1); color: var(--gold-light); }
.nav-dropdown.account summary { display: flex; align-items: center; gap: 4px; }

@media (max-width: 640px) {
  .nav-dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 14px;
    margin-top: 4px;
  }
}

.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.container.wide { max-width: 1320px; }

.card {
  background: var(--black-2);
  border: 1px solid #2a2a2c;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

h1, h2, h3 { color: var(--gold); font-weight: 700; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

.muted { color: var(--text-dim); }
.small { font-size: 0.85rem; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1a1608;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid #4a4322;
}
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 5px 12px; font-size: 0.8rem; }

form.inline { display: inline; }

.input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #383830;
  background: var(--black-3);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

label { display: block; margin-bottom: 4px; color: var(--text-dim); font-size: 0.85rem; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { padding: 7px 9px; border-bottom: 1px solid #2a2a2c; text-align: right; vertical-align: top; }
th { color: var(--gold); font-weight: 600; background: var(--black-3); position: sticky; top: 58px; }
tr:hover td { background: #1a1a1c; }

.stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.75rem;
  color: #0c0c0d;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  border: 1px solid #4a4322;
  color: var(--text-dim);
}
.pill.gold { border-color: var(--gold); color: var(--gold-light); }
.pill.green { border-color: var(--stage-p); color: var(--stage-p); }
.pill.red { border-color: var(--danger); color: var(--danger); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert.error { background: #3a1414; border: 1px solid var(--danger); color: #ffb3b3; }
.alert.success { background: #12321c; border: 1px solid var(--stage-p); color: #b7f0c8; }
.alert.info { background: #23230f; border: 1px solid var(--gold); color: var(--gold-light); }

.hero {
  text-align: center;
  padding: 70px 20px 50px;
  background: radial-gradient(circle at 50% 0%, #241f0c, var(--black) 65%);
  border-bottom: 1px solid #2c2712;
}
.hero h1 { font-size: 2.3rem; margin-bottom: 8px; }
.hero p.tagline { color: var(--text-dim); font-size: 1.05rem; max-width: 640px; margin: 0 auto 26px; }

.price-card { border: 1px solid #2a2a2c; border-radius: var(--radius); padding: 26px; background: var(--black-2); text-align: center; }
.price-card.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.price-card .amount { font-size: 2.2rem; font-weight: 800; color: var(--gold-light); margin: 10px 0; }

.footer { text-align: center; padding: 30px 20px; color: var(--text-dim); font-size: 0.8rem; border-top: 1px solid #221f13; }
.footer-cta { margin: 0 0 14px; font-size: 1rem; }
.footer-cta a { color: var(--gold-light); font-weight: 700; }

.tree-link { display: block; padding: 10px 14px; border-radius: 8px; margin-bottom: 6px; background: var(--black-3); border: 1px solid #2a2a2c; }
.tree-link:hover { border-color: var(--gold); text-decoration: none; }

.locked-banner {
  padding: 14px 18px;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  margin-bottom: 18px;
  background: #1c1808;
  color: var(--gold-light);
  font-size: 0.9rem;
}

.checklist-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #232325; }
.checklist-item .txt { flex: 1; }

.step-tracker { margin-bottom: 22px; }
.step-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.step-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--black-3);
  border: 1px solid #2a2a2c;
}
.step-item.next { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.step-item.done { opacity: 0.7; }
.step-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: var(--black-2);
  border: 1px solid var(--gold);
  color: var(--gold-light);
}
.step-item.done .step-num { background: var(--stage-p); border-color: var(--stage-p); color: #06220f; }
.step-body { flex: 1; min-width: 0; }
.step-body strong { color: var(--text); font-size: 0.98rem; }
.step-body p { margin: 3px 0 0; }
.step-item .btn.small { flex: 0 0 auto; }
@media (max-width: 720px) {
  .step-item { flex-wrap: wrap; }
  .step-item .btn.small { margin-right: auto; margin-top: 6px; }
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin: 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0; right: 0; left: 0; bottom: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-embed + figcaption,
figure figcaption {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 6px;
}
figure { margin: 16px 0; }

.print-only { display: none; }

@media print {
  .topbar, .footer, .no-print { display: none !important; }
  .print-only { display: inline; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; }
}

.dropdown-label {
  display: block;
  padding: 6px 8px 2px;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Accessibility widget: a floating toggle button plus a small panel of
   visitor-side preferences (font size, contrast, link underlining).
   Nothing here is saved to the account or database, only in this browser. */
.a11y-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px 0 16px;
  border-radius: 100px;
  border: 2px solid var(--gold);
  background: var(--black-2);
  color: var(--gold-light);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px -4px rgba(0,0,0,0.7);
}
.a11y-toggle:hover { background: var(--black-3); }
.a11y-toggle-icon { font-size: 1.6rem; }

.a11y-panel {
  position: fixed;
  bottom: 82px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
  padding: 16px;
  background: var(--black-2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.6);
}
/* The panel is shown/hidden via the native "hidden" attribute from JS.
   Without this rule, the .a11y-panel class's own "display: flex" above
   carries the same specificity as the browser's default "[hidden]" rule
   and wins by cascade order, so the panel would stay visible even while
   hidden. This makes the hidden state win explicitly. */
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 { margin: 0 0 4px; font-size: 1rem; }
.a11y-panel button {
  all: unset;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--black-3);
  color: var(--text);
  font-size: 0.9rem;
  text-align: right;
}
.a11y-panel button:hover { background: #2a2a2c; color: var(--gold-light); }
.a11y-panel a { font-size: 0.85rem; padding: 4px 10px; }

html.a11y-font-1 { font-size: 112.5%; }
html.a11y-font-2 { font-size: 125%; }
html.a11y-font-3 { font-size: 137.5%; }

html.a11y-contrast body { background: #000; color: #fff; }
html.a11y-contrast .card,
html.a11y-contrast .step-item,
html.a11y-contrast .nav-dropdown .dropdown-menu { background: #000; border-color: #fff; }
html.a11y-contrast a { color: #ffd84d; }
html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3 { color: #ffd84d; }

html.a11y-underline-links a { text-decoration: underline !important; }

@media (max-width: 640px) {
  .a11y-toggle { bottom: 14px; left: 14px; height: 46px; padding: 0 14px 0 12px; }
  .a11y-toggle-label { display: none; }
  .a11y-panel { bottom: 70px; left: 14px; min-width: 0; width: calc(100% - 28px); }
}

/* Visit counter / traffic source dashboard (admin_analytics.php) */
.stat-tiles { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 6px; }
.stat-tile { flex: 1 1 140px; background: var(--black-3); border: 1px solid #2a2a2c; border-radius: var(--radius); padding: 14px 16px; }
.stat-tile .num { font-size: 1.8rem; color: var(--gold-light); font-weight: 700; line-height: 1.2; }
.stat-tile .label { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }

.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: 14px 0 4px; border-bottom: 1px solid #2a2a2c; }
.bar-chart .bar { flex: 1; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-chart-labels { display: flex; gap: 3px; font-size: 0.62rem; color: var(--text-dim); margin-bottom: 18px; }
.bar-chart-labels span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }

.range-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.range-tabs a { padding: 4px 12px; border-radius: 20px; border: 1px solid #2a2a2c; font-size: 0.82rem; color: var(--text-dim); }
.range-tabs a.active { background: var(--gold); color: #1a1200; border-color: var(--gold); font-weight: 700; }
