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

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):not(.arv-custom-header-action *),
html[data-theme='dark'] body :where(.bg-white, .bg-gray-50, .bg-gray-100, .bg-slate-50, .bg-zinc-50):not(.arv-custom-header-action *) {
    background-color: var(--arv-surface) !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']):not(.arv-custom-header-action *),
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']):not(.arv-custom-header-action *) {
    background-color: rgba(138, 108, 255, .14) !important;
}

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

html.dark body :where(.text-gray-600, .text-gray-500):not(.arv-custom-header-action *),
html[data-theme='dark'] body :where(.text-gray-600, .text-gray-500):not(.arv-custom-header-action *) {
    color: var(--arv-text-muted) !important;
}

html.dark body .text-gray-400:not(.arv-custom-header-action *),
html[data-theme='dark'] body .text-gray-400:not(.arv-custom-header-action *) {
    color: var(--arv-text-dim) !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):not(.arv-custom-header-action *),
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):not(.arv-custom-header-action *) {
    border-color: var(--arv-border) !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 var(--arv-shadow) !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, var(--arv-bg-deep), var(--arv-surface-soft)) !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: var(--arv-control);
    border-color: var(--arv-border);
    color: var(--arv-text);
}

html.dark body :where(input::placeholder, textarea::placeholder),
html[data-theme='dark'] body :where(input::placeholder, textarea::placeholder) {
    color: var(--arv-text-placeholder);
}
