/* Shared page foundations and compatibility with older Tailwind views. */
body.ryze-app {
    background: var(--background) !important;
    color: var(--foreground) !important;
    font-family: var(--font-arabic) !important;
    color-scheme: dark;
}
.ryze-app :where(h1, h2, h3, h4, p, label, input, select, textarea, button) { font-family: inherit; }
.ryze-app :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
    background-color: var(--background) !important;
    color: var(--foreground) !important;
    border-color: var(--border-strong) !important;
}
.ryze-app :where(input, select, textarea) { accent-color: var(--primary); }
.ryze-app ::placeholder { color: var(--placeholder); opacity: 1; }
.ryze-app :where(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.ryze-app ::selection { background: var(--primary); color: var(--background); }
.ryze-app .font-brand, .ryze-app .brand { font-family: var(--font-display) !important; color: var(--primary) !important; }
.ryze-app .story :where(p, li, blockquote) { color: var(--muted-foreground); }
.ryze-app .story :where(h2, h3, a) { color: var(--foreground); }
.ryze-app .story blockquote { border-color: var(--primary); }
.ryze-app footer { border-bottom-color: var(--primary); }
.ryze-app .ryze-input:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px var(--primary-tint); }

/* Legacy view color utilities mapped to RYZE tokens. */
.ryze-app .bg-black { background-color: var(--primary) !important; }
.ryze-app .bg-cream { background-color: var(--surface) !important; }
.ryze-app .bg-emerald-600 { background-color: var(--primary) !important; }
.ryze-app .bg-gold-400 { background-color: var(--primary) !important; }
.ryze-app .bg-gray-100 { background-color: var(--surface) !important; }
.ryze-app .bg-gray-300 { background-color: var(--surface) !important; }
.ryze-app .bg-neutral-50 { background-color: var(--surface) !important; }
.ryze-app .bg-photo { background-color: var(--surface) !important; }
.ryze-app .bg-sage-700 { background-color: var(--primary) !important; }
.ryze-app .bg-white { background-color: var(--surface) !important; }
.ryze-app .border-gray-100 { border-color: var(--border-strong) !important; }
.ryze-app .border-gray-200 { border-color: var(--border-strong) !important; }
.ryze-app .border-gray-400 { border-color: var(--border-strong) !important; }
.ryze-app .border-gray-900 { border-color: var(--border-strong) !important; }
.ryze-app .border-neutral-200 { border-color: var(--border-strong) !important; }
.ryze-app .focus\:border-neutral-400:focus { border-color: var(--border-strong) !important; }
.ryze-app .hover\:bg-emerald-700:hover { background-color: var(--primary-hover) !important; }
.ryze-app .hover\:bg-sage-100:hover { background-color: var(--surface) !important; }
.ryze-app .hover\:text-black:hover { color: var(--foreground) !important; }
.ryze-app .text-black { color: var(--foreground) !important; }
.ryze-app .text-blue-600 { color: var(--primary) !important; }
.ryze-app .text-emerald-600 { color: var(--primary) !important; }
.ryze-app .text-gray-600 { color: var(--muted-foreground) !important; }
.ryze-app .text-gray-700 { color: var(--foreground) !important; }
.ryze-app .text-gray-800 { color: var(--foreground) !important; }
.ryze-app .text-gray-900 { color: var(--foreground) !important; }
.ryze-app .text-ink { color: var(--foreground) !important; }
.ryze-app .text-mute { color: var(--muted-foreground) !important; }
.ryze-app .text-neutral-400 { color: var(--muted-foreground) !important; }
.ryze-app .text-neutral-500 { color: var(--muted-foreground) !important; }
.ryze-app .text-neutral-700 { color: var(--foreground) !important; }
.ryze-app .text-sage-900 { color: var(--foreground) !important; }
.ryze-app .text-yellow-600 { color: var(--primary) !important; }

.ryze-app .text-cream { color: var(--foreground) !important; }
.ryze-app .text-red-500, .ryze-app .text-red-600 { color: var(--error) !important; }
.ryze-app .bg-emerald-100 { background-color: var(--primary-tint) !important; }
.ryze-app .border-sand { border-color: var(--border) !important; }
.ryze-app .ring-cream { --tw-ring-color: var(--background); }
.ryze-app .grain { background-image: none; }
.ryze-app button[type=submit] { min-height: 48px; }
.ryze-app .bg-gradient-to-l { background-image: none; background-color: var(--surface); border-top: 3px solid var(--primary); }

/* Readable text on every shared dark surface. */
.ryze-app :is(.text-sage-900\/60, .text-black\/60, .text-ink\/60,
    .text-gray-500, .text-sage-500, .text-sage-700, .text-gray-300,
    .text-neutral-300) { color: var(--foreground) !important; }
.ryze-app :is(.text-emerald-500, .text-amber-700, .text-green-700,
    .text-orange-700, .text-purple-700, .text-teal-700,
    .text-blue-600, .text-emerald-600, .text-yellow-600) {
    color: var(--primary-text) !important;
}
.ryze-app :is(.bg-gray-50, .bg-amber-100) { background-color: var(--surface) !important; }
/* Filled accent controls need dark lettering rather than white. */
.ryze-app :is(.bg-black, .bg-emerald-600, .bg-gold-400, .bg-sage-700,
    [style*="background-color: var(--primary)"]) {
    color: var(--background) !important;
}
.ryze-app :is(.bg-black, .bg-emerald-600, .bg-gold-400, .bg-sage-700,
    [style*="background-color: var(--primary)"]) :is(span, p, div, svg) {
    color: inherit !important;
}
.ryze-app :is(.hero-description, .offer-price del, .join-note, .footer-brand) { opacity: 1; }
.ryze-app .benefit > span, .ryze-app .benefits .eyebrow { color: var(--primary-text); }
.ryze-app .gradient-bg, .ryze-app .bg-gradient-to-r {
    background: var(--surface);
    color: var(--foreground);
}
.ryze-app .story :is(p, li, blockquote, h2, h3, a) { color: var(--foreground); }

.ryze-app .text-white { color: var(--foreground) !important; }
.ryze-app :is(.bg-black, .bg-emerald-600, .bg-gold-400, .bg-sage-700,
    [style*="background-color: var(--primary)"]).text-white { color: var(--background) !important; }
