/* ==========================================================================
   layout.css — Structural Layout · MyClubCar Default Theme
   Acoperă: reset, body, shell (admin/client), layout public, layout auth
   ========================================================================== */

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

body {
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ==========================================================================
   LAYOUT 1 — ADMIN / CLIENT  (sidebar + topbar)
   shell > aside.sb + div.main > header.topbar + div.content
   ========================================================================== */

/* ── Shell ────────────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sb {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  background-image: radial-gradient(ellipse at 20% 0%, rgba(175,129,92,.07) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: var(--z-sidebar);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

/* Logo */
.sb-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sb-logo a { display: flex; align-items: center; gap: 10px; }
.sb-logo-mark {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-logo-mark svg { width: 18px; height: 18px; fill: #fff; }
.sb-logo-text {
  font-size: .9rem; font-weight: 800; color: #fff;
  letter-spacing: -.02em; line-height: 1.1;
}
.sb-logo-text em {
  display: block; font-style: normal; font-size: .6rem; font-weight: 400;
  color: rgba(255,255,255,.3); letter-spacing: .06em; text-transform: uppercase;
}

/* User block */
.sb-user {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sb-av {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-h) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 800; color: #fff; letter-spacing: .03em;
  box-shadow: 0 0 0 2.5px rgba(175,129,92,.25), 0 0 0 4px rgba(175,129,92,.1);
}
.sb-user-info { min-width: 0; flex: 1; }
.sb-uname { font-size: .82rem; font-weight: 700; color: #e8eaf0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ucomp { font-size: .67rem; color: rgba(255,255,255,.28); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Language selector */
.sb-lang {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.sb-lang-lbl {
  font-size: .6rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.22); flex: 1;
}
.lang-btn {
  font-size: .68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer; transition: all .13s; color: rgba(255,255,255,.4);
  background: none;
}
.lang-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.lang-btn:not(.active):hover { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.15); }

/* Nav */
.sb-nav { flex: 1; padding: 6px 0; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.sb-sec {
  font-size: .58rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.2);
  padding: 14px 18px 4px;
}
.sb-a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  font-size: .8rem; font-weight: 500;
  color: rgba(255,255,255,.4);
  border-left: 2px solid transparent;
  transition: all .12s;
  position: relative;
}
.sb-a:hover { color: rgba(255,255,255,.75); background: rgba(255,255,255,.04); }
.sb-a.on {
  color: var(--brand);
  border-left-color: var(--brand);
  background: rgba(175,129,92,.08);
  font-weight: 600;
}
.sb-a svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; opacity: .8; }
.sb-a.on svg { opacity: 1; }
.sb-a-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-a-ro { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-a-en { font-size: .6rem; opacity: .35; font-weight: 400; margin-top: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-a.on .sb-a-en { opacity: .55; color: var(--brand); }
.sb-badge {
  font-size: .58rem; font-weight: 800;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.4);
  border-radius: 20px; padding: 1px 6px;
  flex-shrink: 0;
}
.sb-a.on .sb-badge { background: var(--brand-light); color: var(--brand); }

/* Footer */
.sb-foot {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 6px 0;
  flex-shrink: 0;
}
.sb-foot-version { padding: 6px 18px 4px; font-size: .58rem; color: rgba(255,255,255,.15); }
.sb-out {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  font-size: .8rem; color: rgba(255,255,255,.3);
  border-left: 2px solid transparent;
  transition: all .12s; cursor: pointer; background: none; border: none; width: 100%; text-align: left;
}
.sb-out:hover { color: #f87171; background: rgba(248,113,113,.07); }
.sb-out svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; }

/* ── Overlay mobil ────────────────────────────────────────────────────────── */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: var(--z-overlay);
  opacity: 0;
  transition: opacity .25s ease;
}
.sb-overlay.open { opacity: 1; }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar (admin/client) ────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 58px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.tb-right { display: flex; align-items: center; gap: 8px; }

/* ── Hamburger — ascuns pe desktop ───────────────────────────────────────── */
.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t);
}
.btn-hamburger:hover { background: var(--bg); }
.btn-hamburger svg { width: 18px; height: 18px; stroke: var(--text-2); fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* ── Content area ─────────────────────────────────────────────────────────── */
.content { flex: 1; padding: 28px 28px 60px; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.pg-hd { margin-bottom: 26px; }
.pg-welcome { font-size: 1.5rem; font-weight: 800; color: var(--text-1); letter-spacing: -.03em; margin-bottom: 3px; }
.pg-welcome em { font-style: normal; color: var(--brand); }
.pg-sub { font-size: .82rem; color: var(--text-3); }

/* ── Two-column content grid ──────────────────────────────────────────────── */
.grid-main { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }

/* ── Footer aplicație ─────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  font-size: .7rem;
  color: var(--text-4);
  padding: 14px 28px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.app-footer a { color: var(--text-3); transition: color var(--t); }
.app-footer a:hover { color: var(--brand); }

/* ==========================================================================
   LAYOUT 2 — PUBLIC  (topbar dark full-width, fără sidebar)
   header.pub-topbar + main.pub-main
   ========================================================================== */

.pub-topbar {
  background: var(--navy);
  height: 62px;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.pub-topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 24px;
}

.pub-main {
  min-height: calc(100vh - 62px);
}

/* Brand în topbar public */
.topbar-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.topbar-logo-mark svg { width: 19px; height: 19px; fill: #fff; }
.topbar-logo-name { font-size: .95rem; font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1; }
.topbar-logo-sub { font-size: .58rem; font-weight: 500; color: rgba(255,255,255,.35); letter-spacing: .07em; text-transform: uppercase; margin-top: 2px; }
.topbar-sep { width: 1px; height: 22px; background: rgba(255,255,255,.12); margin: 0 4px; flex-shrink: 0; }

/* Nav public */
.topbar-nav { display: flex; gap: 2px; flex: 1; }
.topbar-nav a {
  color: rgba(255,255,255,.6);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .84rem; font-weight: 500;
  transition: all var(--t);
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.topbar-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar-nav a.on { background: rgba(175,129,92,.2); color: var(--brand); font-weight: 600; }
.topbar-nav a svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; opacity: .7; }

/* Right actions — topbar public */
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 6px 12px;
  color: rgba(255,255,255,.4); font-size: .8rem;
  cursor: text; transition: all var(--t); width: 180px;
}
.topbar-search:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); }
.topbar-search svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }

