/*
 * --------------------------------------------------
 * FILE: assets/css/styles.css
 * LAYER: Public Website
 * ROLE: Shared style system for the public site and portal interfaces.
 * RESPONSIBILITIES:
 * - Provide and organize behavior implemented in this file.
 * - Preserve integration contracts while improving readability.
 * INTERACTS WITH: Shared CSS/JS shell modules and page-specific DOM structures.
 * AUTHOR: AI Generated (Codex)
 * LAST UPDATED: 2026-03-06
 * LAST UPDATE REASON: Improve portal controls, terms modal, dark-mode select visibility,
 * and index video fallback UX.
 * --------------------------------------------------
 */
/* --------------------------------------------------
   THEME TOKENS
   Shared color, spacing, radius, and motion variables.
-------------------------------------------------- */
:root {
  color-scheme: dark;
  --bg: #070a14;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --accent: #c8a464;
  --accent-2: rgba(200, 164, 100, 0.16);
  --link: rgba(255, 255, 255, 0.92);
  --focus: rgba(200, 164, 100, 0.7);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --transition-fast: 180ms ease;
  --transition-medium: 240ms ease;
  --max-width: 1120px;
  --success-bg: rgba(80, 190, 120, 0.12);
  --success-bg-soft: rgba(80, 190, 120, 0.08);
  --success-border: rgba(80, 190, 120, 0.45);
  --success-border-soft: rgba(80, 190, 120, 0.4);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f0ea;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(255, 255, 255, 0.9);
  --text: rgba(10, 16, 30, 0.96);
  --muted: rgba(10, 16, 30, 0.78);
  --border: rgba(10, 16, 30, 0.18);
  --shadow: 0 12px 30px rgba(10, 16, 30, 0.12);
  --accent: #b08947;
  --accent-2: rgba(176, 137, 71, 0.16);
  --link: rgba(10, 16, 30, 0.96);
  --focus: rgba(176, 137, 71, 0.65);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --------------------------------------------------
   BASE STYLES
   Document-wide baseline styles for typography and shell behavior.
-------------------------------------------------- */
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: transparent;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

body.page {
  opacity: 0;
  transition: opacity var(--transition-medium);
}

body.page.is-loaded {
  opacity: 1;
}

body.lightbox-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Baseline heading/paragraph rhythm; more specific per-component rules
   below (e.g. .hero h1, .section-title) still take precedence. */
h1, h2, h3, h4 {
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

p {
  margin: 0 0 1rem;
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin: 0 auto;
}

.section {
  padding: 4.5rem 0;
}

.section-title {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem);
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--accent);
}

/* --------------------------------------------------
   SITE NAVIGATION
   Header, nav panel, and responsive menu behavior.
-------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 10, 20, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand img {
  width: 40px;
  height: 40px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--muted);
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text);
}

html[data-theme="light"] .nav-links a {
  color: rgba(10, 16, 30, 0.72);
}

html[data-theme="light"] .nav-links a:hover {
  color: rgba(10, 16, 30, 0.96);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* --------------------------------------------------
   LANDING/HERO BLOCKS
   Hero layout, card framing, and call-to-action visual hierarchy.
-------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  align-items: center;
  padding: 4.5rem 0 3.5rem;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(2.2rem, 1.8rem + 2vw, 3.2rem);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.hero p {
  margin: 0 0 2rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.4rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.button.primary {
  background: var(--accent);
  color: #070a14;
}

.button.primary:hover {
  transform: translateY(-2px);
}

.button.ghost {
  border-color: var(--border);
  color: var(--text);
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.button.danger {
  background: rgba(194, 77, 77, 0.92);
  border-color: rgba(194, 77, 77, 0.96);
  color: #fff;
}

.button.danger:hover {
  background: rgba(175, 61, 61, 0.98);
  border-color: rgba(175, 61, 61, 1);
  color: #fff;
  transform: translateY(-2px);
}

html[data-theme="light"] .button.ghost {
  border-color: rgba(10, 16, 30, 0.28);
  color: rgba(10, 16, 30, 0.92);
}

html[data-theme="light"] .button.ghost:hover {
  border-color: var(--accent);
  color: rgba(10, 16, 30, 0.96);
}

.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------
   IMAGE SLIDERS & CAROUSEL CONTROLS
   Hero slider, slide crossfade states, prev/next buttons, and pagination dots.
-------------------------------------------------- */
.slide {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 220px;
}

