/*
 * Dark site theme (owner, 18 Nov 2026: «остальные лендинги подтяни под этот
 * стиль»). The homepage, /products and /apps are written dark (pd-styles);
 * ~250 other templates were written light, with tokens, Tailwind utilities and
 * inline colours. This file turns them dark in one place instead of editing
 * each template:
 *   1. the colour tokens are redefined to the pd palette;
 *   2. the light Tailwind utilities the templates use are mapped onto it;
 *   3. inline white backgrounds and dark-grey text are caught by attribute.
 * Linked from base.html.twig after page_css, so it wins. Turn it off by
 * removing that one <link>. Pages built dark (.pd) are left alone.
 */

:root {
    --dk-bg:     #0c0d10;
    --dk-card:   #14161b;
    --dk-card-2: #1a1c22;
    --dk-line:   #24262d;
    --dk-line-2: #33363e;
    --dk-text:   #c9cad0;
    --dk-strong: #f4f4f2;
    --dk-muted:  #9a9ca4;
    --dk-faint:  #8b8d95;
    --dk-amber:  #f59e0b;
    --dk-amber-soft: #fcd34d;

    --color-text-strong:    var(--dk-strong);
    --color-text:           var(--dk-text);
    --color-text-secondary: var(--dk-text);
    --color-text-muted:     var(--dk-muted);
    --color-text-faint:     var(--dk-faint);
    --color-text-placeholder: #6f717a;

    --color-surface:       var(--dk-card);
    --color-surface-alt:   #111317;
    --color-surface-warm:  #111317;
    --color-surface-hover: var(--dk-card-2);
    --color-border:        var(--dk-line);
    --color-border-strong: var(--dk-line-2);
    --color-border-hover:  var(--dk-line-2);
    --color-divider:       var(--dk-line);

    --color-brand:        var(--dk-amber);
    --color-brand-hover:  var(--dk-amber-soft);
    --color-brand-ink:    #1a1405;
    --color-brand-text:   var(--dk-amber-soft);
    --color-brand-bg:     rgba(245,158,11,.12);
    --color-brand-border: rgba(245,158,11,.35);
    --color-brand-light:  var(--dk-amber-soft);

    --color-success:        #4ade80;
    --color-success-bg:     rgba(74,222,128,.10);
    --color-success-border: rgba(74,222,128,.30);
    --color-warning:        #fbbf24;
    --color-warning-bg:     rgba(251,191,36,.10);
    --color-warning-border: rgba(251,191,36,.30);
    --color-error:          #f87171;
    --color-error-bg:       rgba(248,113,113,.10);
    --color-error-border:   rgba(248,113,113,.30);
    --color-info:           #60a5fa;
    --color-info-bg:        rgba(96,165,250,.10);
    --color-info-border:    rgba(96,165,250,.30);

    --shadow-raised: none;
    --shadow-float:  0 2px 10px rgba(0,0,0,.4);
    color-scheme: dark;
}

html, body { background: var(--dk-bg) !important; color: var(--dk-text); }

/* ── Tailwind surfaces ── */
.bg-white, .bg-gray-50, .bg-slate-50, .bg-zinc-50, .bg-neutral-50, .bg-stone-50 { background-color: transparent !important; }
:is(.rounded, .rounded-lg, .rounded-xl, .rounded-2xl, .card, .shadow, .shadow-sm, .border):is(.bg-white, .bg-gray-50, .bg-slate-50) { background-color: var(--dk-card) !important; }
.bg-gray-100, .bg-slate-100, .bg-gray-200, .bg-slate-200 { background-color: var(--dk-card-2) !important; }
.bg-amber-50, .bg-yellow-50, .bg-orange-50 { background-color: rgba(245,158,11,.10) !important; }
.bg-green-50, .bg-emerald-50 { background-color: rgba(74,222,128,.10) !important; }
.bg-blue-50, .bg-indigo-50, .bg-sky-50 { background-color: rgba(96,165,250,.10) !important; }
.bg-red-50, .bg-rose-50 { background-color: rgba(248,113,113,.10) !important; }
.bg-purple-50, .bg-violet-50 { background-color: rgba(167,139,250,.10) !important; }