.lang-pill { display: flex; align-items: center; gap: 3px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; padding: 4px 3px; }
.lang-pill-btn { font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: none; border: none; cursor: pointer; color: rgba(255,255,255,.4); transition: all var(--t); }
.lang-pill-btn.active { background: var(--brand); color: #fff; }

.topbar-account {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  font-size: .8rem; color: rgba(255,255,255,.75); font-weight: 500;
  transition: all var(--t); cursor: pointer; white-space: nowrap;
}
.topbar-account:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar-account svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; opacity: .7; }
.topbar-av {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-h));
  display: flex; align-items: center; justify-content: center;
  font-size: .58rem; font-weight: 800; color: #fff; flex-shrink: 0;
}

/* ==========================================================================
   LAYOUT 3 — AUTH  (centrat, fără sidebar, fără topbar)
   div.auth-bg > div.auth-card
   ========================================================================== */

.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(175,129,92,.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.05) 0%, transparent 55%),
    var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 36px 36px 32px;
}

.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.auth-logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-mark svg { width: 20px; height: 20px; fill: #fff; }
.auth-logo-name { font-size: 1rem; font-weight: 800; color: var(--text-1); letter-spacing: -.02em; line-height: 1.1; }
.auth-logo-sub { font-size: .6rem; font-weight: 400; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }


/* ==========================================================================
   DARK MODE — buton toggle + overrides layout public
   ========================================================================== */

/* ── Buton dark/light toggle ────────────────────────────────────────────── */
.topbar-dm {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px; flex-shrink: 0; padding: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  cursor: pointer; transition: background var(--t); color: rgba(255,255,255,.6);
}
.topbar-dm:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar-dm svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Soare vizibil în light mode, lună vizibilă în dark mode */
.dm-sun  { display: block; }
.dm-moon { display: none; }
[data-theme="dark"] .dm-sun  { display: none; }
[data-theme="dark"] .dm-moon { display: block; }

/* ── Dark mode overrides — elemente structurale public ─────────────────── */
[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text-1);
}