.hero-slider {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-slider .slides {
  position: relative;
}

.hero-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 220ms ease;
  display: block;
}

.hero-slider .slide.is-active {
  opacity: 1;
  position: relative;
}

.hero-slider img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

html[data-theme="light"] .slider-btn {
  background: rgba(10, 16, 30, 0.12);
  color: var(--text);
}

.slider-btn.prev {
  left: 12px;
}

.slider-btn.next {
  right: 12px;
}

.dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 6px 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
}

html[data-theme="light"] .dot:not(.is-active) {
  background: rgba(10, 16, 30, 0.22);
}

/* --------------------------------------------------
   SHARED UI UTILITIES
   Icon buttons, screen-reader-only text, and the full-page transition overlay.
-------------------------------------------------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 9999;
}

html.is-transitioning .page-transition {
  opacity: 1;
}

html.page-enter .page-transition {
  opacity: 1;
}

html.page-enter.page-enter-active .page-transition {
  opacity: 0;
}

/* --------------------------------------------------
   CARDS, TESTIMONIALS & CLIENT LOGOS
   Generic card surface, testimonial quotes, and the client-logo grid.
-------------------------------------------------- */
.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--muted);
}

.card .button {
  margin-top: auto;
  align-self: flex-start;
}

.form-actions .button,
.download-actions .button {
  margin-top: 0;
  align-self: center;
}

.split {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: center;
}

.testimonial {
  font-style: italic;
  color: var(--muted);
}

.clients-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.client-tile {
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-tile img {
  width: auto;
  max-width: 100%;
  height: 56px;
  object-fit: contain;
}

/* --------------------------------------------------
   VIDEO OVERVIEW CARD
   Framed video embed with hover elevation and fallback handling.
-------------------------------------------------- */
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0; /* Cleanup: Remove padding that was for placeholder text */
  position: relative;
  box-shadow: var(--shadow);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
  overflow: hidden; /* Ensure video corners are clipped by the card's radius */
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] .video-card:hover {
  box-shadow: 0 16px 40px rgba(10, 16, 30, 0.15);
}

.video-embed {
  width: 100%;
  display: block; /* Prevent extra space below video */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 0; /* Border is now handled by the parent .video-card */
}

