/* CME Checkout Brand Theme — CSS only.
   Tokens: navy #1a1a2e bg, lifted surfaces, near-white text, gold #f5c518 accents.
   Constraints honored: nothing hidden or repositioned; express-payment buttons and
   gateway iframe internals untouched (they self-render). */

/* @import must precede every rule in the sheet. Guarantees the Barlow face for
   the account masthead even if this file ever loads without the enqueued
   cme-checkout-fonts stylesheet. */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700&display=swap");

:root {
  --cme-navy: #1a1a2e;
  --cme-surface: #232338;
  --cme-surface-2: #2a2a44;
  --cme-text: #f4f4f8;
  --cme-text-dim: #b9b9cc;
  --cme-gold: #f5c518;
  --cme-gold-dark: #d9ab06;
  --cme-line: rgba(255, 255, 255, 0.12);
}

body.woocommerce-checkout,
body.woocommerce-cart,
body.woocommerce-order-received {
  background: var(--cme-navy);
  color: var(--cme-text);
  font-family: "Outfit", system-ui, sans-serif;
}

body.woocommerce-checkout h1, body.woocommerce-checkout h2, body.woocommerce-checkout h3, body.woocommerce-checkout h4,
body.woocommerce-cart h1, body.woocommerce-cart h2, body.woocommerce-cart h3, body.woocommerce-cart h4,
body.woocommerce-order-received h1, body.woocommerce-order-received h2, body.woocommerce-order-received h3 {
  font-family: "Barlow Condensed", "Outfit", sans-serif;
  letter-spacing: 0.02em;
  color: var(--cme-text);
}

body.woocommerce-checkout a, body.woocommerce-cart a, body.woocommerce-order-received a {
  color: var(--cme-gold);
}
body.woocommerce-checkout a:hover, body.woocommerce-cart a:hover, body.woocommerce-order-received a:hover {
  color: #ffe27a;
}

/* ── Blocks checkout shell + order summary card ─────────────────────────── */
.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart {
  color: var(--cme-text);
}
.wc-block-components-sidebar .wc-block-components-panel,
.wc-block-components-order-summary,
.wc-block-components-totals-wrapper,
.wc-block-cart .wc-block-cart__sidebar,
.wc-block-components-checkout-order-summary__content {
  background: var(--cme-surface);
  border-color: var(--cme-line);
  color: var(--cme-text);
}
.wc-block-components-checkout-step,
.wc-block-components-main .wc-block-components-checkout-step__container {
  background: transparent;
  border-color: var(--cme-line);
}
.wc-block-components-checkout-step__title,
.wc-block-components-title,
.wc-block-components-checkout-order-summary__title {
  font-family: "Barlow Condensed", "Outfit", sans-serif;
  color: var(--cme-text);
}
.wc-block-components-checkout-step__description,
.wc-block-components-order-summary-item__description,
.wc-block-components-product-metadata,
.wc-block-components-totals-item__description {
  color: var(--cme-text-dim);
}
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
  color: var(--cme-gold);
}
.wc-block-components-divider, .wc-block-components-order-summary-item {
  border-color: var(--cme-line);
}

/* ── Inputs: dark surfaces, visible gold focus ──────────────────────────── */
.wc-block-components-text-input input,
.wc-block-components-combobox .components-combobox-control__input,
.wp-block-woocommerce-checkout input[type="text"],
.wp-block-woocommerce-checkout input[type="email"],
.wp-block-woocommerce-checkout input[type="tel"],
.wp-block-woocommerce-checkout input[type="number"],
.wp-block-woocommerce-checkout select,
.wp-block-woocommerce-checkout textarea,
body.woocommerce-checkout .input-text,
body.woocommerce-cart .input-text {
  background: var(--cme-surface-2);
  color: var(--cme-text);
  border: 1px solid var(--cme-line);
}
.wc-block-components-text-input label,
.wc-block-components-combobox label,
.wc-block-components-checkbox__label,
.wc-block-components-radio-control__label {
  color: var(--cme-text-dim);
}
.wc-block-components-text-input input:focus,
.wp-block-woocommerce-checkout select:focus,
.wp-block-woocommerce-checkout textarea:focus,
body.woocommerce-checkout .input-text:focus {
  border-color: var(--cme-gold);
  outline: 2px solid var(--cme-gold);
  outline-offset: 1px;
  box-shadow: none;
}
.wp-block-woocommerce-checkout input[type="checkbox"],
.wp-block-woocommerce-checkout input[type="radio"],
body.woocommerce-cart input[type="checkbox"] {
  accent-color: var(--cme-gold);
}

