/* =========================================================
   SEFTON GLOBAL DARK / LIGHT MODE v66
   Public homepage + client portal + transaction tracker
   ========================================================= */

:root{
    --sf-bg:#f4f6f7;
    --sf-surface:#ffffff;
    --sf-surface-2:#f8fafa;
    --sf-text:#15313d;
    --sf-muted:#718188;
    --sf-border:#dfe5e7;
    --sf-red:#9f1720;
    --sf-red-2:#b51d27;
    --sf-gold:#d5b153;
    --sf-shadow:0 10px 28px rgba(15,40,52,.06);
}

html[data-theme="dark"]{
    --sf-bg:#07131a;
    --sf-surface:#0d1d25;
    --sf-surface-2:#112630;
    --sf-text:#eef5f7;
    --sf-muted:#a9bac1;
    --sf-border:#263b45;
    --sf-red:#c92a34;
    --sf-red-2:#e03a44;
    --sf-gold:#e0bd61;
    --sf-shadow:0 16px 34px rgba(0,0,0,.25);
}

html,
body{
    transition:
        background-color .22s ease,
        color .22s ease;
}

html[data-theme="dark"] body{
    background:var(--sf-bg) !important;
    color:var(--sf-text) !important;
}

/* ---------------------------------------------------------
   Global surfaces
   --------------------------------------------------------- */