[data-theme="dark"] .pub-topbar {
  background: #0A0D14;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
  border-bottom: 1px solid #1E2535;
}

[data-theme="dark"] .footer {
  background: #0A0D14;
  border-top: 1px solid var(--border);
  color: rgba(255,255,255,.25);
}
[data-theme="dark"] .footer a { color: rgba(255,255,255,.25); }
[data-theme="dark"] .footer a:hover { color: rgba(255,255,255,.55); }

[data-theme="dark"] .topbar-account,
[data-theme="dark"] .lang-pill {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
}

/* ── Dark mode overrides — overlay + modal ────────────────────────────── */
[data-theme="dark"] .overlay { background: rgba(0,0,0,.70); }

[data-theme="dark"] .modal,
[data-theme="dark"] .summary-panel,
[data-theme="dark"] .step-card,
[data-theme="dark"] .vc-card,
[data-theme="dark"] .vc-prod-hero-card,
[data-theme="dark"] .vc-sum-card,
[data-theme="dark"] .vc-share-card,
[data-theme="dark"] .vc-notfound-card,
[data-theme="dark"] .form-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .modal-head,
[data-theme="dark"] .modal-foot,
[data-theme="dark"] .step-hd,
[data-theme="dark"] .sum-head,
[data-theme="dark"] .vc-card-head,
[data-theme="dark"] .vc-sum-card-head,
[data-theme="dark"] .vc-share-card-head,
[data-theme="dark"] .form-card-head {
  background: rgba(175,129,92,.06);
  border-color: var(--border);
}

/* ── Dark mode overrides — form inputs ────────────────────────────────── */
[data-theme="dark"] .form-control {
  background: #131820;
  border-color: var(--border);
  color: var(--text-1);
}
[data-theme="dark"] .form-control:focus { border-color: var(--brand); }
[data-theme="dark"] .form-control::placeholder { color: var(--text-4); }

/* ── Dark mode overrides — powertrain v2 ─────────────────────────────── */
[data-theme="dark"] .pt2-card { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .opt-color,
[data-theme="dark"] .opt-img-card { background: var(--surface); border-color: var(--border); }

/* ── Dark mode overrides — opt items ─────────────────────────────────── */
[data-theme="dark"] .opt-item { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .opt-item:hover,
[data-theme="dark"] .opt-item.sel { background: var(--brand-light); border-color: var(--brand); }

/* ── Dark mode overrides — scrollbar ─────────────────────────────────── */
[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 4px; }

/* ── Dark mode overrides — tpl banner + configurator ─────────────────── */
[data-theme="dark"] .tpl-banner {
  background: linear-gradient(135deg,rgba(175,129,92,.10),rgba(175,129,92,.04));
  border-color: rgba(175,129,92,.20);
}

/* ── Dark mode overrides — view-config table ─────────────────────────── */
[data-theme="dark"] .vc-tr-group-sep td { background: rgba(255,255,255,.02); }
[data-theme="dark"] .vc-opts-table thead th { background: rgba(255,255,255,.03); }
[data-theme="dark"] .vc-opts-table tbody tr:hover { background: rgba(255,255,255,.02); }
[data-theme="dark"] .vc-prod-hero-img { background: linear-gradient(135deg,#1a1f2e,#131820); }

/* ── Dark mode overrides — request-quote ─────────────────────────────── */
[data-theme="dark"] .page-bg { background: var(--bg); }
[data-theme="dark"] .success-card { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .next-step-n { background: var(--brand); }

/* ── Dark mode overrides — turnstile ─────────────────────────────────── */
[data-theme="dark"] .turnstile-widget { background: #131820; border-color: var(--border); }
[data-theme="dark"] .turnstile-widget.ts-success { background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.25); }
[data-theme="dark"] .turnstile-widget.ts-error { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.25); }
