/*
 * Prudence Global — Design System & Theme Layer
 * Architecture: Offshore Command (dark) + Executive Daylight (light) + Split-Screen Auth
 * Rollback: start Rails with APP_VISUAL_THEME=legacy.
 */

/* ---------- Self-hosted Brand Fonts (CSP style-src 'self' safe) ---------- */
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/exo2-latin-ext-1bdf4a81.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/exo2-latin-ff092b94.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/montserrat-latin-ext-9d7ec31b.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/montserrat-latin-9fa5e944.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/jetbrains-mono-latin-ext-cc1590e8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/jetbrains-mono-latin-8a992d39.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Custom Scrollbar & View Transitions ---------- */
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(11, 29, 45, 0.35); }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(79, 70, 229, 0.4); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(79, 70, 229, 0.6); }

@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.25s; }

@keyframes telemetry-ping {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
.animate-telemetry { animation: telemetry-ping 1s ease-out; }

@keyframes pg-pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ===========================================================================
   Shared Brand Typography & Structural Components (Both Dark & Light)
   =========================================================================== */
[data-theme='prudence_global'],
[data-theme='prudence_global_light'] {
  --pg-font-display: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --pg-font-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --pg-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-family: var(--pg-font-body);
}

[data-theme='prudence_global'] h1,
[data-theme='prudence_global'] h2,
[data-theme='prudence_global'] h3,
[data-theme='prudence_global'] .pg-display,
[data-theme='prudence_global'] .brand-wordmark,
[data-theme='prudence_global_light'] h1,
[data-theme='prudence_global_light'] h2,
[data-theme='prudence_global_light'] h3,
[data-theme='prudence_global_light'] .pg-display,
[data-theme='prudence_global_light'] .brand-wordmark {
  font-family: var(--pg-font-display);
}

[data-theme='prudence_global'] .font-mono,
[data-theme='prudence_global'] code,
[data-theme='prudence_global'] .pg-mono,
[data-theme='prudence_global_light'] .font-mono,
[data-theme='prudence_global_light'] code,
[data-theme='prudence_global_light'] .pg-mono {
  font-family: var(--pg-font-mono);
}

/* Brand Lockup ("PRUDENCE / — GLOBAL —") */
.pg-brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.pg-brand-lockup .pg-brand-name {
  font-family: var(--pg-font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: #f8fafc;
  text-transform: uppercase;
}
.pg-brand-lockup .pg-brand-sub {
  font-family: var(--pg-font-display);
  font-weight: 700;
  font-size: 0.58rem;
  letter-spacing: 0.34em;
  color: #ff8a00;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.pg-brand-lockup .pg-brand-sub::before,
.pg-brand-lockup .pg-brand-sub::after {
  content: "";
  width: 0.7rem;
  height: 1.5px;
  background: #ff8a00;
  opacity: 0.9;
}

.pg-pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #34d399;
  flex-shrink: 0;
  animation: pg-pulse-dot 2.4s infinite;
}

/* ===========================================================================
   OFFSHORE COMMAND — DARK THEME (data-theme="prudence_global")
   =========================================================================== */
[data-theme='prudence_global'] {
  --pg-abyss: #0b1d2d;
  --pg-abyss-deep: #06111b;
  --pg-navy: #12324a;
  --pg-orange: #ff8a00;
  --pg-orange-hover: #ffa033;
  --pg-silver: #a7a9ac;
  --pg-ink: #1e1e1e;
  --pg-paper: #f2f2f2;
  --pg-line: rgba(167, 169, 172, 0.17);
  --pg-line-strong: rgba(167, 169, 172, 0.32);
  --pg-surface: rgba(10, 29, 46, 0.86);
  --pg-surface-sunken: rgba(4, 12, 20, 0.74);
  --pg-orange-glow: rgba(255, 138, 0, 0.22);
  color: #f8fafc;
  /* Last stop is opaque solid #040b12 (required by contrast spec page_base_color). */
  background:
    radial-gradient(circle at 26% -8%, rgba(18, 50, 74, 0.82), transparent 44%),
    radial-gradient(circle at 94% 6%, rgba(255, 138, 0, 0.10), transparent 24%),
    linear-gradient(155deg, #050e17 0%, #091b2b 48%, #040b12 100%);
}

[data-theme='prudence_global']::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(242, 242, 242, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 242, 242, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), transparent 86%);
}

/* Offshore Command Sidebar (remains deep navy in both themes!) */
.pg-sidebar {
  background:
    radial-gradient(circle at 12% 0%, rgba(18, 50, 74, 0.62), transparent 42%),
    linear-gradient(180deg, #071522 0%, #050f19 100%);
  border-right: 1px solid rgba(167, 169, 172, 0.16);
  color: #f8fafc;
}

.pg-sidebar-unit {
  background: rgba(18, 50, 74, 0.44);
  border: 1px solid rgba(167, 169, 172, 0.18);
}

.pg-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.8rem;
  border-radius: 0.55rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.pg-nav-item svg {
  width: 1.1rem;
  height: 1.1rem;
  color: #8496a8;
  flex-shrink: 0;
  transition: color 0.16s ease;
}

.pg-nav-item:hover {
  background: rgba(18, 50, 74, 0.55);
  color: #ffffff;
}

.pg-nav-item:hover svg {
  color: #cbd5e1;
}

.pg-nav-item.pg-nav-active {
  background: linear-gradient(90deg, rgba(255, 138, 0, 0.16), rgba(18, 50, 74, 0.48));
  border-color: rgba(255, 138, 0, 0.34);
  color: #ffffff;
  font-weight: 700;
}

.pg-nav-item.pg-nav-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42rem;
  bottom: 0.42rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #ff8a00;
}

.pg-nav-item.pg-nav-active svg {
  color: #ff8a00;
}

.pg-telemetry-badge {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.24);
  color: #a7f3d0;
}