/* ── Buttons: gold with dark text (contrast ~10:1) ──────────────────────── */
.wc-block-components-button:not(.is-link),
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button,
body.woocommerce-checkout button.button,
body.woocommerce-cart button.button,
body.woocommerce-cart .checkout-button {
  background: var(--cme-gold);
  color: var(--cme-navy);
  border: none;
  font-family: "Barlow Condensed", "Outfit", sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wc-block-components-button:not(.is-link):hover,
.wc-block-components-checkout-place-order-button:hover,
body.woocommerce-cart .checkout-button:hover {
  background: var(--cme-gold-dark);
  color: var(--cme-navy);
}
.wc-block-components-button:not(.is-link):focus-visible {
  outline: 2px solid var(--cme-text);
  outline-offset: 2px;
}

/* ── Notices and errors: readable on dark (contrast-checked pairings) ───── */
.wc-block-components-notice-banner.is-error {
  background: #46232a;
  border-color: #e5484d;
  color: #ffd9d6; /* on #46232a ≈ 9.8:1 */
}
.wc-block-components-notice-banner.is-error a { color: #ffb4ab; }
.wc-block-components-notice-banner.is-success {
  background: #1f3a2a;
  border-color: #46a758;
  color: #d3f5dd; /* ≈ 10:1 */
}
.wc-block-components-notice-banner.is-info,
.wc-block-components-notice-banner.is-warning {
  background: var(--cme-surface-2);
  border-color: var(--cme-gold);
  color: var(--cme-text);
}
.wc-block-components-validation-error,
.wc-block-components-text-input.has-error input {
  color: #ffb4ab;
  border-color: #e5484d;
}
.wc-block-components-text-input.has-error label { color: #ffb4ab; }

/* ── Payment methods area: containers only; gateway internals untouched ── */
.wc-block-components-radio-control-accordion-option,
.wc-block-checkout__payment-method .wc-block-components-radio-control__option {
  background: var(--cme-surface);
  border-color: var(--cme-line);
  color: var(--cme-text);
}
/* Express payments (PayPal buttons etc.) and the Authorize.net inline iframe
   are deliberately NOT styled: no rules target
   .wc-block-components-express-payment internals or iframe contents. */

/* ── Order received / confirmation ──────────────────────────────────────── */
.wc-block-order-confirmation-summary,
.wc-block-order-confirmation-totals-wrapper,
.woocommerce-order-overview,
.woocommerce-table--order-details {
  background: var(--cme-surface);
  border-color: var(--cme-line);
  color: var(--cme-text);
}
.woocommerce-thankyou-order-received {
  font-family: "Barlow Condensed", "Outfit", sans-serif;
  font-size: 1.5em;
  color: var(--cme-gold);
}

/* ── Cart table (classic + blocks) ──────────────────────────────────────── */
body.woocommerce-cart table.shop_table,
.wc-block-cart-items {
  background: var(--cme-surface);
  border-color: var(--cme-line);
  color: var(--cme-text);
}
.wc-block-cart-items__row, body.woocommerce-cart table.shop_table td, body.woocommerce-cart table.shop_table th {
  border-color: var(--cme-line);
}

/* ── POST-LIVE HOTFIX P1: contrast ──────────────────────────────────────── */

/* 1. Placeholders: explicit dim-but-legible color.
      #b9b9cc on input bg #2a2a44 ≈ 7.2:1 (≥ 4.5:1 requirement met). */
.wc-block-components-text-input input::placeholder,
.wp-block-woocommerce-checkout input::placeholder,
.wp-block-woocommerce-checkout textarea::placeholder,
.wc-block-components-textarea::placeholder,
textarea#order_comments::placeholder,
body.woocommerce-checkout .input-text::placeholder,
body.woocommerce-cart .input-text::placeholder {
  color: var(--cme-text-dim);
  opacity: 1; /* Firefox dims placeholders by default */
}

/* P2a. Account surface placeholders: no rule existed; Chrome UA default rendered
      ~1.14:1 on the #1a1a2e fields (CHK-R1 §A). --cme-text-dim measures 8.83:1 there. */
body.woocommerce-account .woocommerce input.input-text::placeholder,
body.woocommerce-account .woocommerce textarea::placeholder {
  color: var(--cme-text-dim);
  opacity: 1; /* Firefox dims placeholders by default */
}

/* P2b. Autofill companions: the pale autofill fill (#e4f0f6, line 253) pairs with
      dark value text, but placeholder + wc-blocks label kept --cme-text-dim ≈ 1.67:1
      over it (frozen by the 9999999s persistence hack even on cleared fields).
      #1a1a2e on #e4f0f6 ≈ 13:1. Label follows input in wc-blocks markup, so + works. */
body.woocommerce-checkout input:-webkit-autofill::placeholder,
.wp-block-woocommerce-checkout input:-webkit-autofill::placeholder,
body.woocommerce-cart input:-webkit-autofill::placeholder {
  color: #1a1a2e;
  -webkit-text-fill-color: #1a1a2e;
  opacity: 0.75;
}
.wc-block-components-text-input input:-webkit-autofill + label,
.wc-block-components-combobox .components-combobox-control__input:-webkit-autofill + label {
  color: #1a1a2e;
}

/* 2. Order-note textarea: explicit color + bg in BOTH states (the blocks
      textarea sits outside the earlier scope and inherited dark-on-dark). */
.wc-block-components-textarea,
textarea#order_comments {
  background: var(--cme-surface-2);
  color: var(--cme-text);
  border: 1px solid var(--cme-line);
}
.wc-block-components-textarea:focus,
textarea#order_comments:focus {
  border-color: var(--cme-gold);
  outline: 2px solid var(--cme-gold);
  outline-offset: 1px;
  box-shadow: none;
}

/* 3. Chrome autofill: pin the forced teal to a stable readable tint with dark
      text. Blanket body scope also covers the Authorize.net inline card fields
      (SAQ A-EP: they are page inputs, not iframe internals).
      #1a1a2e on #e4f0f6 ≈ 13:1. */
body.woocommerce-checkout input:-webkit-autofill,
body.woocommerce-checkout input:-webkit-autofill:hover,
body.woocommerce-checkout input:-webkit-autofill:focus,
body.woocommerce-cart input:-webkit-autofill,
body.woocommerce-cart input:-webkit-autofill:hover,
body.woocommerce-cart input:-webkit-autofill:focus,
.wp-block-woocommerce-checkout input:-webkit-autofill,
.wp-block-woocommerce-checkout input:-webkit-autofill:hover,
.wp-block-woocommerce-checkout input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1a1a2e;
  caret-color: #1a1a2e;
  box-shadow: 0 0 0 1000px #e4f0f6 inset; /* controls the autofill fill bg */
  border-color: var(--cme-gold);
  transition: background-color 9999999s ease-out 0s; /* persistence hack */
}

