/* TrueKindred wave theme.
 *
 * Colours are sampled from the "Teal waves, golden insight" artwork and the heart-and-neuron logo.
 * This file loads after custom.css and holds every brand token, so a future palette change edits
 * this :root block only. Template inline styles reference these tokens with hex fallbacks via
 * scripts/apply_brand_palette.py.
 *
 * Contrast (WCAG 2.x): white on navy-900 16.1:1, seafoam-300 on navy-800 6.9:1, gold-400 on
 * navy-900 7.3:1, white on teal-600 4.7:1. White on teal-400 is 2.4:1, so teal-400 is reserved for
 * accents (icons, borders, focus rings) and never sits under white text.
 * Danger/crisis reds are deliberately NOT themed: safety signposting keeps Bootstrap's reds.
 */
:root {
    --tk-navy-950: #001832;
    --tk-navy-900: #01223f;
    --tk-navy-800: #0c2f43;
    --tk-navy-700: #064859;
    --tk-teal-400: #2db8b7;
    --tk-teal-600: #1c7f89;
    --tk-teal-700: #197380;
    --tk-seafoam-300: #94bfb8;
    --tk-seafoam-500: #4faa9a;
    --tk-gold-400: #cdaa6a;
    --tk-logo-navy: #0e2953;

    --tk-teal-400-rgb: 45, 184, 183;
    --tk-navy-700-rgb: 6, 72, 89;
    --tk-navy-900-rgb: 1, 34, 63;

    --tk-text: #ffffff;
    --tk-text-muted: #c2cbd0;
    --tk-ink: #01223f;
    --tk-slate: #4e6172;
    --tk-border: rgba(148, 191, 184, 0.22);
    --tk-surface: rgba(255, 255, 255, 0.06);
    --tk-surface-raised: rgba(255, 255, 255, 0.09);

    --tk-gradient-brand: linear-gradient(135deg, var(--tk-teal-600) 0%, var(--tk-navy-700) 100%);
    --tk-gradient-page: radial-gradient(1200px 600px at 12% -10%, rgba(var(--tk-teal-400-rgb), 0.10), transparent 60%),
                        linear-gradient(180deg, var(--tk-navy-900) 0%, var(--tk-navy-950) 100%);
    --tk-wave-image: url("/static/images/brand/wave-hero.webp?v=1");

    /* Legacy token names still used across templates and custom.css. */
    --primary-gradient: var(--tk-gradient-brand);
    --dark-gradient: linear-gradient(135deg, var(--tk-navy-800) 0%, var(--tk-navy-700) 100%);
    /* custom.css pairs these with dark text (#1a252f/#2c3e50); navy text stays above 6.6:1. */
    --success-gradient: linear-gradient(135deg, var(--tk-teal-400) 0%, var(--tk-seafoam-300) 100%);
    --warning-gradient: linear-gradient(135deg, var(--tk-seafoam-300) 0%, var(--tk-gold-400) 100%);
}

.bg-teal, .btn-teal { background: linear-gradient(135deg, var(--tk-teal-400) 0%, var(--tk-seafoam-300) 100%) !important; }

/* Page canvas: quiet navy. The wave artwork is reserved for the hero and auth pages. */
body {
    background: var(--tk-gradient-page) !important;
    background-color: var(--tk-navy-950) !important;
    background-attachment: fixed !important;
    color: var(--tk-text);
}