html[data-theme="dark"] main,
html[data-theme="dark"] .page,
html[data-theme="dark"] .portal-main,
html[data-theme="dark"] .content,
html[data-theme="dark"] .dashboard-content,
html[data-theme="dark"] .section,
html[data-theme="dark"] .tt58-page,
html[data-theme="dark"] .tt58-hero,
html[data-theme="dark"] .tt58-updates{
    background:var(--sf-bg) !important;
    color:var(--sf-text) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .box,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .experience-card,
html[data-theme="dark"] .account-strip,
html[data-theme="dark"] .premium-account-strip,
html[data-theme="dark"] .confidence-ribbon article,
html[data-theme="dark"] .home-proof-strip article,
html[data-theme="dark"] .tt58-card,
html[data-theme="dark"] .tt58-update,
html[data-theme="dark"] .tt62-activity-table tbody tr,
html[data-theme="dark"] .tt62-tracker-card,
html[data-theme="dark"] .tr50-panel,
html[data-theme="dark"] .tf-panel{
    background:var(--sf-surface) !important;
    border-color:var(--sf-border) !important;
    color:var(--sf-text) !important;
    box-shadow:var(--sf-shadow) !important;
}

/* ---------------------------------------------------------
   Text
   --------------------------------------------------------- */

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong,
html[data-theme="dark"] b,
html[data-theme="dark"] label,
html[data-theme="dark"] .tt58-brand strong,
html[data-theme="dark"] .tt58-amount,
html[data-theme="dark"] .tt58-update strong,
html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(2){
    color:var(--sf-text) !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .description,
html[data-theme="dark"] .tt58-brand small,
html[data-theme="dark"] .tt58-card p,
html[data-theme="dark"] .tt58-update p,
html[data-theme="dark"] .tt58-section-title small,
html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(1),
html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(3),
html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(5){
    color:var(--sf-muted) !important;
}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
    background:#0a1b23 !important;
    color:var(--sf-text) !important;
    border-color:#304751 !important;
    caret-color:#fff;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{
    color:#70838c !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus{
    border-color:#b62b34 !important;
    box-shadow:0 0 0 4px rgba(201,42,52,.10) !important;
}

/* ---------------------------------------------------------
   Tables / rows
   --------------------------------------------------------- */

html[data-theme="dark"] table{
    color:var(--sf-text) !important;
}

html[data-theme="dark"] thead,
html[data-theme="dark"] th{
    background:#10242d !important;
    color:#dce7ea !important;
}

html[data-theme="dark"] td{
    border-color:#263b45 !important;
}

html[data-theme="dark"] tr{
    border-color:#263b45 !important;
}

/* ---------------------------------------------------------
   Header / portal shell / sidebar
   --------------------------------------------------------- */

html[data-theme="dark"] header,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .portal-header,
html[data-theme="dark"] .ref-header,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .portal-sidebar,
html[data-theme="dark"] aside{
    background:#0b1b23 !important;
    border-color:#253943 !important;
    color:var(--sf-text) !important;
}

html[data-theme="dark"] .sidebar a,
html[data-theme="dark"] .portal-sidebar a,
html[data-theme="dark"] aside a{
    color:#dbe6e9 !important;
}

html[data-theme="dark"] .sidebar a:hover,
html[data-theme="dark"] .portal-sidebar a:hover,
html[data-theme="dark"] aside a:hover{
    background:#142832 !important;
}

html[data-theme="dark"] .sidebar .active,
html[data-theme="dark"] .portal-sidebar .active{
    background:#2b1115 !important;
    color:#fff !important;
}

/* ---------------------------------------------------------
   Portal mobile bottom nav
   --------------------------------------------------------- */

html[data-theme="dark"] .mobile-bottom-nav,
html[data-theme="dark"] .portal-bottom-nav,
html[data-theme="dark"] .bottom-nav{
    background:#0a1a22 !important;
    border-color:#263a44 !important;
    color:#c8d6db !important;
}

html[data-theme="dark"] .mobile-bottom-nav a,
html[data-theme="dark"] .portal-bottom-nav a,
html[data-theme="dark"] .bottom-nav a{
    color:#b7c8cf !important;
}

html[data-theme="dark"] .mobile-bottom-nav .active,
html[data-theme="dark"] .portal-bottom-nav .active,
html[data-theme="dark"] .bottom-nav .active{
    color:#fff !important;
}

/* ---------------------------------------------------------
   Tracker specific
   --------------------------------------------------------- */

html[data-theme="dark"] .tt58-card{
    background:
        radial-gradient(circle at 100% 0%,rgba(181,29,39,.08),transparent 35%),
        #0c1d25 !important;
}

html[data-theme="dark"] .tt58-card h2{
    color:#e04149 !important;
}

html[data-theme="dark"] .tt58-card p strong,
html[data-theme="dark"] .tt58-prog-head b{
    color:#e0bd61 !important;
}

html[data-theme="dark"] .tt58-progress{
    background:#20333b !important;
}

html[data-theme="dark"] .tt58-note{
    background:#10242d !important;
    border-color:#2a414b !important;
    color:#b7c7cd !important;
}

html[data-theme="dark"] .tt58-update{
    background:#0d1d25 !important;
}

html[data-theme="dark"] .tt64-step-dots span{
    background:#152a33 !important;
    border-color:#2a404a !important;
    color:#82959d !important;
}

html[data-theme="dark"] .tt64-step-dots span.done{
    background:linear-gradient(90deg,#a91821,#d5af4c) !important;
    color:#fff !important;
}

/* ---------------------------------------------------------
   Activity tracker specific
   --------------------------------------------------------- */

html[data-theme="dark"] .tt62-tracker-card{
    background:#10242d !important;
}

html[data-theme="dark"] .tt62-tracker-top strong{
    color:#edf4f6 !important;
}

html[data-theme="dark"] .tt62-tracker-bar{
    background:#253a43 !important;
}

/* ---------------------------------------------------------
   Homepage dark mode
   --------------------------------------------------------- */

html[data-theme="dark"] .classic-services,
html[data-theme="dark"] .classic-insights,
html[data-theme="dark"] .classic-vision,
html[data-theme="dark"] .home-banking-experience{
    background:#07131a !important;
}

html[data-theme="dark"] .service-card,
html[data-theme="dark"] .experience-card{
    background:#0d1f28 !important;
    border-color:#2a404a !important;
}

html[data-theme="dark"] .service-card p,
html[data-theme="dark"] .experience-card p{
    color:#aabac0 !important;
}

/* ---------------------------------------------------------
   Floating theme toggle
   --------------------------------------------------------- */

.sefton-theme-toggle{
    position:fixed;
    right:18px;
    bottom:20px;
    z-index:45000;
    width:50px;
    height:50px;
    border:1px solid rgba(132,153,162,.30);
    border-radius:50%;
    display:grid;
    place-items:center;
    background:#fff;
    color:#7f131a;
    box-shadow:0 12px 32px rgba(15,40,52,.18);
    cursor:pointer;
    transition:
        transform .18s ease,
        background-color .22s ease,
        color .22s ease;
}

.sefton-theme-toggle:hover{
    transform:translateY(-2px);
}

.sefton-theme-toggle svg{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}

html[data-theme="dark"] .sefton-theme-toggle{
    background:#132832;
    border-color:#344a54;
    color:#e6c565;
    box-shadow:0 14px 34px rgba(0,0,0,.30);
}

.sefton-theme-toggle .theme-sun{
    display:none;
}

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

html[data-theme="dark"] .sefton-theme-toggle .theme-sun{
    display:block;
}

@media(max-width:850px){
    .sefton-theme-toggle{
        width:46px;
        height:46px;
        right:14px;
        bottom:92px;
    }

    .sefton-theme-toggle svg{
        width:20px;
        height:20px;
    }
}

@media(prefers-reduced-motion:reduce){
    html,
    body,
    .sefton-theme-toggle{
        transition:none !important;
    }
}