/* --------------------------------------------------
   CTA STRIP & PAGE HERO VARIANTS
   Secondary call-to-action band and the smaller page-level hero used on inner pages.
-------------------------------------------------- */
.cta-strip {
  background: linear-gradient(120deg, var(--accent-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.cta-strip p {
  margin: 0;
  color: var(--muted);
}

.page-hero {
  padding: 3.5rem 0 2rem;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

/* --------------------------------------------------
   FORMS & INPUTS
   Shared form-grid layout, field labels, and input/select/textarea styling.
-------------------------------------------------- */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.notice {
  font-size: 0.9rem;
  color: var(--muted);
}

.payment-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background: var(--surface);
}

/* --------------------------------------------------
   GALLERY GRID & LIGHTBOX
   Gallery tile grid plus the full-screen image lightbox overlay.
-------------------------------------------------- */
.gallery-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.gallery-tile {
  position: relative;
  min-height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.88);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  /* Use a very high z-index to ensure it's on top of everything. */
  z-index: 2147483647;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  /* Set a consistent size relative to the viewport, with sensible maximums. */
  width: 92vw;
  height: 92vh;
  max-width: 1200px;
  max-height: 800px;

  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  /* Use flexbox to structure the content vertically. */
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow: hidden; /* Prevent content from overflowing the container */
}

.lightbox-img {
  /* Allow the image to take up all available space, shrinking/growing as needed. */
  flex: 1 1 auto;
  /* A critical fix to prevent flex items from overflowing their container. */
  min-height: 0;
  display: block;
  width: 100%;
  /* REMOVED: height: 100% was causing the container to overflow. */
  object-fit: contain;
}

[data-lightbox-title] {
  margin: 1rem 0 0.25rem;
  font-size: 1.2rem;
  flex-shrink: 0; /* Prevent shrinking */
}

[data-lightbox-desc] {
  margin: 0 0 1rem;
  color: var(--muted);
  max-height: 25%; /* Limit description height */
  overflow-y: auto; /* and allow scrolling if needed */
  flex-shrink: 0; /* Prevent shrinking */
}

.lightbox-close {
  /* Ensure the close button doesn't shrink and is at the bottom right. */
  flex-shrink: 0;
  margin-top: auto; /* Push button to the bottom of the card */
  align-self: flex-end;
}

/* --------------------------------------------------
   SITE FOOTER
   Footer grid, social links, brand mark, and copyright line.
-------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  background: rgba(7, 10, 20, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

html[data-theme="light"] .site-header,
html[data-theme="light"] .site-footer {
  background: rgba(242, 240, 234, 0.78);
  border-color: rgba(10, 16, 30, 0.14);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: center;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
}

.footer-links a {
  color: inherit;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.social-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.social-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.social-link.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand img {
  width: 32px;
  height: 32px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-col {
  display: grid;
  gap: 0.65rem;
}

.footer-title {
  font-size: 0.95rem;
  margin: 0;
  color: var(--text);
}

/* --------------------------------------------------
   POLICY / KV DETAIL UTILITIES
   Soft card variant, muted text, key-value rows, and fineprint helpers.
-------------------------------------------------- */
.card--soft {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

.kv {
  margin: 1rem 0;
}

.kv-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0.75rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.kv-row dt {
  font-weight: 600;
  opacity: 0.9;
}

.kv-row dd {
  margin: 0;
  opacity: 0.95;
  word-break: break-word;
}

.actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.fineprint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  opacity: 0.75;
}

/* --------------------------------------------------
   POLICIES & DOWNLOADS
   Policy list styling and the downloads-card action row.
-------------------------------------------------- */
.policy-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.policy-list li {
  margin: 0.4rem 0;
}

.download-card {
  display: grid;
  gap: 1rem;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.effective-date {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* --------------------------------------------------
   LOCATION / MAP EMBED
   Map container framing for the contact page's Google Maps embed.
-------------------------------------------------- */
.map-wrap {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-embed {
  width: 100%;
  height: 360px;
  display: block;
  border: 0;
}

.location-details p {
  margin: 0 0 1rem;
}

/* --------------------------------------------------
   RESPONSIVE / MOTION MEDIA QUERIES
   Small-viewport map height, key-value row layout, mobile nav panel,
   and reduced-motion overrides.
-------------------------------------------------- */
@media (max-width: 520px) {
  .map-embed {
    height: 300px;
  }

  .kv-row {
    grid-template-columns: 120px 1fr;
  }
}

@media (max-width: 900px) {
  .nav-panel {
    position: fixed;
    inset: 72px 0 auto 0;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    transform: translateY(-120%);
    transition: transform var(--transition-medium);
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  .nav-panel.open {
    transform: translateY(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-transition {
    transition: none;
  }

  .icon-btn {
    transition: none;
  }

  .hero-slider .slide {
    transition: none;
  }

  .bg-layer::after,
  html[data-theme="light"] .bg-layer::after {
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
  }

  * {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------
   GLOBAL FIXED BACKGROUND LAYER
   Full-viewport background artwork, tint overlay, and light/dark image swap.
-------------------------------------------------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0; /* background must be visible */
  pointer-events: none;
  background-image: url("../img/brand/site-bg-dark.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: translateZ(0);
}

.bg-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 20, 0.72);
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}

.page-shell {
  position: relative;
  z-index: 1; /* content sits above background */
  min-height: 100vh;
  background: transparent !important;
}

html, body {
  background: transparent !important;
}

html[data-theme="light"] .bg-layer::before {
  background: linear-gradient(120deg, rgba(200, 164, 100, 0.16), rgba(243, 240, 234, 0.78));
}

html[data-theme="light"] .bg-layer {
  background-image: url("../img/brand/site-bg-light.png");
}

html[data-theme="light"] .bg-layer::after {
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}

/* --------------------------------------------------
   INTAKE STEPPER & RESULT PANEL
   Step-indicator chips, spacing utility, and the screening-result summary panel.
-------------------------------------------------- */
.stack-lg > * + * {
  margin-top: 1.5rem;
}

.intake-card {
  gap: 1rem;
}

.intake-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.intake-step {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

.intake-step.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-2);
}

.intake-step.is-complete {
  color: var(--text);
  background: var(--surface-2);
}

.intake-result {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--surface);
}

.intake-result[hidden] {
  display: none !important;
}

.intake-list {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

/* --------------------------------------------------
   CLIENT PORTAL STATUS UI
   Progress bar, status chips, process banners, and lock indicators.
-------------------------------------------------- */
.portal-grid {
  display: grid;
  gap: 1rem;
}

.portal-lock {
  position: relative;
}

.portal-lock[hidden] {
  display: none !important;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

/* --------------------------------------------------
   CLIENT PORTAL EVENT TIMELINE
   Timeline event cards, detail drawers, and timestamp presentation.
-------------------------------------------------- */
.timeline-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--surface);
  color: var(--muted);
}

.portal-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  margin: 0 0.4rem 0.4rem 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
}

.upload-help {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.portal-progress {
  margin: 0 0 0.9rem;
}

.portal-progress__rail {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

.portal-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), rgba(200, 164, 100, 0.55));
  transition: width var(--transition-medium);
}

.portal-steps {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.5rem 0.65rem;
  color: var(--muted);
}

.portal-step--complete {
  border-color: rgba(120, 220, 160, 0.45);
  color: var(--text);
}

/* --------------------------------------------------
   PORTAL/CONTACT SELECT THEME SAFETY
   Improves dark-mode select/option contrast on Chromium browsers.
-------------------------------------------------- */
[data-intake-page="client"] select,
[data-intake-page="contact"] select,
.card select {
  color-scheme: dark;
  background: rgba(14, 20, 34, 0.92);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-intake-page="client"] option,
[data-intake-page="contact"] option,
.card option {
  background: #101726;
  color: #f7f3ea;
}

html[data-theme="light"] [data-intake-page="client"] select,
html[data-theme="light"] [data-intake-page="contact"] select,
html[data-theme="light"] .card select {
  color-scheme: light;
  background: rgba(255, 255, 255, 0.96);
  color: rgba(10, 16, 30, 0.94);
  border-color: rgba(10, 16, 30, 0.2);
}

html[data-theme="light"] [data-intake-page="client"] option,
html[data-theme="light"] [data-intake-page="contact"] option,
html[data-theme="light"] .card option {
  background: #ffffff;
  color: rgba(10, 16, 30, 0.94);
}

.portal-step--current {
  border-color: var(--accent);
  background: var(--accent-2);
  color: var(--text);
}

.portal-step--locked {
  opacity: 0.72;
}

.portal-step__node {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex: 0 0 24px;
  background: var(--surface-2);
  color: var(--text);
}

.portal-step__label {
  font-size: 0.84rem;
  line-height: 1.35;
}

.portal-process-banner {
  margin: 0.8rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.65rem 0.8rem;
}

.portal-process-banner p {
  margin: 0;
}

.portal-process-banner--info {
  background: var(--surface);
}

.portal-process-banner--warning {
  background: rgba(255, 156, 66, 0.12);
  border-color: rgba(255, 156, 66, 0.45);
}

.portal-process-banner--success {
  background: var(--success-bg);
  border-color: var(--success-border);
}

#portalStatusChips {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.portal-utils {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.15rem 0 0.45rem;
}

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 4050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(7, 11, 20, 0.72);
}

.portal-modal.is-visible {
  display: flex;
}

.portal-modal__card {
  width: min(94vw, 560px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.portal-consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.portal-consent-check input[type="checkbox"] {
  margin-top: 0.2rem;
}

.portal-lock-indicator {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  margin: 0 0 0.8rem;
}

.portal-lock-indicator--locked {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .portal-lock-indicator--locked {
  background: rgba(10, 16, 30, 0.04);
}

.portal-lock-indicator--unlocked {
  background: var(--success-bg-soft);
  border-color: var(--success-border-soft);
}

.timeline-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.timeline-item__icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
}

.timeline-item__time {
  font-size: 0.82rem;
  color: var(--muted);
}

.timeline-item__message {
  margin: 0.6rem 0 0;
  color: var(--text);
}

.timeline-item__details {
  margin-top: 0.55rem;
}

.timeline-item__details summary {
  cursor: pointer;
  color: var(--muted);
}

.timeline-item__details pre {
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: auto;
  color: var(--text);
}

/* --------------------------------------------------
   CLIENT PORTAL LOADING OVERLAY
   Blocking overlay, spinner card, and long-running-operation hint state.
-------------------------------------------------- */
.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, 0.58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.portal-overlay.is-visible {
  display: flex;
}

.portal-overlay__card {
  width: min(92vw, 380px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
  text-align: center;
}

.portal-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 0.6rem;
  border-radius: var(--radius-pill);
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: portal-spin 0.9s linear infinite;
}

.portal-overlay__hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes portal-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.portal-toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 4100;
  display: grid;
  gap: 0.5rem;
  width: min(90vw, 360px);
}

.portal-toast {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  box-shadow: var(--shadow);
}

.portal-toast--success {
  border-color: var(--success-border);
}

.portal-toast--info {
  border-color: rgba(118, 160, 255, 0.45);
}

.portal-toast--error {
  border-color: rgba(255, 116, 116, 0.55);
}

.button.is-busy {
  position: relative;
  opacity: 0.85;
  cursor: wait;
}

.button.is-busy::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: var(--radius-pill);
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: portal-spin 0.8s linear infinite;
}

.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.portal-file-meta {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.portal-file-meta--warn {
  color: #ffb36f;
}

html[data-theme="light"] .portal-file-meta--warn {
  color: #a15a1f;
}

.notice--error {
  color: #ff9f9f;
}

html[data-theme="light"] .notice--error {
  color: #b03535;
}

/* --------------------------------------------------
   BOOKING AVAILABILITY PICKER
   Date tile selection grid for preferred booking dates.
-------------------------------------------------- */
.availability-picker {
  margin-top: 0.55rem;
}

.availability-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.45rem;
}

.availability-picker__day {
  width: 100%;
  min-height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 0.5rem;
  text-align: left;
  display: grid;
  gap: 0.25rem;
  transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.availability-picker__day:hover:not([disabled]) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.availability-picker__day--selected {
  border-color: var(--accent);
  background: var(--accent-2);
}

.availability-picker__day--partial {
  border-color: rgba(255, 184, 77, 0.5);
}

.availability-picker__day--disabled {
  opacity: 0.48;
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .availability-picker__day--disabled {
  background: rgba(10, 16, 30, 0.04);
}

.availability-picker__day-number {
  font-size: 0.88rem;
  font-weight: 700;
}

.availability-picker__day-meta {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--muted);
}

.availability-picker__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .portal-steps {
    grid-template-columns: 1fr;
  }

  .portal-utils {
    flex-direction: column;
  }

  .timeline-item__row {
    justify-content: flex-start;
  }

  .timeline-item__time {
    display: block;
  }

  .availability-picker__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------
   PORTAL DISABLED STATE
   Blur/dim treatment applied to portal sections while the client portal
   feature flag is off (see assets/js/main.js INTAKE_PORTAL_ENABLED).
-------------------------------------------------- */
.intake-disabled {
  opacity: 0.55;
  filter: blur(1px);
  pointer-events: none;
}