/* ── Tailwind text ── */
:is(.text-slate-900, .text-gray-900, .text-slate-800, .text-gray-800, .text-black, .text-zinc-900, .text-neutral-900) { color: var(--dk-strong) !important; }
:is(.text-slate-700, .text-gray-700, .text-slate-600, .text-gray-600) { color: var(--dk-text) !important; }
:is(.text-slate-500, .text-gray-500, .text-slate-400, .text-gray-400) { color: var(--dk-faint) !important; }
.text-amber-700, .text-amber-800, .text-orange-700 { color: var(--dk-amber-soft) !important; }
.text-green-700, .text-green-800, .text-emerald-700 { color: #4ade80 !important; }
.text-blue-700, .text-blue-600 { color: #60a5fa !important; }

/* ── Tailwind borders ── */
:is(.border-slate-100, .border-slate-200, .border-slate-300, .border-gray-100, .border-gray-200, .border-gray-300) { border-color: var(--dk-line) !important; }
.divide-slate-200 > * + *, .divide-gray-200 > * + * { border-color: var(--dk-line) !important; }

/* ── Inline colours written into templates ── */
section[style*="background:#fff"], section[style*="background: #fff"], section[style*="background:#ffffff"],
section[style*="background:white"], section[style*="background-color:#fff"], section[style*="background: white"] { background: transparent !important; }
:not(section)[style*="background:#fff"], :not(section)[style*="background: #fff"], :not(section)[style*="background:#ffffff"],
:not(section)[style*="background:white"], :not(section)[style*="background-color:#fff"], :not(section)[style*="background: white"],
[style*="background:#f8f9fb"], [style*="background:#f9fafb"], [style*="background:#f8fafc"], [style*="background:#f0f0f0"] { background: var(--dk-card) !important; }
[style*="background:#f0fdf4"], [style*="background:#dcfce7"], [style*="background:#ecfdf5"] { background: rgba(74,222,128,.10) !important; }
[style*="background:#fff5f5"], [style*="background:#fef2f2"], [style*="background:#fee2e2"] { background: rgba(248,113,113,.10) !important; }
[style*="background:#dbeafe"], [style*="background:#eff6ff"], [style*="background:#eef2ff"] { background: rgba(96,165,250,.10) !important; }
[style*="color:#0f172a"], [style*="color:#111827"], [style*="color:#1f2937"], [style*="color: #0f172a"], [style*="color: #111827"],
[style*="color:#1a1a1a"], [style*="color: #1a1a1a"], [style*="color:#333"], [style*="color: #333"] { color: var(--dk-strong) !important; }
[style*="color:#555"], [style*="color:#666"] { color: var(--dk-muted) !important; }
[style*="color:#334155"], [style*="color:#374151"], [style*="color:#4b5563"], [style*="color:#475569"], [style*="color: #374151"], [style*="color: #4b5563"] { color: var(--dk-text) !important; }
[style*="color:#64748b"], [style*="color:#6b7280"], [style*="color:#94a3b8"], [style*="color:#9ca3af"] { color: var(--dk-faint) !important; }
[style*="solid #eee"], [style*="solid #eef1f4"], [style*="solid #ccc"],
[style*="border:1px solid #e5e7eb"], [style*="border:1px solid #e2e8f0"], [style*="border-color:#e5e7eb"], [style*="border:1px solid #eee"] { border-color: var(--dk-line) !important; }
/* the dark band keeps its own colours */
.band-ink, [style*="background:#152b1f"], [style*="background:#111827"], [style*="background: #111827"] { background-color: #08090b !important; }

/* ── Headings and copy without a class ── */
h1, h2, h3, h4 { color: var(--dk-strong); }
.prose, .prose p, .prose li { color: var(--dk-text); }
.prose :is(h1,h2,h3,h4,strong,b) { color: var(--dk-strong); }
.prose a { color: var(--dk-amber-soft); }
.prose code { background: var(--dk-card-2); color: var(--dk-strong); }
.prose blockquote { border-color: var(--dk-line-2); color: var(--dk-muted); }
.prose hr { border-color: var(--dk-line); }

/* ── Tables and forms ── */
table, th, td { border-color: var(--dk-line) !important; }
thead, th { background-color: var(--dk-card-2); color: var(--dk-strong); }
tr:nth-child(even) td { background-color: rgba(255,255,255,.015); }
input, textarea, select { background-color: var(--dk-card) !important; color: var(--dk-strong) !important; border-color: var(--dk-line-2) !important; }
input::placeholder, textarea::placeholder { color: #6f717a !important; }
details { border-color: var(--dk-line); }
pre { background: #08090b; color: var(--dk-text); }
hr { border-color: var(--dk-line); }

/* ── Screenshots on dark: a hairline so white images don't bleed ── */
img[src*="/img/screen/"] { border-radius: 10px; }

/* ── FR/ES header: translucent white written inline ── */
header[style*="background:rgba(255,255,255"] { background: rgba(12,13,16,.85) !important; border-color: var(--dk-line) !important; }