/* ── S8-P04: Account masthead ───────────────────────────────────────────── */

/* Static band on the My Account page title (Twenty Twenty-Five renders it as
   h1.wp-block-post-title). Scoped to account surfaces only; the rest of the
   account page keeps the theme's light styling. No motion. */
body.woocommerce-account h1.wp-block-post-title {
  background: linear-gradient(#1a1a2e, #0a0a0a);
  border-bottom: 3px solid #f5c518;
  color: #fafafa;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 18px 24px;
}

/* ── S8-P08: Account dark skin ──────────────────────────────────────────── */

/* Full dark theme for My Account surfaces, scoped body.woocommerce-account
   (checkout/cart/order-received carry their own body classes; storefront is
   Vercel — neither is touched). Selector provenance: 2026-08-11 logged-out
   /my-account/ extraction + the installed WooCommerce myaccount templates on
   prod (navigation.php, orders.php, form-edit-account.php, my-address.php;
   is-active emitted by wc-account-functions.php). Values are T.* tokens
   (black #0a0a0a, white #fafafa, gold #f5c518, navy #1a1a2e) plus this
   sheet's existing --cme-gold-dark for button hover. */

body.woocommerce-account {
  /* Native inputs, autofill, and scrollbars ignore CSS colors without this
     (CPL Dark Theme Card System). */
  color-scheme: dark;
  background: #0a0a0a;
  color: #fafafa;
}

body.woocommerce-account a { color: #f5c518; }
body.woocommerce-account a:hover { color: #fafafa; }

/* Header + footer template parts: text and currentColor icons (account,
   mini-cart) go light. */
body.woocommerce-account header.wp-block-template-part,
body.woocommerce-account footer.wp-block-template-part {
  color: #fafafa;
}

/* ── MyAccount navigation: current item gold, others light ──────────────── */
/* Color only — theme spacing preserved. Non-current links rest light, so
   their hover feedback is gold (the global light hover would be invisible
   on them). */
body.woocommerce-account .woocommerce-MyAccount-navigation a {
  color: #fafafa;
}
body.woocommerce-account .woocommerce-MyAccount-navigation a:hover,
body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  color: #f5c518;
}

/* ── Forms: login, edit-account, edit-address ───────────────────────────── */
/* textarea has no instance on core my-account endpoints today — packet-listed
   forward cover for plugin-added fields, not a traced target. */
body.woocommerce-account .woocommerce input.input-text,
body.woocommerce-account .woocommerce select,
body.woocommerce-account .woocommerce textarea {
  background: #1a1a2e;
  border: 1px solid rgba(250, 250, 250, 0.18);
  color: #fafafa;
}
body.woocommerce-account .woocommerce input[type="checkbox"] {
  accent-color: #f5c518;
}

/* Buttons: gold CTA on the black page, matching the storefront primary
   (gold bg, navy text). button.button covers the login submit and Save
   changes; a.button covers order-row actions, pagination, and wc-forward.
   Hover pins the gold family — otherwise the theme's wp-element-button
   hover would flip them dark. */
body.woocommerce-account .woocommerce button.button,
body.woocommerce-account .woocommerce a.button {
  background: #f5c518;
  color: #1a1a2e;
  border: none;
}
body.woocommerce-account .woocommerce button.button:hover,
body.woocommerce-account .woocommerce a.button:hover {
  background: var(--cme-gold-dark);
  color: #1a1a2e;
}

/* ── Order tables (this store runs no subscriptions) ────────────────────── */
body.woocommerce-account .woocommerce table.shop_table thead th {
  background: #1a1a2e;
  color: #fafafa;
}
body.woocommerce-account .woocommerce table.shop_table th,
body.woocommerce-account .woocommerce table.shop_table td {
  border-color: rgba(250, 250, 250, 0.12);
}

/* ── Footer: suppress theme attribution + duplicated identity ───────────── */
/* KEPT after S8-P10 as the fail-open fallback: when cme-cms-footer.php cannot
   find the scope helper it leaves the THEME footer rendering, and these hides
   then still suppress its attribution on account pages. Selectors are
   disjoint from .cme-cms-footer (the branded markup carries none of these
   classes), so the two blocks never fight. Exact extraction matches: the
   site-logo div, the h2 site-title (the header's is a p, untouched), and the
   two small-font credit paragraphs ("Twenty Twenty-Five", "Designed with
   WordPress"). */
body.woocommerce-account footer.wp-block-template-part .wp-block-site-logo,
body.woocommerce-account footer.wp-block-template-part h2.wp-block-site-title,
body.woocommerce-account footer.wp-block-template-part p.has-small-font-size.wp-block-paragraph {
  display: none;
}

/* ── S8-P10: Branded CMS footer (.cme-cms-footer) ───────────────────────── */

/* Styles for the markup emitted by mu-plugin cme-cms-footer.php on
   checkout-lane surfaces. Everything is scoped under .cme-cms-footer, so the
   theme footer is unaffected anywhere the scope function returns false.
   Mirrors the storefront Footer visual system (App.tsx:1758-1860): T.black
   ground, gold rule, Barlow Condensed headings, Outfit body. Space Mono is
   not enqueued on the CMS, so chips fall back to system monospace.
   Double-class nesting is deliberate: (0,2,1)+ outweighs the S8-P08
   page-level body.woocommerce-account link rules at (0,1,2), keeping footer
   link colors mirror-accurate on the dark account pages. */
.cme-cms-footer {
  background: #0a0a0a; /* T.black */
  color: rgba(255, 255, 255, 0.6);
  font-family: "Outfit", system-ui, sans-serif;
  position: relative;
}
.cme-cms-footer .cme-cms-footer__rule {
  height: 1px;
  max-width: 80%;
  margin: 0 auto;
  background: linear-gradient(to right, #f5c518 0%, #f5c518 20%, transparent 100%);
}
.cme-cms-footer .cme-cms-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 0;
}
.cme-cms-footer .cme-cms-footer__columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding-bottom: 36px;
}
@media (max-width: 960px) {
  .cme-cms-footer .cme-cms-footer__columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .cme-cms-footer .cme-cms-footer__columns { grid-template-columns: 1fr; }
}
.cme-cms-footer .cme-cms-footer__logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  /* Own color + no underline so the page-level link rules cannot style the
     alt text (image-load failure) or underline the image box. */
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}
.cme-cms-footer .cme-cms-footer__logo img { height: 40px; width: auto; display: block; }
.cme-cms-footer .cme-cms-footer__subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 12px;
}
.cme-cms-footer .cme-cms-footer__tagline {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  max-width: 260px;
  margin: 0 0 16px;
}
.cme-cms-footer .cme-cms-footer__social { display: flex; gap: 10px; }
.cme-cms-footer .cme-cms-footer__social span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(245, 197, 24, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: #f5c518;
}
.cme-cms-footer .cme-cms-footer__heading {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 18px;
}
.cme-cms-footer .cme-cms-footer__links a {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
  text-decoration: none;
  transition: color 0.2s;
}
.cme-cms-footer .cme-cms-footer__links a:hover { color: #f5c518; }
.cme-cms-footer .cme-cms-footer__join p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin: 0 0 14px;
}
.cme-cms-footer .cme-cms-footer__join a {
  color: #f5c518;
  font-size: 13px;
  text-decoration: none;
}
.cme-cms-footer .cme-cms-footer__join a:hover { color: #fafafa; }
.cme-cms-footer .cme-cms-footer__badges {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cme-cms-footer .cme-cms-footer__badges span {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cme-cms-footer .cme-cms-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.cme-cms-footer .cme-cms-footer__copyright {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}
.cme-cms-footer .cme-cms-footer__copyright a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}
.cme-cms-footer .cme-cms-footer__copyright a:hover { color: #f5c518; }
.cme-cms-footer .cme-cms-footer__pay { display: flex; gap: 8px; }
.cme-cms-footer .cme-cms-footer__pay span {
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-family: "Space Mono", monospace;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
}
.cme-cms-footer .cme-cms-footer__legal { display: flex; gap: 16px; }
.cme-cms-footer .cme-cms-footer__legal a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}
.cme-cms-footer .cme-cms-footer__legal a:hover { color: #f5c518; }

/* P3. Cascade repair (measured 2026-08-23): rendered stack showed vendor/theme rules
      winning over lines 94/98 — input bg #fff, label picking up --cme-text ≈ 1.03:1.
      Re-assert the intended pairing at body-prefixed specificity, last in file.
      Restores the P1 math for real: --cme-text-dim on --cme-surface-2 = 7.19:1. */
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-combobox .components-combobox-control__input,
body.woocommerce-checkout .wp-block-woocommerce-checkout input[type="text"],
body.woocommerce-checkout .wp-block-woocommerce-checkout input[type="email"],
body.woocommerce-checkout .wp-block-woocommerce-checkout input[type="tel"],
body.woocommerce-checkout .wp-block-woocommerce-checkout input[type="number"],
body.woocommerce-checkout .wp-block-woocommerce-checkout select,
body.woocommerce-checkout .wp-block-woocommerce-checkout textarea,
body.woocommerce-cart .wc-block-components-text-input input {
  background: var(--cme-surface-2);
  color: var(--cme-text);
}
body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-combobox label,
body.woocommerce-cart .wc-block-components-text-input label {
  color: var(--cme-text-dim);
}
