/* Light theme for the public builder and the member area (the Admin Panel stays dark). Loaded after app.css. */
body.theme-light {
  color-scheme: dark;
  --bg: #000000;
  --sidebar: #0a0a0f;
  --card: #0d0d14;
  --card-hover: #14141d;
  --field: #08080d;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-soft: #e5e7eb;
  --muted: #b3b8c4;
  --subtle: #8b93a3;
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --primary-soft: rgba(139, 92, 246, 0.18);
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger-soft: rgba(239, 68, 68, 0.14);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -16px rgba(0, 0, 0, 0.9);
  --shadow-pop: 0 20px 50px -12px rgba(0, 0, 0, 0.9);
  background: var(--bg);
  color: var(--text);
}.theme-light code { background: rgba(255, 255, 255, 0.08); }
.theme-light * { scrollbar-color: rgba(255, 255, 255, 0.35) transparent; }

/* controls */
.theme-light .button-secondary { background: var(--card); border-color: var(--border-strong); color: var(--text); }
.theme-light .button-secondary:hover { background: rgba(255, 255, 255, 0.08); }
.theme-light .button-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.theme-light .input:hover, .theme-light .select:hover, .theme-light .textarea:hover { border-color: rgba(255, 255, 255, 0.4); }
.theme-light .switch { background: var(--card); }
.theme-light .switch-track { background: rgba(255, 255, 255, 0.28); }
.theme-light .segmented { background: rgba(255, 255, 255, 0.08); }
.theme-light .segmented input:checked + span { background: rgba(139, 92, 246, 0.28); color: #fff; box-shadow: 0 1px 3px rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(124, 58, 237, 0.45); }
.theme-light .badge, .theme-light .pill { background: rgba(255, 255, 255, 0.08); color: var(--text-soft); }
.theme-light .alert { background: var(--card); }
.theme-light .alert-info { background: rgba(124, 58, 237, 0.07); }
.theme-light .alert-warn { background: rgba(217, 119, 6, 0.09); }
.theme-light .alert-error { background: rgba(220, 38, 38, 0.07); }
.theme-light .alert-success { background: rgba(22, 163, 74, 0.08); }
.theme-light .table th { background: rgba(255, 255, 255, 0.05); }
.theme-light .table tbody tr:hover { background: rgba(255, 255, 255, 0.05); }
.theme-light .dropdown-item:hover { background: rgba(255, 255, 255, 0.08); }
.theme-light .dropdown-menu { background: var(--card); }
.theme-light .modal { background: var(--card); }
.theme-light .modal-backdrop { background: rgba(0, 0, 0, 0.7); }
.theme-light .spinner { border-color: rgba(255, 255, 255, 0.16); border-top-color: var(--primary); }
.theme-light .summary-item { border-color: var(--border); }
.theme-light .summary-swatch, .theme-light .swatch-dot { border-color: rgba(255, 255, 255, 0.35); }

/* stepper + template cards + swatches */
.theme-light .step-item { background: var(--card); color: var(--muted); }
.theme-light .step-item:hover { border-color: var(--border-strong); }
.theme-light .step-item .step-num { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.theme-light .step-item.current { background: var(--primary-soft); color: var(--primary); border-color: rgba(124, 58, 237, 0.5); }
.theme-light .step-item.current .step-num { background: var(--gradient); color: #fff; }
.theme-light .step-item.done .step-num { background: var(--success-soft); color: #16a34a; }
.theme-light .step-item.done { color: var(--text-soft); }
.theme-light .template-card { background: var(--card); }
.theme-light .template-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.theme-light .template-card.selected { background: var(--card); }
.theme-light .swatch { background: var(--card); color: var(--text-soft); }
.theme-light .swatch.selected { background: var(--primary-soft); color: var(--primary); }
.theme-light .field-help, .theme-light .cell-sub { color: var(--muted); }
.theme-light .advanced > summary { color: var(--text-soft); }
.theme-light .nav-group, .theme-light .file-row, .theme-light .value-list { background: var(--card); }
.theme-light .credit-panel { background: rgba(124, 58, 237, 0.07); border-color: rgba(124, 58, 237, 0.25); }
.theme-light .credit-panel-locked { background: rgba(217, 119, 6, 0.09); border-color: rgba(217, 119, 6, 0.3); }
.theme-light .chip { background: var(--card); }
.theme-light .plan-card { background: var(--card); }
.theme-light .plan-popular { background: linear-gradient(180deg, rgba(124, 58, 237, 0.16), var(--card) 45%); }
.theme-light .progress-bar { background: rgba(255, 255, 255, 0.12); }
.theme-light .progress-step .p-ico { border-color: rgba(15, 23, 42, 0.16); }
.theme-light .result-card { background: var(--card); }
.theme-light .stat-icon { background: var(--primary-soft); color: var(--primary); }

/* ===== site bar (top navigation) ===== */
.app-shell-top { display: block; }
.sitebar { position: sticky; top: 0; z-index: 40; background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.sitebar-in { max-width: 1240px; margin: 0 auto; padding: 0 28px; height: 64px; display: flex; align-items: center; gap: 28px; }
.site-brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--text); text-decoration: none; white-space: nowrap; }
.site-brand .brand-mark { width: 34px; height: 34px; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.site-link { padding: 8px 13px; border-radius: 9px; color: var(--text-soft); font-weight: 560; font-size: 14px; text-decoration: none; white-space: nowrap; }
.site-link:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.site-link.active { color: var(--primary); background: var(--primary-soft); }
.site-actions { display: flex; align-items: center; gap: 10px; }
.site-toggle { display: none; margin-left: auto; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); cursor: pointer; place-items: center; }
.theme-light .credit-pill { background: var(--primary-soft); color: var(--text); }
.theme-light .page { padding-top: 28px; }

/* ===== public hero (above the builder) ===== */
.hero-public { text-align: center; padding: 34px 0 30px; max-width: 760px; margin: 0 auto; }
.hero-public .eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--primary); background: var(--primary-soft); padding: 6px 14px; border-radius: 999px; }
.hero-public h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -0.03em; margin: 18px 0 14px; }
.hero-public p { font-size: 18px; color: var(--muted); margin: 0 auto; max-width: 600px; }
.cta-bottom { margin-top: 22px; padding: 26px; border-radius: var(--radius); text-align: center; background: linear-gradient(160deg, rgba(124, 58, 237, 0.09), rgba(168, 85, 247, 0.05)); border: 1px solid rgba(124, 58, 237, 0.22); }
.cta-bottom h3 { font-size: 22px; letter-spacing: -0.02em; }
.cta-bottom p { color: var(--muted); margin: 6px auto 16px; max-width: 520px; }
.cta-bottom .small-links { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* auth pages */
.theme-light .auth-brand { background: linear-gradient(160deg, #0b0816, #12091f); color: var(--text); }
.theme-light .auth-headline { color: var(--text); }
.theme-light .auth-lead, .theme-light .auth-points span, .theme-light .auth-foot { color: var(--muted); }
.theme-light .auth-panel { background: var(--bg); }

@media (max-width: 1260px) {
  .sitebar-in { padding: 0 16px; gap: 12px; flex-wrap: wrap; height: auto; min-height: 60px; }
  .site-toggle { display: inline-grid; }
  .site-nav { display: none; flex-basis: 100%; order: 3; flex-direction: column; align-items: stretch; padding: 4px 0 12px; margin: 0; }
  .site-actions { display: none; flex-basis: 100%; order: 4; padding-bottom: 12px; }
  .sitebar.open .site-nav { display: flex; }
  .sitebar.open .site-actions { display: flex; }
  .site-link { padding: 11px 12px; }
}
@media (max-width: 600px) { .theme-light .page { padding: 20px 16px 48px; } .hero-public p { font-size: 16px; } }

/* toasts on the light theme */
.theme-light .toast { background: var(--card); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); }
.theme-light .toast-body { color: var(--text); }
.theme-light .toast-close { color: var(--muted); }

/* native dropdown lists keep their dark panel, so the option text must be white */
.theme-light .select option, .theme-light select option { background: #0f1729; color: #ffffff; }
.theme-light .select option:checked { background: #6d28d9; color: #ffffff; }
.merge-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.demo-dl { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.demo-dl p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }

/* member navigation: Account dropdown (My Pages, Credits, Account Settings) */
.site-menu { position: relative; }
.site-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-caret { font-size: 11px; opacity: .7; }
.site-menu[open] > summary { background: var(--primary-soft); color: var(--primary); }
.site-menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; z-index: 60; background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); display: grid; gap: 2px; }
.site-menu-item { padding: 9px 12px; border-radius: 8px; color: var(--text-soft); text-decoration: none; font-weight: 560; font-size: 14px; white-space: nowrap; }
.site-menu-item:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.site-menu-item.active { color: var(--primary); background: var(--primary-soft); }
.site-howto { padding: 8px 10px; }
@media (max-width: 900px) {
  .site-menu-list { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 12px; min-width: 0; }
  .site-menu > summary { width: 100%; justify-content: space-between; }
}

/* dashboard language selector (header) */
.lang-switch { position: relative; order: 5; }
.lang-btn { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; min-height: 40px; }
.lang-btn::-webkit-details-marker { display: none; }
.lang-btn:hover, .lang-switch[open] > .lang-btn { background: var(--primary-soft); color: var(--primary); }
.lang-btn:focus-visible, .lang-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lang-code { display: none; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; max-width: 86vw; z-index: 70; background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); display: grid; gap: 2px; margin: 0; }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font: inherit; font-weight: 560; font-size: 14px; cursor: pointer; min-height: 40px; }
.lang-item:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.lang-item.active { color: var(--primary); background: var(--primary-soft); }
.lang-item-code { font-size: 11.5px; opacity: .65; letter-spacing: .05em; }
@media (max-width: 1260px) { .lang-switch { order: 1; margin-left: auto; } .site-toggle { margin-left: 0; } }
@media (max-width: 600px) { .lang-name { display: none; } .lang-code { display: inline; } .lang-btn { padding: 8px 10px; } .lang-list { right: -4px; } }

.auth-panel { position: relative; }
.auth-lang { position: absolute; top: 14px; right: 14px; z-index: 5; }
.auth-lang .lang-list { right: 0; }

@media (min-width: 1261px) and (max-width: 1560px) { .lang-name { display: none; } .lang-code { display: inline; } .sitebar-in { gap: 16px; } }

.site-menu-credit { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 2px; border-radius: 8px; background: var(--primary-soft); color: var(--text); font-weight: 650; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.site-menu-form { margin: 2px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.site-menu-logout { width: 100%; text-align: left; background: transparent; border: 0; font: inherit; font-weight: 560; font-size: 14px; cursor: pointer; color: var(--text-soft); }
.site-menu-logout:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
@media (min-width: 901px) { .site-nav { margin-right: 0; } .lang-switch { margin-left: auto; } }
