/* =====================================================================
   public-theme.css — light/dark theme for the PUBLIC landing pages ONLY.
   The app in /secure keeps its own AdminUIUX theme; this file is never
   loaded there and never loads AdminUIUX assets.

   The public pages are a Tailwind build with hardcoded dark colours, so
   this file (a) defines the palette variables used by includes/head.php
   and the MedBed section of index.php, and (b) remaps the Tailwind grey
   utilities when data-bs-theme="light".
   ===================================================================== */

:root,
html[data-bs-theme="dark"] {
    --pub-bg: #111827;
    --pub-bg-alt: #1f2937;
    --pub-surface: rgba(55, 65, 81, 0.8);
    --pub-surface-strong: rgba(55, 65, 81, 0.95);
    --pub-surface-solid: #1f2937;
    --pub-text: #ffffff;
    --pub-muted: #d1d5db;
    --pub-muted-2: #9ca3af;
    --pub-border: rgba(75, 85, 99, 0.3);
    --pub-border-strong: rgba(75, 85, 99, 0.5);
    --pub-input-bg: rgba(55, 65, 81, 0.8);
    --pub-input-border: #374151;
    --pub-deep: #0a0f1c;
    --pub-deep-surface: rgba(17, 24, 39, 0.78);
    --pub-accent: #8b5cf6;
}

html[data-bs-theme="light"] {
    --pub-bg: #f5f7fb;
    --pub-bg-alt: #ffffff;
    --pub-surface: #ffffff;
    --pub-surface-strong: #ffffff;
    --pub-surface-solid: #ffffff;
    --pub-text: #0f172a;
    --pub-muted: #475569;
    --pub-muted-2: #64748b;
    --pub-border: #e2e8f0;
    --pub-border-strong: #cbd5e1;
    --pub-input-bg: #ffffff;
    --pub-input-border: #cbd5e1;
    --pub-deep: #eef2ff;
    --pub-deep-surface: #ffffff;
    --pub-accent: #6d28d9;
}

/* ---------- header toggle (used by index.php and includes/head.php) ---------- */
.pub-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--pub-border-strong);
    background: var(--pub-surface);
    color: var(--pub-text);
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.pub-theme-toggle:hover {
    color: var(--pub-accent);
    border-color: var(--pub-accent);
}

.pub-theme-toggle svg {
    width: 18px;
    height: 18px;
}

html[data-bs-theme="dark"] .pub-theme-toggle .pub-icon-moon {
    display: none;
}

html[data-bs-theme="light"] .pub-theme-toggle .pub-icon-sun {
    display: none;
}

/* ---------- light mode: remap the Tailwind greys ---------- */
html[data-bs-theme="light"] .bg-gray-900,
html[data-bs-theme="light"] .bg-gray-900\/50 {
    background-color: var(--pub-bg);
    color: var(--pub-text);
}

html[data-bs-theme="light"] .bg-gray-800,
html[data-bs-theme="light"] .bg-gray-800\/90 {
    background-color: var(--pub-surface-solid);
    color: var(--pub-text);
}

html[data-bs-theme="light"] .bg-gray-700,
html[data-bs-theme="light"] .hover\:bg-gray-700:hover {
    background-color: #eef2f7;
}

html[data-bs-theme="light"] .hover\:bg-gray-600:hover {
    background-color: #e2e8f0;
}

html[data-bs-theme="light"] .text-white {
    color: var(--pub-text);
}

/* keep white text on coloured buttons, gradients, badges and dark overlays */
html[data-bs-theme="light"] .text-white:is(
        [class*="bg-gradient"],
        [class*="bg-black"],
        [class*="bg-primary"],
        [class*="bg-secondary"],
        [class*="bg-accent"],
        [class*="bg-red"],
        [class*="bg-green"],
        [class*="bg-blue"],
        [class*="bg-purple"]
    ) {
    color: #ffffff;
}

