/* Imagens global dark-mode polish (scoped to body) */
html.dark body,
html[data-theme='dark'] body {
    background: #071325;
    color: #d7e5f7;
}

html.dark body main,
html[data-theme='dark'] body main {
    background: transparent;
}

/* Surface balance */
html.dark body :where(.bg-white, .bg-gray-50, .bg-gray-100, .bg-slate-50, .bg-zinc-50),
html[data-theme='dark'] body :where(.bg-white, .bg-gray-50, .bg-gray-100, .bg-slate-50, .bg-zinc-50) {
    background-color: #0f1b2d !important;
}

html.dark body :where([class*='bg-blue-50'], [class*='bg-indigo-50'], [class*='bg-purple-50'], [class*='bg-pink-50'], [class*='bg-yellow-50']),
html[data-theme='dark'] body :where([class*='bg-blue-50'], [class*='bg-indigo-50'], [class*='bg-purple-50'], [class*='bg-pink-50'], [class*='bg-yellow-50']) {
    background-color: rgba(52, 78, 118, 0.24) !important;
}

/* Typography contrast */
html.dark body :where(.text-black, .text-gray-900, .text-gray-800, .text-gray-700),
html[data-theme='dark'] body :where(.text-black, .text-gray-900, .text-gray-800, .text-gray-700) {
    color: #edf4ff !important;
}

html.dark body :where(.text-gray-600, .text-gray-500),
html[data-theme='dark'] body :where(.text-gray-600, .text-gray-500) {
    color: #b6cae5 !important;
}

html.dark body .text-gray-400,
html[data-theme='dark'] body .text-gray-400 {
    color: #90a8c9 !important;
}

/* Border and depth */
html.dark body :where(.border-gray-100, .border-gray-200, .border-gray-300, .border-slate-100, .border-slate-200, .border-slate-300, .border-blue-100, .border-blue-200, .border-indigo-100),
html[data-theme='dark'] body :where(.border-gray-100, .border-gray-200, .border-gray-300, .border-slate-100, .border-slate-200, .border-slate-300, .border-blue-100, .border-blue-200, .border-indigo-100) {
    border-color: #2c3f5b !important;
}

html.dark body :where(.shadow-sm, .shadow, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl),
html[data-theme='dark'] body :where(.shadow-sm, .shadow, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl) {
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34) !important;
}

/* Tone down white-heavy gradient blocks */
html.dark body :where([class*='bg-gradient-to-r'][class*='from-yellow-50'], [class*='bg-gradient-to-r'][class*='from-white'], [class*='bg-gradient-to-br'][class*='from-white']),
html[data-theme='dark'] body :where([class*='bg-gradient-to-r'][class*='from-yellow-50'], [class*='bg-gradient-to-r'][class*='from-white'], [class*='bg-gradient-to-br'][class*='from-white']) {
    background-image: linear-gradient(120deg, rgba(12, 24, 42, 0.96), rgba(15, 28, 48, 0.93)) !important;
}

/* Reduce strong glow/orb effects in dark mode */
html.dark body :where([class*='blur'][class*='rounded-full'][class*='bg-']),
html[data-theme='dark'] body :where([class*='blur'][class*='rounded-full'][class*='bg-']) {
    opacity: 0.2 !important;
    mix-blend-mode: normal !important;
    filter: blur(72px) !important;
}

/* Keep highlight chips readable (pricing/redeem-like blocks) */
html.dark body :where(.text-yellow-700, .text-amber-700),
html[data-theme='dark'] body :where(.text-yellow-700, .text-amber-700) {
    color: #facc15 !important;
}

/* Ensure common input shells stay legible on dark pages */
html.dark body :where(input, textarea, select),
html[data-theme='dark'] body :where(input, textarea, select) {
    background-color: #0c1729;
    border-color: #304563;
    color: #e5eeff;
}

html.dark body :where(input::placeholder, textarea::placeholder),
html[data-theme='dark'] body :where(input::placeholder, textarea::placeholder) {
    color: #84a0c4;
}