/* Topbar (Desktop Command Strip) */
[data-theme='prudence_global'] .pg-topbar {
  background: rgba(6, 17, 27, 0.78);
  border-bottom: 1px solid var(--pg-line);
  backdrop-filter: blur(14px);
}

/* Gauge Hero & Executive Components */
[data-theme='prudence_global'] .pg-gauge-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 138, 0, 0.12), transparent 55%),
    var(--pg-surface);
  border: 1px solid rgba(255, 138, 0, 0.32);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme='prudence_global'] .pg-panel {
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

[data-theme='prudence_global'] .pg-kpi-card {
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  border-top: 2px solid rgba(167, 169, 172, 0.24);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
[data-theme='prudence_global'] .pg-kpi-card:hover { border-color: var(--pg-line-strong); }
[data-theme='prudence_global'] .pg-kpi-card.kpi-orange { border-top-color: #ff8a00; }
[data-theme='prudence_global'] .pg-kpi-card.kpi-blue   { border-top-color: #60a5fa; }
[data-theme='prudence_global'] .pg-kpi-card.kpi-warn   { border-top-color: #fbbf24; }
[data-theme='prudence_global'] .pg-kpi-card.kpi-ok     { border-top-color: #34d399; }
[data-theme='prudence_global'] .pg-kpi-card.kpi-danger { border-top-color: #f87171; }

[data-theme='prudence_global'] .pg-step-card {
  background: rgba(4, 12, 20, 0.62);
  border: 1px solid var(--pg-line);
}
[data-theme='prudence_global'] .pg-step-card.is-done {
  border-color: rgba(52, 211, 153, 0.35);
}
[data-theme='prudence_global'] .pg-step-card.is-ready {
  border-color: rgba(255, 138, 0, 0.45);
}

/* Global Tailwind remaps for cohesive dark Offshore Command across ALL views */
[data-theme='prudence_global'] .brand-wordmark span,
[data-theme='prudence_global'] .text-indigo-500,
[data-theme='prudence_global'] .text-indigo-400,
[data-theme='prudence_global'] .text-indigo-300,
[data-theme='prudence_global'] .text-indigo-200 {
  color: var(--pg-orange);
}

[data-theme='prudence_global'] .bg-gray-950,
[data-theme='prudence_global'].bg-gray-950 {
  background-color: transparent;
}

[data-theme='prudence_global'] .bg-gray-900,
[data-theme='prudence_global'] .bg-gray-900\/40,
[data-theme='prudence_global'] .bg-gray-900\/50,
[data-theme='prudence_global'] .bg-gray-900\/60,
[data-theme='prudence_global'] .bg-gray-900\/70,
[data-theme='prudence_global'] .bg-gray-900\/80 {
  background-color: var(--pg-surface);
}

[data-theme='prudence_global'] .bg-gray-800,
[data-theme='prudence_global'] .bg-gray-800\/20,
[data-theme='prudence_global'] .bg-gray-800\/30,
[data-theme='prudence_global'] .bg-gray-800\/40,
[data-theme='prudence_global'] .bg-gray-800\/50,
[data-theme='prudence_global'] .bg-gray-800\/60,
[data-theme='prudence_global'] .bg-gray-800\/80 {
  background-color: rgba(16, 44, 66, 0.62);
}

/* Form controls recessed cleanly on dark surfaces */
[data-theme='prudence_global'] input.bg-gray-800,
[data-theme='prudence_global'] input.bg-gray-800\/60,
[data-theme='prudence_global'] select.bg-gray-800,
[data-theme='prudence_global'] select.bg-gray-800\/60,
[data-theme='prudence_global'] textarea.bg-gray-800,
[data-theme='prudence_global'] textarea.bg-gray-800\/60 {
  background-color: rgba(4, 13, 22, 0.78);
  border-color: rgba(167, 169, 172, 0.24);
}

[data-theme='prudence_global'] .bg-gray-950\/30,
[data-theme='prudence_global'] .bg-gray-950\/35,
[data-theme='prudence_global'] .bg-gray-950\/40 {
  background-color: rgba(4, 12, 20, 0.56);
}

[data-theme='prudence_global'] .border-gray-800,
[data-theme='prudence_global'] .border-gray-800\/50,
[data-theme='prudence_global'] .border-gray-800\/60,
[data-theme='prudence_global'] .border-gray-800\/70,
[data-theme='prudence_global'] .border-gray-700,
[data-theme='prudence_global'] .border-gray-700\/50,
[data-theme='prudence_global'] .border-gray-700\/60 {
  border-color: var(--pg-line);
}

/* Primary Orange CTA with WCAG AAA dark navy text */
[data-theme='prudence_global'] .bg-indigo-600,
[data-theme='prudence_global'] .bg-indigo-700,
[data-theme='prudence_global'] .bg-indigo-500 {
  background-color: var(--pg-orange);
  color: #0b1d2d;
}
[data-theme='prudence_global'] .bg-indigo-600:hover,
[data-theme='prudence_global'] .hover\:bg-indigo-500:hover {
  background-color: var(--pg-orange-hover);
  color: #0b1d2d;
}
[data-theme='prudence_global'] .bg-indigo-600.text-white,
[data-theme='prudence_global'] .bg-indigo-700.text-white,
[data-theme='prudence_global'] .bg-indigo-500.text-white {
  color: #0b1d2d;
}

/* Aba ativa da escolha de cursos (admin/shared/_course_picker): mesmo laranja do CTA */
[data-theme='prudence_global'] [role='tab'][aria-selected='true'] {
  background-color: var(--pg-orange);
  color: #0b1d2d;
}

/* Translucent accent pills stay translucent */
[data-theme='prudence_global'] .bg-indigo-500\/10,
[data-theme='prudence_global'] .bg-indigo-500\/20,
[data-theme='prudence_global'] .bg-indigo-500\/30,
[data-theme='prudence_global'] .bg-indigo-600\/20,
[data-theme='prudence_global'] .bg-indigo-600\/30 {
  background-color: rgba(255, 138, 0, 0.14);
}
[data-theme='prudence_global'] .bg-indigo-600\/80 {
  background-color: rgba(255, 138, 0, 0.92);
  color: #0b1d2d;
}

[data-theme='prudence_global'] .bg-gradient-to-r.from-indigo-600.to-indigo-700 {
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255, 138, 0, 0.14), transparent 34%),
    linear-gradient(135deg, #081a29 0%, #12324a 58%, #0a2235 100%);
  border-bottom: 1px solid rgba(255, 138, 0, 0.35);
}

[data-theme='prudence_global'] .border-indigo-500,
[data-theme='prudence_global'] .border-indigo-500\/20,
[data-theme='prudence_global'] .border-indigo-500\/30,
[data-theme='prudence_global'] .border-indigo-500\/40,
[data-theme='prudence_global'] .border-indigo-500\/50 {
  border-color: rgba(255, 138, 0, 0.48);
}

[data-theme='prudence_global'] .ring-indigo-500,
[data-theme='prudence_global'] .focus\:ring-indigo-500:focus,
[data-theme='prudence_global'] .focus\:ring-indigo-500\/40:focus {
  --tw-ring-color: var(--pg-orange);
}

[data-theme='prudence_global'] .focus\:border-indigo-500:focus,
[data-theme='prudence_global'] .has-\[\:checked\]\:border-indigo-500:has(:checked),
[data-theme='prudence_global'] .has-\[\:checked\]\:border-indigo-600:has(:checked) {
  border-color: var(--pg-orange);
}

[data-theme='prudence_global'] .shadow-indigo-500\/20 {
  --tw-shadow-color: var(--pg-orange-glow);
}

[data-theme='prudence_global'] .rounded-2xl,
[data-theme='prudence_global'] .rounded-xl {
  box-shadow: inset 0 1px 0 rgba(242, 242, 242, 0.035);
}

[data-theme='prudence_global'] .pg-mobile-nav {
  background: rgba(5, 15, 25, 0.94);
  border-top: 1px solid var(--pg-line);
  backdrop-filter: blur(14px);
}

[data-theme='prudence_global'] .menu-panel {
  background-color: #081c2c;
  border-color: rgba(167, 169, 172, 0.25);
}

[data-theme='prudence_global'] .custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 138, 0, 0.42);
}
[data-theme='prudence_global'] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 138, 0, 0.62);
}

[data-theme='prudence_global'] .expand-toggle {
  display: inline-flex !important;
  width: 2.5rem !important;
  height: 2.5rem !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: var(--pg-orange) !important;
  background: rgba(4, 12, 20, 0.55) !important;
  border: 1px solid rgba(255, 138, 0, 0.34) !important;
  border-radius: 0.75rem !important;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}
[data-theme='prudence_global'] .expand-toggle:hover {
  color: #f8fafc !important;
  background: rgba(255, 138, 0, 0.14) !important;
  border-color: rgba(255, 138, 0, 0.68) !important;
}
[data-theme='prudence_global'] .expand-toggle svg {
  display: block !important;
  color: currentColor !important;
  stroke: currentColor !important;
}

/* ===========================================================================
   EXECUTIVE DAYLIGHT — LIGHT THEME (data-theme="prudence_global_light")
   Architectural crisp daylight surfaces anchored by the deep #0B1D2D sidebar.
   =========================================================================== */
[data-theme='prudence_global_light'] {
  --pg-abyss: #ffffff;
  --pg-navy: #12324a;
  --pg-orange: #ff8a00;
  --pg-orange-hover: #ffa033;
  --pg-silver: #6b7b8c;
  --pg-ink: #0b1d2d;
  --pg-paper: #f1f4f8;
  --pg-line: #dce2ea;
  --pg-line-strong: #c4ceda;
  --pg-orange-glow: rgba(255, 138, 0, 0.18);
  color: var(--pg-ink);
  /* Ends with opaque solid #eef1f5 (required by contrast spec page_base_color). */
  background:
    radial-gradient(circle at 60% -10%, rgba(18, 50, 74, 0.05), transparent 44%),
    linear-gradient(160deg, #f6f8fa 0%, #f2f5f8 55%, #eef1f5 100%);
}

[data-theme='prudence_global_light']::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(18, 50, 74, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 50, 74, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 84%);
}

[data-theme='prudence_global_light'] .pg-topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--pg-line);
  backdrop-filter: blur(12px);
}