/* white icons inside the small dark step circles */
html[data-bs-theme="light"] .bg-gray-600 .text-white {
    color: #ffffff;
}

html[data-bs-theme="light"] .text-gray-100,
html[data-bs-theme="light"] .text-gray-200,
html[data-bs-theme="light"] .text-gray-300 {
    color: var(--pub-muted);
}

html[data-bs-theme="light"] .text-gray-400,
html[data-bs-theme="light"] .text-gray-500 {
    color: var(--pub-muted-2);
}

html[data-bs-theme="light"] .border-gray-600,
html[data-bs-theme="light"] .border-gray-700,
html[data-bs-theme="light"] .border-gray-700\/30 {
    border-color: var(--pub-border);
}

html[data-bs-theme="light"] .hover\:border-secondary-500:hover {
    border-color: #7c3aed;
}

/* the brand colours need a darker tone on a white page */
html[data-bs-theme="light"] .text-secondary-400 {
    color: #6d28d9;
}

html[data-bs-theme="light"] .text-primary-400 {
    color: #0e7490;
}

html[data-bs-theme="light"] .text-primary-500 {
    color: #0e7490;
}

html[data-bs-theme="light"] .text-secondary-500 {
    color: #6d28d9;
}

html[data-bs-theme="light"] .text-accent-400,
html[data-bs-theme="light"] .text-accent-500 {
    color: #047857;
}

html[data-bs-theme="light"] .hover\:text-secondary-500:hover {
    color: #6d28d9;
}

html[data-bs-theme="light"] .hover\:text-primary-400:hover {
    color: #0e7490;
}

/* ---------- shared wallet pages (includes/head.php) ---------- */
html[data-bs-theme="light"] .description,
html[data-bs-theme="light"] .wallet-card,
html[data-bs-theme="light"] .wallet-container {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* the wallet-page heading uses a bright gradient that disappears on white */
html[data-bs-theme="light"] .wallets-section h2 {
    background-image: linear-gradient(135deg, #0e7490, #6d28d9);
}

html[data-bs-theme="light"] .gradient-text {
    background-image: linear-gradient(135deg, #6d28d9, #047857, #1d4ed8);
}

/* the search box and "Choose wallet" label use inline dark colours */
html[data-bs-theme="light"] .wallets-section input[type="text"] {
    background: var(--pub-input-bg) !important;
    color: var(--pub-text) !important;
    border-color: var(--pub-input-border) !important;
}

html[data-bs-theme="light"] .wallets-section input[type="text"]:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12) !important;
}

html[data-bs-theme="light"] .wallets-section input[type="text"]::placeholder {
    color: var(--pub-muted-2);
}

html[data-bs-theme="light"] .wallets-section .wallet-label {
    color: var(--pub-text) !important;
}

/* the hero collage has white labels baked into the PNG; a soft edge keeps
   them readable on a white page without tinting the wallet logos */
html[data-bs-theme="light"] img[src*="Web3-removebg-preview"] {
    filter: drop-shadow(0 0 1.5px rgba(15, 23, 42, 0.9)) drop-shadow(0 1px 2px rgba(15, 23, 42, 0.75));
}

/* ---------- index.php MedBed section ---------- */
html[data-bs-theme="light"] .mb-glow {
    opacity: 0.18;
}

html[data-bs-theme="light"] .mb-badge {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.35);
    background: rgba(109, 40, 217, 0.08);
}

html[data-bs-theme="light"] .mb-strip a {
    color: #6d28d9;
}

html[data-bs-theme="light"] .mb-btn.ghost {
    border-color: rgba(15, 23, 42, 0.25);
    color: var(--pub-text);
}

html[data-bs-theme="light"] .mb-btn.ghost:hover {
    border-color: #6d28d9;
    color: #6d28d9;
}

html[data-bs-theme="light"] .mb-card,
html[data-bs-theme="light"] .mb-prod {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

html[data-bs-theme="light"] .mb-prod span {
    color: #15803d;
}
