/**
 * CrewDocFlow public area: light / dark theme (html[data-theme="dark"]).
 * Default theme is set in base.html before paint; preference: localStorage key crewdocflow-theme.
 */

html[data-theme="dark"] {
  color-scheme: dark;
}

/* ----- Public tokens (override public.css) ----- */
html[data-theme="dark"] body.area-public {
  --pub-surface: #141c38;
  --pub-surface-soft: #0f1428;
  --pub-border: rgba(130, 150, 255, 0.22);
  --pub-shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
  --pub-shadow-md: 0 14px 34px rgba(0, 0, 0, 0.45);
  --pub-text: #e8ecff;
  --pub-muted: #a8b4d8;
  --pub-primary-start: #7b8cff;
  --pub-primary-end: #9b6fd6;
}

html[data-theme="dark"] body.area-public .page-content {
  background: linear-gradient(180deg, #0c1022 0%, #0f1733 35%, #0f1733 100%) !important;
  color: var(--pub-text);
}

html[data-theme="dark"] body.area-public .card {
  background: var(--pub-surface);
  border-color: var(--pub-border);
}

html[data-theme="dark"] body.area-public .btn-outline-primary {
  color: #b8c4ff !important;
  border-color: rgba(130, 150, 255, 0.45) !important;
  background: rgba(20, 28, 56, 0.65) !important;
}

html[data-theme="dark"] body.area-public .btn-outline-primary:hover,
html[data-theme="dark"] body.area-public .btn-outline-primary:focus {
  background: rgba(102, 126, 234, 0.22) !important;
  color: #e8ecff !important;
}

html[data-theme="dark"] body.area-public .form-control,
html[data-theme="dark"] body.area-public .form-select {
  background: #0f1733;
  border-color: rgba(130, 150, 255, 0.28);
  color: #e8ecff;
}

html[data-theme="dark"] body.area-public .form-control::placeholder {
  color: rgba(168, 180, 216, 0.75);
}

html[data-theme="dark"] body.area-public hr {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

html[data-theme="dark"] body.area-public .bg-light {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #e8ecff;
}

/* base.html inline .page-content */
html[data-theme="dark"] .page-content {
  background-color: #0f1733 !important;
  color: #e8ecff;
}

html[data-theme="dark"] .page-top-tools {
  background: rgba(15, 23, 51, 0.92) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] #notifications-layer .alert {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] #notifications-layer .alert-warning {
  background: rgba(255, 193, 7, 0.12);
  color: #ffe8a3 !important;
}

/* ----- Homepage (.home) landing inline styles ----- */
html[data-theme="dark"] .home .landing-section--alt {
  background: #12182e !important;
}

html[data-theme="dark"] .home .landing-section:not(.landing-section--alt) {
  background: #0f1733 !important;
}

html[data-theme="dark"] .home .landing-section--alt.landing-panel {
  background: linear-gradient(180deg, #141c38 0%, #10182f 100%) !important;
}

html[data-theme="dark"] .home .entry-links-panel {
  background: #141c38 !important;
}

html[data-theme="dark"] .home .entry-links-card {
  background: #1a2344 !important;
  border-color: rgba(130, 150, 255, 0.25) !important;
}

html[data-theme="dark"] .home .entry-links-card h3 {
  color: #e8ecff !important;
}

html[data-theme="dark"] .home .entry-links-card a {
  color: #b8c4ff !important;
}

html[data-theme="dark"] .home .landing-hero {
  background: linear-gradient(160deg, #141c38 0%, #10182f 45%, #0f1733 100%) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .home .landing-hero h1 {
  color: #f0f2ff !important;
}

html[data-theme="dark"] .home .landing-hero .lead {
  color: #c4cce8 !important;
}

html[data-theme="dark"] .home .landing-hero .hero__sub {
  color: #a8b4d8 !important;
}

html[data-theme="dark"] .home .btn-hero-outline {
  background: rgba(102, 126, 234, 0.18) !important;
  color: #c8d2ff !important;
  border-color: rgba(130, 150, 255, 0.4) !important;
}

html[data-theme="dark"] .home .landing-hero .hero-state-list li {
  background: rgba(20, 28, 56, 0.85) !important;
  border-color: rgba(130, 150, 255, 0.22) !important;
  color: #dce2f5 !important;
}

html[data-theme="dark"] .home .landing-hero .hero-trust-pill {
  background: rgba(102, 126, 234, 0.15) !important;
  border-color: rgba(130, 150, 255, 0.3) !important;
  color: #c8d2f0 !important;
}

html[data-theme="dark"] .home .landing-card {
  background: #141c38 !important;
  border-color: rgba(130, 150, 255, 0.2) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .home .landing-card h3 {
  color: #f0f2ff !important;
}

html[data-theme="dark"] .home .landing-card .feature-list {
  color: #a8b4d8 !important;
}

html[data-theme="dark"] .home .landing-section .section-title {
  color: #f0f2ff !important;
}

html[data-theme="dark"] .home .section-lead {
  color: #a8b4d8 !important;
}

html[data-theme="dark"] .home .landing-section .muted {
  color: #8b96bc !important;
}

html[data-theme="dark"] .home .landing-section .feature-list li {
  color: #c4cce8 !important;
}

html[data-theme="dark"] .home .landing-section--module .feature-list--tiles li {
  background: #141c38 !important;
  border-color: rgba(130, 150, 255, 0.22) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25) !important;
  color: #dce2f5 !important;
}

html[data-theme="dark"] .home .landing-section .metric-label {
  color: #a8b4d8 !important;
}

html[data-theme="dark"] .home .landing-section .metric-value {
  color: #e8ecff !important;
}

/* Final CTA strip (index: .landing-cta) — muted for dark theme */
html[data-theme="dark"] .home .landing-cta {
  background: linear-gradient(145deg, #151c34 0%, #1a1730 50%, #120e1c 100%) !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(120, 140, 220, 0.18) !important;
  color: #e8ecff !important;
}

html[data-theme="dark"] .home .landing-cta h2 {
  color: #f4f6ff !important;
}

html[data-theme="dark"] .home .landing-cta p {
  color: rgba(232, 236, 255, 0.88) !important;
}

/* Inline button styles on CTA — override with !important */
html[data-theme="dark"] .home .landing-cta .btn-primary {
  background: linear-gradient(135deg, #4a5690 0%, #5c4888 100%) !important;
  color: #f5f7ff !important;
  border: 1px solid rgba(180, 190, 255, 0.25) !important;
}

html[data-theme="dark"] .home .landing-cta .btn-primary:hover {
  background: linear-gradient(135deg, #5562a0 0%, #6a5498 100%) !important;
  color: #fff !important;
}

html[data-theme="dark"] .home .landing-cta .cta .btn:not(.btn-primary) {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e8ecff !important;
  border: 2px solid rgba(180, 195, 255, 0.35) !important;
}

html[data-theme="dark"] .home .landing-cta .cta .btn:not(.btn-primary):hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(200, 210, 255, 0.45) !important;
}

html[data-theme="dark"] .home .mobile-sticky-cta .btn {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* ----- Additional Services ----- */
html[data-theme="dark"] .as-hero-wrap {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0) 60%) !important;
}

html[data-theme="dark"] .as-badge {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #c8d2ff !important;
}

html[data-theme="dark"] .as-card {
  background: #141c38 !important;
  border-color: rgba(130, 150, 255, 0.22) !important;
}

html[data-theme="dark"] .as-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .as-icon {
  background: rgba(99, 102, 241, 0.22) !important;
  color: #b8c4ff !important;
}

html[data-theme="dark"] .as-muted {
  color: rgba(232, 236, 255, 0.72) !important;
}

html[data-theme="dark"] .as-hero-wrap h1,
html[data-theme="dark"] .as-hero-wrap .display-6 {
  color: #f0f2ff !important;
}

html[data-theme="dark"] body.area-public .as-hero-wrap {
  border-color: rgba(130, 150, 255, 0.25) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35) !important;
}

/* ----- Pricing ----- */
html[data-theme="dark"] .pricing-card {
  background: linear-gradient(165deg, #141c38 0%, #10182f 65%, #0f1733 100%) !important;
  border-color: rgba(130, 150, 255, 0.28) !important;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .pricing-card h1 {
  color: #f0f2ff !important;
}

html[data-theme="dark"] .pricing-card .lead {
  color: #a8b4d8 !important;
}

html[data-theme="dark"] .pricing-features li {
  background: rgba(20, 28, 56, 0.9) !important;
  border-color: rgba(130, 150, 255, 0.22) !important;
  color: #e8ecff !important;
}

html[data-theme="dark"] .pricing-contact-chip {
  background: rgba(20, 28, 56, 0.85) !important;
  border-color: rgba(130, 150, 255, 0.28) !important;
  color: #e8ecff !important;
}

html[data-theme="dark"] .pricing-contact-chip:hover {
  background: #1a2344 !important;
  color: #f0f2ff !important;
  border-color: rgba(130, 150, 255, 0.4) !important;
}

/* ----- Login / Register (public.css) ----- */
html[data-theme="dark"] body.area-public.login-page .login-container,
html[data-theme="dark"] body.area-public.register-page .auth-container {
  background:
    radial-gradient(circle at 15% 10%, rgba(120, 140, 255, 0.15), rgba(0, 0, 0, 0) 42%),
    linear-gradient(145deg, #2a3470 0%, #3d2868 52%, #3d2668 100%) !important;
}

html[data-theme="dark"] body.area-public.login-page .login-card,
html[data-theme="dark"] body.area-public.register-page .auth-card {
  background: #141c38 !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #e8ecff !important;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] body.area-public.login-page .login-card label,
html[data-theme="dark"] body.area-public.register-page .auth-card label,
html[data-theme="dark"] body.area-public.register-page .auth-card .text-muted {
  color: #a8b4d8 !important;
}

html[data-theme="dark"] body.area-public.login-page .logo-container {
  background: linear-gradient(135deg, #5f71ec, #7c4fbb);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] body.area-public.register-page .password-strength,
html[data-theme="dark"] body.area-public.register-page .password-requirements {
  border-color: rgba(130, 150, 255, 0.22) !important;
  background: linear-gradient(180deg, rgba(20, 28, 56, 0.95), rgba(15, 23, 51, 0.95)) !important;
  color: #dce2f5 !important;
}

html[data-theme="dark"] body.area-public.login-page .login-header h1,
html[data-theme="dark"] body.area-public.register-page .auth-header h1 {
  color: #f0f2ff !important;
}

html[data-theme="dark"] body.area-public.login-page .login-header p,
html[data-theme="dark"] body.area-public.register-page .auth-header p {
  color: #a8b4d8 !important;
}

html[data-theme="dark"] body.area-public.login-page .login-card .form-control,
html[data-theme="dark"] body.area-public.register-page .auth-card .form-control {
  background: #0f1733 !important;
  border-color: rgba(130, 150, 255, 0.28) !important;
  color: #e8ecff !important;
}

html[data-theme="dark"] body.area-public.login-page .login-card .form-control:focus,
html[data-theme="dark"] body.area-public.register-page .auth-card .form-control:focus {
  border-color: rgba(130, 150, 255, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

html[data-theme="dark"] body.area-public.login-page .input-icon,
html[data-theme="dark"] body.area-public.register-page .input-icon {
  color: #8b96bc !important;
}

html[data-theme="dark"] body.area-public.login-page .login-footer a,
html[data-theme="dark"] body.area-public.register-page .auth-footer a {
  color: #b8c4ff !important;
}

html[data-theme="dark"] body.area-public.login-page .login-footer p,
html[data-theme="dark"] body.area-public.register-page .auth-footer p {
  color: #a8b4d8 !important;
}

/* ----- Modals on public pages ----- */
html[data-theme="dark"] body.area-public .modal-content {
  background: #141c38;
  border: 1px solid rgba(130, 150, 255, 0.22);
  color: #e8ecff;
}

html[data-theme="dark"] body.area-public .modal-header,
html[data-theme="dark"] body.area-public .modal-footer {
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.area-public .btn-close {
  filter: invert(1) grayscale(1);
  opacity: 0.75;
}

/* Cookie banner categories (inline styles in cookie_banner.html) */
html[data-theme="dark"] .cookie-category {
  background: #141c38 !important;
  border: 1px solid rgba(130, 150, 255, 0.15);
  border-left-width: 3px;
  color: #e8ecff;
}

html[data-theme="dark"] .modal .cookie-category {
  background: #141c38 !important;
}

/* ----- Top navbar + footer: match dark page (base.html / landing.css gradients) ----- */
html[data-theme="dark"] body.area-public .navbar {
  background: linear-gradient(135deg, #141a32 0%, #10182c 45%, #0c1022 100%) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45) !important;
  border-bottom: 1px solid rgba(130, 150, 255, 0.12) !important;
}

html[data-theme="dark"] body.area-public .navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] body.area-public .nav-link.active {
  background: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] body.area-public .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35) !important;
}

html[data-theme="dark"] body.area-public .footer-premium {
  background: linear-gradient(135deg, #141a32 0%, #10182c 50%, #0c1022 100%) !important;
  border-top: 1px solid rgba(130, 150, 255, 0.1);
}

html[data-theme="dark"] body.area-public .footer-bottom {
  background: rgba(0, 0, 0, 0.35) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* Language / user menus from navbar: dark panel */
html[data-theme="dark"] body.area-public .navbar .dropdown-menu {
  background: #161c33 !important;
  border: 1px solid rgba(130, 150, 255, 0.22) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] body.area-public .navbar .dropdown-menu .dropdown-item {
  color: #e8ecff !important;
}

html[data-theme="dark"] body.area-public .navbar .dropdown-menu .dropdown-item:hover {
  color: #fff !important;
  background-color: rgba(102, 126, 234, 0.22) !important;
}

html[data-theme="dark"] body.area-public .lang-dropdown {
  border-color: rgba(130, 150, 255, 0.22) !important;
}

html[data-theme="dark"] body.area-public .lang-item:hover {
  background: rgba(102, 126, 234, 0.18) !important;
}

html[data-theme="dark"] body.area-public .lang-item.active {
  background: rgba(102, 126, 234, 0.28) !important;
}

html[data-theme="dark"] body.area-public .navbar .dropdown-toggle.bg-light {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

html[data-theme="dark"] body.area-public .navbar .dropdown-toggle.bg-light i {
  color: #fff !important;
}

/* Mobile expanded menu uses its own gradient in base.html — match dark bar */
@media (max-width: 991.98px) {
  html[data-theme="dark"] body.area-public .navbar .navbar-collapse {
    background: linear-gradient(135deg, #141a32 0%, #10182c 45%, #0c1022 100%) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
  }
}

/* ----- Public navbar: theme toggle (no Bootstrap .btn — avoids blue focus/fill) ----- */
body.area-public .cdf-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

body.area-public .cdf-theme-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1) !important;
}

body.area-public .cdf-theme-toggle:focus {
  outline: none;
  box-shadow: none !important;
}

body.area-public .cdf-theme-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

body.area-public .cdf-theme-toggle:active {
  transform: scale(0.96);
}

body.area-public .cdf-theme-toggle__icon {
  font-size: 1.12rem;
  line-height: 1;
  pointer-events: none;
}

/* ----- SEO service pages (templates/seo_service_page.html) ----- */
html[data-theme="dark"] body.area-public .service-card {
  background: #141c38;
  border-color: rgba(130, 150, 255, 0.22);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] body.area-public .service-card h1,
html[data-theme="dark"] body.area-public .service-card h2 {
  color: #f0f2ff;
}

html[data-theme="dark"] body.area-public .service-card p {
  color: #c4cce8;
}

html[data-theme="dark"] body.area-public .service-card ul,
html[data-theme="dark"] body.area-public .service-card ol {
  color: #dce2f5;
}

html[data-theme="dark"] body.area-public .service-card li {
  color: #dce2f5;
}

html[data-theme="dark"] body.area-public .quick-action-strip {
  border-color: rgba(130, 150, 255, 0.35);
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0.06));
  color: #c8d4ff;
}

html[data-theme="dark"] body.area-public .service-divider {
  border-top-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] body.area-public .service-note,
html[data-theme="dark"] body.area-public .service-urgency {
  color: #a8b4d8;
}

html[data-theme="dark"] body.area-public .service-related h2 {
  color: #f0f2ff;
}

html[data-theme="dark"] body.area-public .service-related-link {
  border-color: rgba(130, 150, 255, 0.22);
  background: rgba(20, 28, 56, 0.65);
  color: #dce2f5;
}

html[data-theme="dark"] body.area-public .service-related-link:hover {
  border-color: rgba(130, 150, 255, 0.45);
  color: #b8c4ff;
  background: #1a2344;
}

html[data-theme="dark"] body.area-public .service-cta .btn-primary {
  background: linear-gradient(135deg, #5a64c8 0%, #6b4fa8 100%);
  color: #f5f7ff;
  border-color: rgba(180, 190, 255, 0.3);
}

html[data-theme="dark"] body.area-public .service-cta .btn-primary:hover {
  background: linear-gradient(135deg, #656fd8 0%, #7858b8 100%);
  color: #fff;
}

html[data-theme="dark"] body.area-public .service-cta .btn-outline-success {
  color: #9ee6b8 !important;
  border-color: rgba(37, 211, 102, 0.5) !important;
  background: rgba(20, 28, 56, 0.65) !important;
}

html[data-theme="dark"] body.area-public .service-cta .btn-outline-success:hover {
  background: rgba(37, 211, 102, 0.16) !important;
  color: #e8fff0 !important;
  border-color: rgba(37, 211, 102, 0.65) !important;
}
