/*
 * AF-9196 — dark theme of the automoli Cake pages (same mechanism as vin-info in AF-9182, palette of the automoli.com
 * Astro front, ADR 20.69 in front-automoli). Loaded by Elements/am_theme_css.ctp with media=screen (printing stays
 * light); the class `dark` on <html> comes from Elements/am_theme_head.ctp. Every colour rule below sits under
 * html.dark, so the light pages do not change — only the theme toggle has base styles here.
 *
 * Palette (front-automoli globals.css, :root.dark):
 *   ground #0e1726 · band #142035 · card #18253c · line #2a3a54 · field line #3b4e6c
 *   text #dbe3ee · headings #e3ecf8 · secondary #a9b4c5 · link #6cb2ff · red as text #ff6b70
 *   brand fills (navy #002d5c / #294a7a, red #ca2027, blue #0668be) stay as they are: white text sits on them.
 *
 * Stage 1: pages rendered by the themed Automoli-* layouts (Elements/css.ctp) — Turnstile verification, order
 * summary (Elements/preorder/automoli/precheck_v2.ctp + theme/automoli/css/precheck-v2.css), "checking the
 * vehicle" before payment, VIN-check pages of the legacy site, 404.
 */

/* ─── Theme toggle (Elements/vi_theme_toggle.ctp) ─────────────────────────────────────────────────────────── */
/* Base for every toggle on automoli pages (the element always carries .vi-theme-toggle; vi-dark.css with the
   vin-info styles is never loaded here). Variants: --float (am_theme_corner), --bar and --sidebar (account). */