a { color: var(--tk-seafoam-300); }
a:hover { color: #ffffff; }
:focus-visible { outline: 2px solid var(--tk-teal-400) !important; outline-offset: 2px; }

/* Header */
.navbar {
    background: rgba(0, 24, 50, 0.92) !important;
    border-bottom: 1px solid var(--tk-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.tk-brand { gap: 0.6rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.tk-brand__mark { height: 40px; width: auto; }
.tk-brand__wordmark { height: 22px; width: auto; }
@media (max-width: 575.98px) {
    .tk-brand__mark { height: 34px; }
    .tk-brand__wordmark { height: 18px; }
}
.navbar .nav-link { color: rgba(255, 255, 255, 0.82) !important; }
.navbar .nav-link:hover, .navbar .nav-link:focus, .navbar .nav-link.active { color: #ffffff !important; }
.navbar .tk-nav-premium, .navbar .tk-nav-premium .fa-crown { color: var(--tk-gold-400) !important; }

/* Cards keep the existing glass structure, tinted toward navy rather than purple. */
.card {
    background: var(--tk-surface-raised) !important;
    border-color: var(--tk-border) !important;
    box-shadow: 0 8px 28px rgba(0, 12, 26, 0.45) !important;
}

/* Brand surfaces */
.bg-primary, .card-header.bg-primary, .jumbotron.bg-primary { background: var(--tk-gradient-brand) !important; }
.card-header.bg-info { background: linear-gradient(135deg, var(--tk-navy-700) 0%, var(--tk-teal-700) 100%) !important; }
/* Several templates put bg-primary/bg-info headers on cards without .text-white; the themed
   surfaces are dark, so their text must be white (4.7:1 or better). */
.card-header.bg-primary, .card-header.bg-info,
.card-header.bg-primary .card-title, .card-header.bg-info .card-title,
.card-header.bg-primary h5, .card-header.bg-info h5 { color: #ffffff !important; }
.text-primary { color: var(--tk-seafoam-300) !important; }
.border-primary { border-color: rgba(var(--tk-teal-400-rgb), 0.55) !important; }
.badge.bg-primary { background: var(--tk-teal-600) !important; }

/* Buttons */
.btn-primary {
    background: var(--tk-teal-600) !important;
    border-color: var(--tk-teal-600) !important;
    color: #ffffff !important;
    text-shadow: none;
    box-shadow: 0 4px 14px rgba(var(--tk-teal-400-rgb), 0.25);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--tk-teal-700) !important;
    border-color: var(--tk-teal-700) !important;
    box-shadow: 0 6px 20px rgba(var(--tk-teal-400-rgb), 0.35);
}
.btn-outline-primary { color: var(--tk-seafoam-300) !important; border-color: var(--tk-seafoam-300) !important; }
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--tk-teal-600) !important;
    border-color: var(--tk-teal-600) !important;
    color: #ffffff !important;
}
.btn-outline-info { color: var(--tk-seafoam-300) !important; border-color: var(--tk-seafoam-300) !important; }
.btn-warning { background: var(--tk-gold-400) !important; border-color: var(--tk-gold-400) !important; color: var(--tk-ink) !important; text-shadow: none; }
.btn-outline-warning { color: var(--tk-gold-400) !important; border-color: var(--tk-gold-400) !important; }
.btn-outline-warning:hover { background: var(--tk-gold-400) !important; color: var(--tk-ink) !important; }

/* Forms stay quiet: dark fields, clear labels, teal focus. */
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--tk-teal-400) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--tk-teal-400-rgb), 0.25) !important;
}
.form-check-input:checked { background-color: var(--tk-teal-600) !important; border-color: var(--tk-teal-600) !important; }
.nav-pills .nav-link.active, .nav-tabs .nav-link.active { background: var(--tk-teal-600) !important; color: #ffffff !important; border-color: var(--tk-teal-600) !important; }
.progress-bar { background-color: var(--tk-teal-600); }

/* Homepage hero: the one place the artwork is shown at full strength. The radial scrim keeps
   centred white text readable over the bright gold core of the image. */
.tk-hero-wave,
.jumbotron.tk-hero-wave {
    background:
        radial-gradient(ellipse 70% 85% at 50% 50%, rgba(var(--tk-navy-900-rgb), 0.80) 0%, rgba(var(--tk-navy-900-rgb), 0.45) 70%, rgba(var(--tk-navy-900-rgb), 0.25) 100%),
        var(--tk-wave-image) center 55% / cover no-repeat,
        var(--tk-navy-900) !important;
    border: 1px solid var(--tk-border);
    box-shadow: 0 18px 50px rgba(0, 12, 26, 0.55);
}
.tk-hero-wave .tk-hero-mark { height: 96px; width: auto; }
@media (max-width: 575.98px) {
    .tk-hero-wave .tk-hero-mark { height: 72px; }
}

/* Footer: a low-key echo of the artwork. */
footer.bg-dark {
    background:
        linear-gradient(180deg, rgba(var(--tk-navy-900-rgb), 0.96) 0%, rgba(0, 24, 50, 0.90) 100%),
        var(--tk-wave-image) center 70% / cover no-repeat !important;
    border-top: 1px solid var(--tk-border);
}
