/* Portal-aligned shell for secure checkout */

@font-face {
  font-family: Matter;
  src: url("https://lerws.com/assets/fonts/matter/matter-light.woff2") format("woff2"),
       url("https://lerws.com/assets/fonts/matter/matter-light.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Matter;
  src: url("https://lerws.com/assets/fonts/matter/matter-regular.woff2") format("woff2"),
       url("https://lerws.com/assets/fonts/matter/matter-regular.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

.lerws-portal[data-theme="dark"]{
  /* Match Orders page palette */
  --ck-bg: #0b0c0f;
  --ck-surface: #111217;
  --ck-panel: #1b202b;
  --ck-border: #1c1e27;
  --ck-border-strong: #252837;
  --ck-text: #f4f5f7;
  --ck-muted: #c7cbd4;
  --ck-muted-2: #9aa1ae;
  --ck-brand: #2f6df6;
  --ck-brand-strong: #2453c3;
  --ck-success: #22c55e;
  --ck-danger: #ef4444;
}

.lerws-portal[data-theme="light"]{
  --ck-bg: #f8fafc;
  --ck-surface: #ffffff;
  --ck-panel: #f1f5f9;
  --ck-border: #e2e8f0;
  --ck-border-strong: #cbd5e1;
  --ck-text: #0f172a;
  --ck-muted: #475569;
  --ck-muted-2: #64748b;
  --ck-brand: #2f6df6;
  --ck-brand-strong: #1f4fb6;
  --ck-success: #16a34a;
  --ck-danger: #dc2626;
}

/* Base portal shell fallback (applies even if portal-navigation.css is not loaded) */
.lerws-portal{
  min-height: 100vh;
  color: var(--ck-text,#f4f5f7);
  font-family: Matter, sans-serif !important;
}

.lerws-portal,
.lerws-portal button,
.lerws-portal input,
.lerws-portal select,
.lerws-portal textarea{
  font-family: Matter, sans-serif !important;
}

.lerws-portal *,
.lerws-portal *::before,
.lerws-portal *::after{
  font-family: inherit !important;
}

.lerws-portal code,
.lerws-portal kbd,
.lerws-portal pre,
.lerws-portal samp{
  font-family: monospace, monospace !important;
}

.lerws-portal .lerws-main{
  width: 100%;
}

.lerws-portal-guest .lerws-topbar-guest{
  position: sticky;
  top: 0;
  z-index: 120;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px;
  background: var(--ck-bg,#0b0c0f);
  border-bottom: 1px solid var(--ck-border,#1c1e27);
}

.lerws-portal-guest .lerws-topbar-left,
.lerws-portal-guest .lerws-topbar-right,
.lerws-portal-guest .lerws-topbar-nav{
  display: flex;
  align-items: center;
}

.lerws-portal-guest .lerws-topbar-nav{
  gap: 6px;
}

.lerws-portal-guest .lerws-topbar-right{
  gap: 8px;
}

.lerws-portal-guest .lerws-logo{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.lerws-portal-guest .lerws-logo-img{
  max-height: 32px;
  width: auto;
}

.lerws-portal-guest .lerws-topbar-nav-item{
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--ck-muted,#c7cbd4);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
}

.lerws-portal-guest .lerws-topbar-nav-item:hover{
  color: var(--ck-text,#f4f5f7);
  background: color-mix(in srgb, var(--ck-surface,#111217) 88%, transparent);
}

.lerws-portal-guest .lerws-topbar-nav-item.active{
  color: var(--ck-text,#f4f5f7);
  border-color: var(--ck-border,#1c1e27);
  background: color-mix(in srgb, var(--ck-brand,#2f6df6) 14%, var(--ck-surface,#111217));
}

.lerws-portal-guest .lerws-topbar-nav-item.lerws-theme-toggle{
  border-color: var(--ck-border,#1c1e27);
  color: var(--ck-text,#f4f5f7);
  background: color-mix(in srgb, var(--ck-brand,#2f6df6) 10%, transparent);
}

.lerws-portal-guest .lerws-topbar-nav-item.lerws-theme-toggle:hover{
  border-color: var(--ck-brand,#2f6df6);
  background: color-mix(in srgb, var(--ck-brand,#2f6df6) 20%, transparent);
}

@media (max-width: 900px){
  .lerws-portal-guest .lerws-topbar-nav{
    display: none;
  }
}

@media (max-width: 640px){
  .lerws-portal-guest .lerws-topbar-guest{
    padding: 0 12px;
    gap: 10px;
  }
  .lerws-portal-guest .lerws-topbar-nav-item{
    padding: 7px 10px;
    font-size: 13px;
  }
}


/* Logged-in portal uses fixed topbar; keep enough top offset so checkout is not clipped */
.lerws-portal:not(.lerws-portal-guest) .lerws-checkout-main{
  padding-top: calc(var(--header-height, 64px) + 20px) !important;
}

#ler-checkout-root{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  background: transparent !important;
}

/* Remove duplicated in-app header/footer since portal nav is visible */
#ler-checkout-root header,
#ler-checkout-root nav,
#ler-checkout-root .app-header,
#ler-checkout-root .l-header,
#ler-checkout-root .checkout-header,
#ler-checkout-root footer{
  display: none !important;
}

/* Tighten top spacing once the internal header is hidden */
#ler-checkout-root main{
  padding-top: 0 !important;
}

/* Keep cards floating cleanly on dark background */
#ler-checkout-root .card,
#ler-checkout-root [role=main] > div,
#ler-checkout-root [role=main] section{
  box-shadow: 0 8px 24px rgba(0,0,0,0.32);
}

/* Kill inline gradients/backgrounds coming from the React app */
#ler-checkout-root [style*="linear-gradient"],
#ler-checkout-root > div,
#ler-checkout-root > div > div{
  background: var(--ck-bg,#0b0c0f) !important;
}

#ler-checkout-root .order-summary,
#ler-checkout-root .order-summary *{
  background: transparent !important;
}

/* Hard-hide Astra/Theme wrappers that still render markup (they lose CSS when dequeued) */
body.lerws-secure-checkout-page #masthead,
body.lerws-secure-checkout-page .site-header,
body.lerws-secure-checkout-page .main-header-bar,
body.lerws-secure-checkout-page .ast-mobile-header-wrap,
body.lerws-secure-checkout-page .ast-desktop-header,
body.lerws-secure-checkout-page .ast-desktop-header-content,
body.lerws-secure-checkout-page .ast-mobile-menu-buttons,
body.lerws-secure-checkout-page .main-header-menu,
body.lerws-secure-checkout-page .main-header-menu-toggle,
body.lerws-secure-checkout-page .ast-main-header-bar-alignment,
body.lerws-secure-checkout-page .site-footer,
body.lerws-secure-checkout-page #colophon,
body.lerws-secure-checkout-page .ast-breadcrumbs,
body.lerws-secure-checkout-page .entry-header{
  display:none !important;
}

/* Prevent theme padding/margins from leaving empty gaps */
body.lerws-secure-checkout-page #content,
body.lerws-secure-checkout-page #primary{
  margin:0 !important;
  padding:0 !important;
}
body.lerws-secure-checkout-page{
  margin:0 !important;
  padding:0 !important;
  background: var(--ck-bg,#0b0c0f) !important;
}

/* ==== Brand the checkout UI to match portal ==== */
#ler-checkout-root,
#ler-checkout-root > div{
  background: transparent !important;
}

#ler-checkout-root [role=main],
#ler-checkout-root .card,
#ler-checkout-root section,
#ler-checkout-root article{
  background: var(--ck-surface,#12131b) !important;
  color: var(--ck-text,#f8fafc) !important;
  border: 1px solid var(--ck-border,#1f2230) !important;
  border-radius: 14px !important;
}

#ler-checkout-root h1,
#ler-checkout-root h2,
#ler-checkout-root h3,
#ler-checkout-root h4,
#ler-checkout-root h5,
#ler-checkout-root h6,
#ler-checkout-root strong{
  color: var(--ck-text,#f8fafc) !important;
}

#ler-checkout-root p,
#ler-checkout-root span,
#ler-checkout-root label,
#ler-checkout-root small{
  color: var(--ck-muted,#cbd5e1) !important;
}

#ler-checkout-root .order-summary,
#ler-checkout-root .order-summary *{
  background: transparent !important;
}


#ler-checkout-root input::placeholder,
#ler-checkout-root select::placeholder,
#ler-checkout-root textarea::placeholder{
  color: var(--ck-muted-2,#9aa1ae) !important;
  opacity: 1 !important;
}

#ler-checkout-root .alert,
#ler-checkout-root .notice{
  background: color-mix(in srgb, var(--ck-brand,#2f6df6) 10%, transparent) !important;
  border-color: var(--ck-border,#1f2230) !important;
  color: var(--ck-text,#f8fafc) !important;
}

#ler-checkout-root .btn,
#ler-checkout-root button,
#ler-checkout-root button:not([type]),
#ler-checkout-root button[type=button],
#ler-checkout-root button[type=submit],
#ler-checkout-root button.submit,
#ler-checkout-root .stripe-button-el{
  background: var(--ck-brand,#2f6df6) !important;
  color: #fff !important;
  border: 1px solid var(--ck-brand-strong,#2658c8) !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
}

#ler-checkout-root .btn:hover,
#ler-checkout-root button:hover,
#ler-checkout-root button:not([type]):hover,
#ler-checkout-root button[type=button]:hover,
#ler-checkout-root button[type=submit]:hover{
  background: var(--ck-brand-strong,#2658c8) !important;
}


#ler-checkout-root .badge.success,
#ler-checkout-root .status.success{
  background: color-mix(in srgb, var(--ck-success,#22c55e) 15%, transparent) !important;
  color: var(--ck-success,#22c55e) !important;
  border-color: color-mix(in srgb, var(--ck-success,#22c55e) 40%, transparent) !important;
}

#ler-checkout-root .badge.error,
#ler-checkout-root .status.error{
  background: color-mix(in srgb, var(--ck-danger,#ef4444) 15%, transparent) !important;
  color: var(--ck-danger,#ef4444) !important;
}

/* Payment card frame (Stripe) */
#ler-checkout-root .CardField,
#ler-checkout-root .StripeElement{
  background: var(--ck-surface,#111217) !important;
  border: 1px solid var(--ck-border-strong,#252837) !important;
  border-radius: 12px !important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.02),
    0 8px 18px rgba(0,0,0,0.32) !important;
  color-scheme: dark;
}

#ler-checkout-root .CardField iframe,
#ler-checkout-root .StripeElement iframe{
  background: transparent !important;
  filter: none !important;
  color-scheme: dark;
}

/* Final overrides to blend shell with portal background */
#ler-checkout-root [style*="min-height"][style*="100vh"]{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#ler-checkout-root .card,
#ler-checkout-root [role=main] > div,
#ler-checkout-root [role=main] section{
  background: var(--ck-surface,#111217) !important;
  border: 1px solid var(--ck-border,#1c1e27) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.32) !important;
}

#ler-checkout-root .StripeElement,
#ler-checkout-root .CardField,
#ler-checkout-root .StripeElement *{
  color: var(--ck-text,#f4f5f7) !important;
}

/* Kill any inline gradient shell so the portal background shows through */
#ler-checkout-root [style*="linear-gradient"],
#ler-checkout-root > div[style*="background"],
#ler-checkout-root > div > div[style*="background"]{
  background: transparent !important;
  box-shadow: none !important;
}

/* Keep the main layout wrapper transparent; let individual cards carry the surface */
#ler-checkout-root [role=main]{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Refine Stripe payment block to match portal cards */
#ler-checkout-root .StripeElement,
#ler-checkout-root .CardField{
  background: var(--ck-surface,#111217) !important;
  border: 1px solid var(--ck-border-strong,#252837) !important;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.28) !important,
    0 6px 14px rgba(0,0,0,0.24) !important;
  color-scheme: dark;
}

/* Try to nudge Stripe tabs (when not sandboxed) toward our palette */
#ler-checkout-root .StripeElement [role="tab"],
#ler-checkout-root .CardField [role="tab"]{
  background: var(--ck-panel,#1b202b) !important;
  border: 1px solid var(--ck-border-strong,#252837) !important;
  color: var(--ck-text,#f4f5f7) !important;
  border-radius: 10px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
#ler-checkout-root .StripeElement [role="tab"][aria-selected="true"],
#ler-checkout-root .CardField [role="tab"][aria-selected="true"]{
  background: color-mix(in srgb, var(--ck-brand,#2f6df6) 18%, var(--ck-panel,#1b202b)) !important;
  border-color: var(--ck-brand,#2f6df6) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ck-brand,#2f6df6) 40%, transparent);
}
#ler-checkout-root .StripeElement [role="tab"] svg,
#ler-checkout-root .CardField [role="tab"] svg{
  color: var(--ck-text,#f4f5f7) !important;
}

/* Slightly lighten placeholders and labels that Stripe inherits */
#ler-checkout-root .StripeElement ::placeholder{
  color: var(--ck-muted-2,#9aa1ae) !important;
  opacity: 1 !important;
}

/* Keep payment CTA clearly visible over dark backgrounds */

/* Keep button label/icon contrast strong across dark and light themes. */
#ler-checkout-root button span,
#ler-checkout-root button svg,
#ler-checkout-root button i,
#ler-checkout-root .btn span,
#ler-checkout-root .btn svg,
#ler-checkout-root .btn i{
  color: #ffffff !important;
  stroke: currentColor !important;
}

/* Keep line icons lightweight on CTA buttons (avoid solid/filled lock look). */
#ler-checkout-root button svg,
#ler-checkout-root .btn svg{
  fill: none !important;
  stroke-width: 1.7 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Light mode: keep call-to-action contrast and avoid washed-out controls. */

/* Ensure portal profile avatar stays circular on checkout routes. */
.lerws-portal .lerws-profile-trigger{
  border-radius: 9999px !important;
  overflow: hidden !important;
}

.lerws-portal .lerws-profile-avatar,
.lerws-portal .lerws-profile-menu-avatar{
  border-radius: 9999px !important;
  object-fit: cover !important;
}

/* ---------- Light mode readability + status visibility fixes ---------- */
.lerws-portal[data-theme="light"] #ler-checkout-root [style*="color: rgb(248, 250, 252)"]{
  color: #0f172a !important;
}

.lerws-portal[data-theme="light"] #ler-checkout-root [style*="color: rgb(148, 163, 184)"],
.lerws-portal[data-theme="light"] #ler-checkout-root [style*="color: rgb(100, 116, 139)"]{
  color: #475569 !important;
}

.lerws-portal[data-theme="light"] #ler-checkout-root [style*="background: rgb(30, 41, 59)"]{
  background: #ffffff !important;
  border-color: #d9e1ec !important;
  box-shadow: 0 8px 22px rgba(2, 12, 27, 0.10) !important;
}

.lerws-portal[data-theme="light"] #ler-checkout-root [style*="background: rgb(15, 23, 42)"]{
  background: #f8fafc !important;
  border-color: #cfd8e6 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6) !important;
}

.lerws-portal[data-theme="light"] #ler-checkout-root [style*="border: 1px solid rgb(51, 65, 85)"]{
  border-color: #d2dbe8 !important;
}

.lerws-portal[data-theme="light"] #ler-checkout-root [style*="border-bottom: 1px solid rgb(71, 85, 105)"],
.lerws-portal[data-theme="light"] #ler-checkout-root [style*="border-top: 1px solid rgb(51, 65, 85)"]{
  border-color: #dbe3ef !important;
}

/* Preserve the verified badge icon color; broad inline overrides can wash it out. */
.lerws-portal[data-theme="light"] #ler-checkout-root [style*="background: rgb(16, 185, 129)"],
.lerws-portal[data-theme="light"] #ler-checkout-root [style*="background: rgb(34, 197, 94)"]{
  background: #10b981 !important;
  border-color: #10b981 !important;
  box-shadow: none !important;
}

.lerws-portal[data-theme="light"] #ler-checkout-root [style*="background: rgb(16, 185, 129)"] svg,
.lerws-portal[data-theme="light"] #ler-checkout-root [style*="background: rgb(34, 197, 94)"] svg{
  stroke: #ffffff !important;
}

/* Ensure legal/footer copy stays readable in light mode. */



/* Checkout redesign refinements */
.lerws-checkout-main{
  padding: 18px 12px 40px;
}

#ler-checkout-root{
  max-width: 1160px;
}

#ler-checkout-root [style*="grid-template-columns:320px minmax(0,1fr)"],
#ler-checkout-root [style*="grid-template-columns: 320px minmax(0,1fr)"]{
  align-items: start !important;
}

#ler-checkout-root input{
  min-height: 46px;
}

#ler-checkout-root .StripeElement{
  border-radius: 16px !important;
}

#ler-checkout-root button[type=button],
#ler-checkout-root button[type=submit],
#ler-checkout-root button,
#ler-checkout-root .btn{
  min-height: 52px;
}

@media (max-width: 768px){
  .lerws-checkout-main{
    padding: 10px 10px 24px;
  }

  #ler-checkout-root{
    max-width: 100%;
  }
}