[data-theme='prudence_global_light'] .pg-gauge-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 138, 0, 0.08), transparent 55%),
    #ffffff;
  border: 1px solid var(--pg-line);
  border-left: 4px solid #ff8a00;
  box-shadow: 0 2px 6px rgba(11, 29, 45, 0.05), 0 12px 24px rgba(11, 29, 45, 0.06);
}

[data-theme='prudence_global_light'] .pg-panel {
  background: #ffffff;
  border: 1px solid var(--pg-line);
  box-shadow: 0 1px 3px rgba(11, 29, 45, 0.05), 0 10px 22px rgba(11, 29, 45, 0.05);
}

[data-theme='prudence_global_light'] .pg-kpi-card {
  background: #ffffff;
  border: 1px solid var(--pg-line);
  border-top: 3px solid #0b1d2d;
  box-shadow: 0 1px 3px rgba(11, 29, 45, 0.05);
}
[data-theme='prudence_global_light'] .pg-kpi-card.kpi-orange { border-top-color: #ff8a00; }
[data-theme='prudence_global_light'] .pg-kpi-card.kpi-blue   { border-top-color: #1d4ed8; }
[data-theme='prudence_global_light'] .pg-kpi-card.kpi-warn   { border-top-color: #d97706; }
[data-theme='prudence_global_light'] .pg-kpi-card.kpi-ok     { border-top-color: #059669; }
[data-theme='prudence_global_light'] .pg-kpi-card.kpi-danger { border-top-color: #dc2626; }

[data-theme='prudence_global_light'] .pg-step-card {
  background: #f8fafc;
  border: 1px solid var(--pg-line);
}
[data-theme='prudence_global_light'] .pg-step-card.is-done {
  border-color: rgba(5, 150, 105, 0.4);
  background: #f0fdf4;
}
[data-theme='prudence_global_light'] .pg-step-card.is-ready {
  border-color: rgba(255, 138, 0, 0.5);
  background: #fffaf3;
}

/* Keep the deep navy sidebar text bright in light mode! */
[data-theme='prudence_global_light'] .pg-sidebar .text-white,
[data-theme='prudence_global_light'] .pg-sidebar .text-gray-100,
[data-theme='prudence_global_light'] .pg-sidebar .text-gray-200 {
  color: #f8fafc;
}
[data-theme='prudence_global_light'] .pg-sidebar .text-gray-300,
[data-theme='prudence_global_light'] .pg-sidebar .text-gray-400 {
  color: #cbd5e1;
}
[data-theme='prudence_global_light'] .pg-sidebar .text-gray-500 {
  color: #8496a8;
}
[data-theme='prudence_global_light'] .pg-sidebar .bg-gray-800 {
  background-color: rgba(18, 50, 74, 0.72);
}
[data-theme='prudence_global_light'] .pg-sidebar .border-gray-800 {
  border-color: rgba(167, 169, 172, 0.16);
}
[data-theme='prudence_global_light'] .pg-sidebar .pg-nav-item.pg-nav-active {
  background: #ff8a00;
  color: #0b1d2d;
  border-color: #ff8a00;
}
[data-theme='prudence_global_light'] .pg-sidebar .pg-nav-item.pg-nav-active::before {
  display: none;
}
[data-theme='prudence_global_light'] .pg-sidebar .pg-nav-item.pg-nav-active svg {
  color: #0b1d2d;
}

/* Light mode surfaces */
[data-theme='prudence_global_light'] .bg-gray-950,
[data-theme='prudence_global_light'].bg-gray-950 {
  background-color: transparent;
}
[data-theme='prudence_global_light'] .bg-gray-900,
[data-theme='prudence_global_light'] .bg-gray-900\/40,
[data-theme='prudence_global_light'] .bg-gray-900\/50,
[data-theme='prudence_global_light'] .bg-gray-900\/60,
[data-theme='prudence_global_light'] .bg-gray-900\/70,
[data-theme='prudence_global_light'] .bg-gray-900\/80 {
  background-color: #ffffff;
}
[data-theme='prudence_global_light'] .bg-gray-800,
[data-theme='prudence_global_light'] .bg-gray-800\/20,
[data-theme='prudence_global_light'] .bg-gray-800\/30,
[data-theme='prudence_global_light'] .bg-gray-800\/40,
[data-theme='prudence_global_light'] .bg-gray-800\/50,
[data-theme='prudence_global_light'] .bg-gray-800\/60,
[data-theme='prudence_global_light'] .bg-gray-800\/80 {
  background-color: var(--pg-paper);
}
[data-theme='prudence_global_light'] input.bg-gray-800,
[data-theme='prudence_global_light'] input.bg-gray-800\/60,
[data-theme='prudence_global_light'] select.bg-gray-800,
[data-theme='prudence_global_light'] select.bg-gray-800\/60,
[data-theme='prudence_global_light'] textarea.bg-gray-800,
[data-theme='prudence_global_light'] textarea.bg-gray-800\/60 {
  background-color: #ffffff;
  border-color: var(--pg-line-strong);
  color: var(--pg-ink);
}
[data-theme='prudence_global_light'] .bg-gray-950\/30,
[data-theme='prudence_global_light'] .bg-gray-950\/35,
[data-theme='prudence_global_light'] .bg-gray-950\/40 {
  background-color: rgba(11, 29, 45, 0.035);
}
[data-theme='prudence_global_light'] .bg-gray-700,
[data-theme='prudence_global_light'] .bg-gray-700\/30,
[data-theme='prudence_global_light'] .bg-gray-700\/50,
[data-theme='prudence_global_light'] .bg-gray-700\/60,
[data-theme='prudence_global_light'] .bg-gray-600 {
  background-color: rgba(18, 50, 74, 0.07);
}

/* Light mode text remaps */
[data-theme='prudence_global_light'] .text-white,
[data-theme='prudence_global_light'] .text-gray-100,
[data-theme='prudence_global_light'] .text-gray-200 {
  color: var(--pg-ink);
}
[data-theme='prudence_global_light'] .text-gray-300 { color: #334155; }
[data-theme='prudence_global_light'] .text-gray-400 { color: #475569; }
[data-theme='prudence_global_light'] .text-gray-500 { color: #64748b; }

/* Dark hero banners keep light text in light mode */
[data-theme='prudence_global_light'] .bg-gradient-to-r.from-indigo-600.to-indigo-700 h1,
[data-theme='prudence_global_light'] .bg-gradient-to-r.from-indigo-600.to-indigo-700 h2,
[data-theme='prudence_global_light'] .bg-gradient-to-r.from-indigo-600.to-indigo-700 .text-white,
[data-theme='prudence_global_light'] .bg-gradient-to-r.from-indigo-600.to-indigo-700 .text-gray-100,
[data-theme='prudence_global_light'] .bg-gradient-to-r.from-indigo-600.to-indigo-700.text-white,
[data-theme='prudence_global_light'] .bg-emerald-600.text-white,
[data-theme='prudence_global_light'] .bg-red-600.text-white,
[data-theme='prudence_global_light'] .bg-yellow-600.text-white {
  color: #ffffff;
}

/* Light mode accent & primary orange CTA */
[data-theme='prudence_global_light'] .brand-wordmark span,
[data-theme='prudence_global_light'] .text-indigo-500,
[data-theme='prudence_global_light'] .text-indigo-400,
[data-theme='prudence_global_light'] .text-indigo-300,
[data-theme='prudence_global_light'] .text-indigo-200 {
  color: #d97300;
}
[data-theme='prudence_global_light'] .bg-indigo-600,
[data-theme='prudence_global_light'] .bg-indigo-700,
[data-theme='prudence_global_light'] .bg-indigo-500 {
  background-color: var(--pg-orange);
  color: #0b1d2d;
}
[data-theme='prudence_global_light'] .bg-indigo-600:hover,
[data-theme='prudence_global_light'] .hover\:bg-indigo-500:hover {
  background-color: var(--pg-orange-hover);
  color: #0b1d2d;
}
[data-theme='prudence_global_light'] .bg-indigo-600.text-white,
[data-theme='prudence_global_light'] .bg-indigo-700.text-white,
[data-theme='prudence_global_light'] .bg-indigo-500.text-white {
  color: #0b1d2d;
}

[data-theme='prudence_global_light'] .bg-indigo-500\/10,
[data-theme='prudence_global_light'] .bg-indigo-500\/20,
[data-theme='prudence_global_light'] .bg-indigo-500\/30,
[data-theme='prudence_global_light'] .bg-indigo-600\/20,
[data-theme='prudence_global_light'] .bg-indigo-600\/30 {
  background-color: rgba(255, 138, 0, 0.14);
}
[data-theme='prudence_global_light'] .bg-gradient-to-r.from-indigo-600.to-indigo-700 {
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255, 138, 0, 0.16), transparent 34%),
    linear-gradient(135deg, #0b1d2d 0%, #12324a 60%, #173f5e 100%);
}
[data-theme='prudence_global_light'] .bg-gradient-to-r.from-indigo-600.to-indigo-700 .text-indigo-200 {
  color: #ffd099;
}

/* Light mode borders */
[data-theme='prudence_global_light'] .border-gray-800,
[data-theme='prudence_global_light'] .border-gray-800\/50,
[data-theme='prudence_global_light'] .border-gray-800\/60,
[data-theme='prudence_global_light'] .border-gray-800\/70,
[data-theme='prudence_global_light'] .border-gray-800\/40,
[data-theme='prudence_global_light'] .hover\:border-gray-700:hover,
[data-theme='prudence_global_light'] .divide-gray-800\/60 > :not(:last-child),
[data-theme='prudence_global_light'] .divide-gray-800\/50 > :not(:last-child),
[data-theme='prudence_global_light'] .divide-gray-800\/40 > :not(:last-child),
[data-theme='prudence_global_light'] .divide-gray-800 > :not(:last-child),
[data-theme='prudence_global_light'] .border-gray-700,
[data-theme='prudence_global_light'] .border-gray-700\/50,
[data-theme='prudence_global_light'] .border-gray-700\/60 {
  border-color: var(--pg-line);
}
[data-theme='prudence_global_light'] .border-indigo-500,
[data-theme='prudence_global_light'] .border-indigo-500\/20,
[data-theme='prudence_global_light'] .border-indigo-500\/30,
[data-theme='prudence_global_light'] .border-indigo-500\/40,
[data-theme='prudence_global_light'] .border-indigo-500\/50 {
  border-color: rgba(255, 138, 0, 0.55);
}
[data-theme='prudence_global_light'] .ring-indigo-500,
[data-theme='prudence_global_light'] .focus\:ring-indigo-500:focus,
[data-theme='prudence_global_light'] .focus\:ring-indigo-500\/40:focus {
  --tw-ring-color: var(--pg-orange);
}
[data-theme='prudence_global_light'] .focus\:border-indigo-500:focus,
[data-theme='prudence_global_light'] .has-\[\:checked\]\:border-indigo-500:has(:checked),
[data-theme='prudence_global_light'] .has-\[\:checked\]\:border-indigo-600:has(:checked) {
  border-color: var(--pg-orange);
}

/* Status colors in light mode */
[data-theme='prudence_global_light'] .bg-green-900,
[data-theme='prudence_global_light'] .bg-green-900\/40,
[data-theme='prudence_global_light'] .bg-emerald-900\/40,
[data-theme='prudence_global_light'] .bg-emerald-500\/10,
[data-theme='prudence_global_light'] .bg-green-500\/10 {
  background-color: #ecfdf5;
}
[data-theme='prudence_global_light'] .bg-red-900,
[data-theme='prudence_global_light'] .bg-red-900\/40,
[data-theme='prudence_global_light'] .bg-red-950,
[data-theme='prudence_global_light'] .bg-red-500\/10 {
  background-color: #fef2f2;
}
[data-theme='prudence_global_light'] .bg-yellow-900,
[data-theme='prudence_global_light'] .bg-yellow-900\/40,
[data-theme='prudence_global_light'] .bg-yellow-950\/20,
[data-theme='prudence_global_light'] .bg-yellow-500\/10 {
  background-color: #fffbeb;
}
[data-theme='prudence_global_light'] .text-green-400,
[data-theme='prudence_global_light'] .text-green-300,
[data-theme='prudence_global_light'] .text-green-500,
[data-theme='prudence_global_light'] .text-emerald-400,
[data-theme='prudence_global_light'] .text-emerald-300 {
  color: #047857;
}
[data-theme='prudence_global_light'] .text-red-400,
[data-theme='prudence_global_light'] .text-red-300,
[data-theme='prudence_global_light'] .text-red-500,
[data-theme='prudence_global_light'] .text-red-200 {
  color: #b91c1c;
}
[data-theme='prudence_global_light'] .text-yellow-400,
[data-theme='prudence_global_light'] .text-yellow-300,
[data-theme='prudence_global_light'] .text-yellow-200,
[data-theme='prudence_global_light'] .text-yellow-200\/90,
[data-theme='prudence_global_light'] .text-yellow-500,
[data-theme='prudence_global_light'] .text-amber-400 {
  color: #b45309;
}
[data-theme='prudence_global_light'] .text-blue-400,
[data-theme='prudence_global_light'] .text-blue-300 {
  color: #1d4ed8;
}
[data-theme='prudence_global_light'] .border-red-700,
[data-theme='prudence_global_light'] .border-red-800,
[data-theme='prudence_global_light'] .border-red-900,
[data-theme='prudence_global_light'] .border-red-500,
[data-theme='prudence_global_light'] .border-red-500\/20 {
  border-color: rgba(220, 38, 38, 0.35);
}
[data-theme='prudence_global_light'] .border-green-700,
[data-theme='prudence_global_light'] .border-green-500,
[data-theme='prudence_global_light'] .border-green-400,
[data-theme='prudence_global_light'] .border-emerald-500\/20 {
  border-color: rgba(5, 150, 105, 0.35);
}
[data-theme='prudence_global_light'] .border-yellow-700,
[data-theme='prudence_global_light'] .border-yellow-500,
[data-theme='prudence_global_light'] .border-yellow-500\/30 {
  border-color: rgba(217, 119, 6, 0.42);
}

[data-theme='prudence_global_light'] .pg-mobile-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--pg-line);
  backdrop-filter: blur(12px);
}
[data-theme='prudence_global_light'] .menu-panel {
  background-color: #ffffff;
  border-color: var(--pg-line-strong);
}

[data-theme='prudence_global_light'] .rounded-2xl,
[data-theme='prudence_global_light'] .rounded-xl {
  box-shadow: 0 1px 2px rgba(11, 29, 45, 0.05), 0 8px 20px rgba(11, 29, 45, 0.05);
}

[data-theme='prudence_global_light'] .expand-toggle {
  display: inline-flex !important;
  width: 2.5rem !important;
  height: 2.5rem !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: #d97300 !important;
  background: rgba(255, 138, 0, 0.07) !important;
  border: 1px solid rgba(255, 138, 0, 0.36) !important;
  border-radius: 0.75rem !important;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}
[data-theme='prudence_global_light'] .expand-toggle:hover {
  color: #0b1d2d !important;
  background: rgba(255, 138, 0, 0.14) !important;
  border-color: rgba(255, 138, 0, 0.7) !important;
}
[data-theme='prudence_global_light'] .expand-toggle svg {
  display: block !important;
  color: currentColor !important;
  stroke: currentColor !important;
}

/* ===========================================================================
   EXECUTIVE DAYLIGHT SPLIT-SCREEN AUTH (Login / Password / Invite / Signup)
   Left: Deep #0B1D2D Navy Architectural Panel · Right: Crisp Daylight Form
   =========================================================================== */
.pg-auth-brand {
  position: relative;
  background:
    radial-gradient(circle at 20% 0%, rgba(18, 50, 74, 0.95), transparent 52%),
    radial-gradient(circle at 90% 92%, rgba(255, 138, 0, 0.16), transparent 36%),
    linear-gradient(155deg, #071522 0%, #0b1d2d 55%, #050f19 100%);
  color: #f8fafc;
}
.pg-auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(242, 242, 242, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 242, 242, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

.pg-auth-form-panel {
  background: #ffffff;
  color: #0b1d2d;
}

/* Keep Executive Daylight crisp white form styling consistent regardless of body dark/light cookie */
.pg-auth-form-panel h1,
.pg-auth-form-panel h2,
.pg-auth-form-panel .pg-auth-title {
  color: #0b1d2d;
}
.pg-auth-form-panel label {
  color: #1e3448;
}
.pg-auth-form-panel .pg-auth-sub {
  color: #5b6d7e;
}
.pg-auth-form-panel input[type="email"],
.pg-auth-form-panel input[type="password"],
.pg-auth-form-panel input[type="text"] {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0b1d2d;
}
.pg-auth-form-panel input[type="email"]::placeholder,
.pg-auth-form-panel input[type="password"]::placeholder,
.pg-auth-form-panel input[type="text"]::placeholder {
  color: #94a3b8;
}
.pg-auth-form-panel input[type="email"]:focus,
.pg-auth-form-panel input[type="password"]:focus,
.pg-auth-form-panel input[type="text"]:focus {
  background-color: #ffffff;
  border-color: #ff8a00;
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.18);
  outline: none;
}
.pg-auth-form-panel input[type="checkbox"] {
  background-color: #ffffff;
  border-color: #94a3b8;
  accent-color: #ff8a00;
}
.pg-auth-form-panel .pg-auth-submit {
  background-color: #ff8a00;
  color: #0b1d2d;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(255, 138, 0, 0.24);
}
.pg-auth-form-panel .pg-auth-submit:hover {
  background-color: #ffa033;
}
.pg-auth-form-panel a {
  color: #12324a;
}
.pg-auth-form-panel a:hover {
  color: #d97300;
}
.pg-auth-form-panel .pg-auth-alert {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.pg-auth-form-panel .pg-auth-notice {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.pg-auth-form-panel #error_explanation {
  background-color: #fef2f2;
  border-color: #fecaca;
}
.pg-auth-form-panel #error_explanation h2,
.pg-auth-form-panel #error_explanation li {
  color: #b91c1c;
}
.pg-auth-form-panel button[aria-label="Mostrar senha"]:hover,
.pg-auth-form-panel button[aria-label="Ocultar senha"]:hover {
  color: #0b1d2d;
}

/* ===========================================================================
   Theme Toggle & Conditional Icons
   =========================================================================== */
[data-theme='prudence_global'] [data-theme-icon='light'],
[data-theme='prudence_global'] [data-theme-logo='light'],
[data-theme='prudence_global_light'] [data-theme-icon='dark'],
[data-theme='prudence_global_light'] [data-theme-logo='dark'] {
  display: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  border: 1px solid var(--pg-line);
  color: #ff8a00;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover {
  border-color: rgba(255, 138, 0, 0.6);
  background: rgba(255, 138, 0, 0.10);
}
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }

/* ===========================================================================
   Semantic Progress Bars & Audio Player
   =========================================================================== */
progress {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
}

/* 1. Student Dashboard Progress Bar */
progress.student-course-progress { background-color: rgba(31, 41, 55, 0.5); }
progress.student-course-progress::-webkit-progress-bar { background-color: rgba(31, 41, 55, 0.5); border-radius: 9999px; }
progress.student-course-progress::-webkit-progress-value { background-color: #6366f1; border-radius: 9999px; transition: all 0.3s ease; }
progress.student-course-progress::-moz-progress-bar { background-color: #6366f1; border-radius: 9999px; transition: all 0.3s ease; }

[data-theme='prudence_global'] progress.student-course-progress,
[data-theme='prudence_global'] progress.student-course-progress::-webkit-progress-bar { background-color: rgba(18, 50, 74, 0.72); }
[data-theme='prudence_global'] progress.student-course-progress::-webkit-progress-value,
[data-theme='prudence_global'] progress.student-course-progress::-moz-progress-bar { background-color: #ff8a00; }

[data-theme='prudence_global_light'] progress.student-course-progress,
[data-theme='prudence_global_light'] progress.student-course-progress::-webkit-progress-bar { background-color: #e2e8f0; }
[data-theme='prudence_global_light'] progress.student-course-progress::-webkit-progress-value,
[data-theme='prudence_global_light'] progress.student-course-progress::-moz-progress-bar { background-color: #ff8a00; }

/* 2. Admin Collaborator & Project Progress Bars */
progress.collaborator-progress,
progress.pg-project-progress { background-color: #1f2937; }
progress.collaborator-progress::-webkit-progress-bar,
progress.pg-project-progress::-webkit-progress-bar { background-color: #1f2937; border-radius: 9999px; }

progress.collaborator-progress.is-compliant::-webkit-progress-value,
progress.collaborator-progress.is-compliant::-moz-progress-bar { background-color: #34d399; border-radius: 9999px; }
progress.collaborator-progress.is-in-progress::-webkit-progress-value,
progress.collaborator-progress.is-in-progress::-moz-progress-bar { background-color: #fbbf24; border-radius: 9999px; }
progress.collaborator-progress.is-empty::-webkit-progress-value,
progress.collaborator-progress.is-empty::-moz-progress-bar { background-color: #4b5563; border-radius: 9999px; }

[data-theme='prudence_global'] progress.collaborator-progress,
[data-theme='prudence_global'] progress.collaborator-progress::-webkit-progress-bar,
[data-theme='prudence_global'] progress.pg-project-progress,
[data-theme='prudence_global'] progress.pg-project-progress::-webkit-progress-bar { background-color: rgba(18, 50, 74, 0.75); }
[data-theme='prudence_global'] progress.pg-project-progress::-webkit-progress-value,
[data-theme='prudence_global'] progress.pg-project-progress::-moz-progress-bar { background-color: #ff8a00; border-radius: 9999px; }

[data-theme='prudence_global_light'] progress.collaborator-progress,
[data-theme='prudence_global_light'] progress.collaborator-progress::-webkit-progress-bar,
[data-theme='prudence_global_light'] progress.pg-project-progress,
[data-theme='prudence_global_light'] progress.pg-project-progress::-webkit-progress-bar { background-color: #e2e8f0; }
[data-theme='prudence_global_light'] progress.pg-project-progress::-webkit-progress-value,
[data-theme='prudence_global_light'] progress.pg-project-progress::-moz-progress-bar { background-color: #0b1d2d; border-radius: 9999px; }
[data-theme='prudence_global_light'] progress.collaborator-progress.is-compliant::-webkit-progress-value,
[data-theme='prudence_global_light'] progress.collaborator-progress.is-compliant::-moz-progress-bar { background-color: #059669; }
[data-theme='prudence_global_light'] progress.collaborator-progress.is-in-progress::-webkit-progress-value,
[data-theme='prudence_global_light'] progress.collaborator-progress.is-in-progress::-moz-progress-bar { background-color: #d97706; }
[data-theme='prudence_global_light'] progress.collaborator-progress.is-empty::-webkit-progress-value,
[data-theme='prudence_global_light'] progress.collaborator-progress.is-empty::-moz-progress-bar { background-color: #94a3b8; }

.audio-player-seek { accent-color: #6366f1; }
[data-theme='prudence_global'] .audio-player-seek,
[data-theme='prudence_global_light'] .audio-player-seek { accent-color: #ff8a00; }