.vi-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; flex: 0 0 auto;
  border: 1px solid #e3e6ec; border-radius: 999px;
  background: transparent; color: #6b7388;
  cursor: pointer; line-height: 1;
}
.vi-theme-toggle:hover { color: #002d5c; border-color: #002d5c; }
.vi-theme-toggle:focus-visible { outline: 2px solid #4aa2ef; outline-offset: 2px; }
.vi-theme-toggle svg { width: 18px; height: 18px; }
.vi-theme-toggle .vi-icon-sun { display: none; }
html.dark .vi-theme-toggle .vi-icon-sun { display: block; }
html.dark .vi-theme-toggle .vi-icon-moon { display: none; }
html.dark .vi-theme-toggle { border-color: #2a3a54; color: #a9b4c5; }
html.dark .vi-theme-toggle:hover { color: #ffffff; border-color: #6cb2ff; }
/* Floating variant (Elements/am_theme_corner.ctp): it can land on any background, so it carries its own. */
.am-theme-corner { position: fixed; top: 16px; inset-inline-end: 16px; z-index: 1050; }
.vi-theme-toggle.am-theme-toggle--float {
  width: 40px; height: 40px;
  background: #ffffff; color: #475569; border-color: #d6dbe7;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}
html.dark .vi-theme-toggle.am-theme-toggle--float { background: #18253c; color: #dbe3ee; border-color: #2a3a54; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
/* Navy bars of the account (phone bar, sidebar header): white icon in both themes. */
.vi-theme-toggle.vi-theme-toggle--bar,
html.dark .vi-theme-toggle.vi-theme-toggle--bar {
  width: 30px; height: 30px; margin-left: auto; margin-right: 10px;
  color: #ffffff; border-color: rgba(255, 255, 255, 0.5);
}
.vi-theme-toggle.vi-theme-toggle--sidebar,
html.dark .vi-theme-toggle.vi-theme-toggle--sidebar {
  float: right; width: 28px; height: 28px; margin: 4px 10px 0 0;
  color: #ffffff; border-color: rgba(255, 255, 255, 0.5);
}
.vi-theme-toggle.vi-theme-toggle--bar:hover,
.vi-theme-toggle.vi-theme-toggle--sidebar:hover,
html.dark .vi-theme-toggle.vi-theme-toggle--bar:hover,
html.dark .vi-theme-toggle.vi-theme-toggle--sidebar:hover { color: #ffffff; border-color: #ffffff; }
.vi-theme-toggle.vi-theme-toggle--bar:focus-visible,
.vi-theme-toggle.vi-theme-toggle--sidebar:focus-visible { outline-color: #ffffff; }

.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after { transition: none !important; }

/* ─── Logos: the light-lettered copy (white "auto", light frame) replaces the regular one ─────────────────── */
.am-logo-dark { display: none !important; }
html.dark .am-logo-dark { display: inline-block !important; }
html.dark .am-logo-light { display: none !important; }
html.dark .am-precheck .am-brand .am-logo-dark { display: block !important; }

/* ─── Legacy automoli pages (bs4 + pg-*): Turnstile, checking the vehicle, VIN check, 404 ─────────────────── */
/* html too: clean.ctp paints both html and body #e5ebf0 inline. */
html.dark,
html.dark body { background-color: #0e1726; color: #dbe3ee; }
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6,
html.dark .h1, html.dark .h2, html.dark .h3, html.dark .h4, html.dark .h5, html.dark .h6 { color: #e3ecf8; }
html.dark a:not(.btn) { color: #6cb2ff; }
html.dark a:not(.btn):hover { color: #9dccff; }
html.dark .text-muted { color: #a9b4c5 !important; }
html.dark .text-dark { color: #dbe3ee !important; }
html.dark .bg-white { background-color: #0e1726 !important; }
/* Light-grey panels (pre-paid page, after-payment summary): the band colour, so they still read as panels. */
html.dark .bg-light { background-color: #142035 !important; }
html.dark .navbar-main,
html.dark .mm-top { border-color: #2a3a54; }
html.dark .lead { color: #dbe3ee; }
/* Payment status on the after-payment summary (Order/order_summary.ctp): Bootstrap-custom colours with !important. */
html.dark .card .text-blue { color: #6cb2ff !important; }
html.dark .card .text-red { color: #ff6b70 !important; }
html.dark .card .text-green { color: #4fd08a !important; }  /* cards only: pg/pg-precheck.css makes .text-green red */
/* pg-mainpage.css: footer { color: #294a7a !important } and footer.footer on #f5f5f5. */
html.dark footer { color: #a9b4c5 !important; }
html.dark footer.footer { background-color: #0e1726; }
html.dark hr { border-color: #2a3a54; }
html.dark .card { background-color: #18253c; border-color: #2a3a54; color: #dbe3ee; }
html.dark .form-control,
html.dark .custom-select {
  background-color: #0e1726; border-color: #3b4e6c; color: #e6ecf5;
}
html.dark .form-control::placeholder { color: #7f8ca1; }
html.dark .form-control:focus { background-color: #0e1726; color: #e6ecf5; border-color: #6cb2ff; }
html.dark .modal-content { background-color: #18253c; color: #dbe3ee; border-color: #2a3a54; }
/* Dropdowns (bootstrap-select in the account, e.g. the business country picker: its options are light text). */
html.dark .dropdown-menu { background-color: #18253c; color: #dbe3ee; border-color: #2a3a54; }
html.dark .dropdown-item { color: #dbe3ee; }
html.dark .dropdown-item:hover,
html.dark .dropdown-item:focus { background-color: #223150; color: #ffffff; }
html.dark .modal-header,
html.dark .modal-footer { border-color: #2a3a54; }
html.dark .close { color: #dbe3ee; text-shadow: none; }
html.dark .table { color: #dbe3ee; }
html.dark .table td,
html.dark .table th { border-color: #2a3a54; }
/* "Checking the vehicle" (Preorder/check_preorder_availabity.ctp): progress icons are dark line art on white. */
html.dark #progress img { filter: invert(0.88) hue-rotate(180deg); }
html.dark .overlay { background-color: rgba(5, 9, 15, 0.7); }

/* ─── Order summary (precheck_v2.ctp, theme/automoli/css/precheck-v2.css) ──────────────────────────────────── */
/* --am-navy / --am-accent* also paint buttons and badges under white text, so they keep their values; text that
   used them on white is lifted selector by selector below. */
html.dark .am-precheck {
  --am-ink: #e6ecf5;
  --am-muted: #a9b4c5;
  --am-border: #2a3a54;
  --am-bg: #142035;
  --am-accent-bg: rgba(202, 32, 39, 0.16);
  --am-shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  background: #0e1726;
}
html.dark .am-precheck .am-topbar { background: #0e1726; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
html.dark .am-precheck .am-right { background: #0e1726; }

html.dark .am-precheck .am-login { color: #dbe3ee; }
html.dark .am-precheck .am-login:hover { background: #18253c; color: #ffffff; }
html.dark .am-precheck .am-login i { color: #a9b4c5; }

html.dark .am-precheck .am-h2-box { background: linear-gradient(135deg, rgba(202, 32, 39, 0.18) 0%, #18253c 100%); border-color: rgba(202, 32, 39, 0.4); }
html.dark .am-precheck .am-h2-box h4 { color: #e3ecf8; }

html.dark .am-precheck .am-pkg-strip .packet-item { background: #18253c; }
html.dark .am-precheck .am-pkg-strip .packet-item:hover { border-color: #3b4e6c; }
html.dark .am-precheck .am-pkg-strip .packet-item.active { background: rgba(202, 32, 39, 0.16); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
html.dark .am-precheck .am-pkg-strip .am-pprice { color: #e3ecf8; }
html.dark .am-precheck .am-pkg-strip .am-pprice small,
html.dark .am-precheck .am-pkg-strip .packet-item.active .am-pprice { color: #ff8a8f; }
html.dark .am-precheck .am-pkg-strip .am-pt s { color: #7f8ca1; }
html.dark .am-precheck .am-pkg-strip .am-check { background: #0e1726; border-color: #3b4e6c; }
html.dark .am-precheck .am-pkg-strip .packet-item.active .am-check { background: var(--am-accent); border-color: var(--am-accent); }

html.dark .am-precheck .am-pay-row .payment-item { background: #18253c; color: #a9b4c5; }
html.dark .am-precheck .am-pay-row .payment-item i { color: #dbe3ee; }
html.dark .am-precheck .am-pay-row .payment-item:hover { border-color: #3b4e6c; }
html.dark .am-precheck .am-pay-row .payment-item.active { border-color: #4aa2ef; background: #0b3a73; color: #ffffff; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35); }
html.dark .am-precheck .am-pay-row .payment-item.active i { color: #ffffff; }
/* Payment logos drawn dark on white (BLIK, GPay, PayPal, Apple Pay): light on the dark tile. */
html.dark .am-precheck .am-pay-row .payment-item img { filter: brightness(0) invert(1); opacity: 0.92; }

html.dark .am-precheck .am-fc { background: #0e1726; border-color: #3b4e6c; color: #e6ecf5; }
html.dark .am-precheck .am-fc::placeholder { color: #7f8ca1; }
html.dark .am-precheck .am-ig button { background: #0b3a73; }
html.dark .am-precheck .am-ig button:hover { background: #0668be; }
html.dark .am-precheck #dc-box-info,
html.dark .am-precheck .am-statement { color: #ffc9cb; }
html.dark .am-precheck #dc-box-info button#dc-delete { color: #ff8a8f; }
html.dark .am-precheck .am-statement b,
html.dark .am-precheck .am-cc .am-lk,
html.dark .am-precheck .am-cc .am-req { color: #ff8a8f; }
html.dark .am-precheck .am-cc { color: #dbe3ee; }
html.dark .am-precheck .am-cc input[type="checkbox"] { background: #0e1726; border-color: #6b7a93; }
html.dark .am-precheck .am-cc input[type="checkbox"]:hover { border-color: #6cb2ff; }
html.dark .am-precheck .am-cc input[type="checkbox"]:checked { background: #0668be; border-color: #0668be; }

html.dark .am-precheck .am-cta.disabled,
html.dark .am-precheck .am-cta:disabled { opacity: .45; }
html.dark .am-precheck .am-price-pill { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
html.dark .am-precheck .am-privacy,
html.dark .am-precheck .am-privacy .am-clauses,
html.dark .am-precheck .am-privacy .am-clauses p,
html.dark .am-precheck .am-privacy :is(.info-clause, .rodo-clause),
html.dark .am-precheck .am-privacy :is(.info-clause, .rodo-clause) :is(p, ol, ul, li, strong) { color: #c3ccda; }
html.dark .am-precheck .am-privacy::-webkit-scrollbar-thumb { background: #3b4e6c; }
html.dark .am-precheck .am-next-vin input { background: #0e1726; border-color: #3b4e6c; color: #e6ecf5; }
html.dark .am-precheck .am-next-vin input::placeholder { color: #7f8ca1; }
html.dark .am-precheck .am-next-vin button { background: #0b3a73; }
html.dark .am-precheck .am-next-vin button:hover { background: #0668be; }
html.dark .am-precheck .modal-title { color: #e3ecf8; }
html.dark .am-precheck a:not([class]) { color: #6cb2ff; }
html.dark .am-precheck .am-foot a { color: #dbe3ee; }
html.dark .am-precheck .am-foot a:hover { color: #ff8a8f; }

/* Toggle in the white (now dark) top bar, before the login link. */
.am-precheck .am-topbar-r .am-topbar-in { gap: 10px; }
/* Below 400 px the 130 px logo, the toggle and "Zaloguj się" did not fit one row (the login label wrapped at 320 px):
   a smaller logo and toggle there. The longest labels ("Felhasználói fiókom", hu, logged in) still wrap — they must
   not push the toggle over the logo. */
@media (max-width: 399.98px) {
  .am-precheck .am-topbar .am-brand .am-brand-logo { width: 112px; } /* one class more than precheck-v2.css (loaded later) */
  .am-precheck .am-topbar .am-theme-toggle { width: 32px; height: 32px; }
  .am-precheck .am-topbar-r .am-topbar-in { gap: 8px; }
  .am-precheck .am-topbar-l { flex: 0 0 auto; }
  .am-precheck .am-login { line-height: 1.2; text-align: center; }
}

/* ─── Legacy precheck styles (pg/pg-precheck.css): pre-paid licence page (PrepaidCodes/index), VIN check of
       automoli-gb, plate checks ───────────────────────────────────────────────────────────────────────────── */
html.dark .packet-item,
html.dark .packet-selects .packet-item { background-color: #18253c; }
html.dark .packet-selects .packet-item { border-color: #2a3a54 !important; }
html.dark .packet-selects .packet-item.active:not(.item-disabled) { background-color: rgba(202, 32, 39, 0.16); border-color: #ba3330 !important; }
html.dark .packet-item label p { color: #dbe3ee; }
html.dark .packet-selects .packet-item .packet-icon::before { color: #5d6c85; }
html.dark .payment-item.active { background-color: #18253c !important; } /* license_purchase.ctp: #fff !important */
html.dark .fontColorLabels { color: #6cb2ff !important; } /* license_purchase.ctp: #2774a0 !important */
html.dark .payment-item:hover,
html.dark .payment-item.active { border-color: #4aa2ef; }
html.dark .info-clause,
html.dark .rodo-clause { background-color: #142035; border-color: #2a3a54; }
html.dark :is(.info-clause, .rodo-clause) :is(p, ul, ol, li, a) { color: #b4bfcf; }
html.dark .report-item.active { background-color: #18253c; border-color: #3b4e6c; }
html.dark .pc-info .report-item { background-color: #18253c !important; }
html.dark .pc-info table tr.head { border-bottom-color: #2a3a54; }
html.dark .custom-range-qnt { background-color: transparent; }
/* Number plates on the plate-check result (assets/css/pg-precheck.css .pc-reg, .pc-reg-uk): white or yellow plate,
   dark letters in both themes — they set no text colour and would inherit the light page text. */
html.dark :is(.pc-reg, .pc-reg-uk) { color: #111111; }
/* Payment logos of the legacy checkouts (Elements/preorder/payments.ctp, Account/order_prepaid_code.ctp): PNGs made for a
   light background (Google Pay, PayPal) — a white backing under them on the dark tile. */
html.dark .payment-item .pi-img { background-color: #ffffff; border-radius: 6px; }
/* Pre-paid footer (Elements/PrepaidCodes/footer.ctp): inline #f9f9f9. */
html.dark footer[style*="#f9f9f9"] { background-color: #142035 !important; }
/* Red text (old prices, required marks): lighter red on the dark ground. pg/pg-precheck.css also paints .text-green
   red (#ba3330 !important) — on the pages that load it, the same lighter red (a browser without :has() keeps #ba3330). */
html.dark .text-danger { color: #ff6b70 !important; }
html.dark:has(link[href*="pg-precheck.css"]) .text-green { color: #ff6b70 !important; }  /* pg/ and assets/css/ copies */

/* Technical problems (clean layout, Static/technical_problems.ctp): from 700 px the message sits on the white screen of
   the laptop illustration — its text stays dark there; below 700 px the artwork is dropped and the light text applies. */
@media (min-width: 700px) {
  html.dark .content-box,
  html.dark .content-box .tp-slide-text,
  html.dark .content-box .tp-slide-title { color: #212529; }
  html.dark .content-box .tp-title { color: #2d6294; }
}
