/* =========================================================
   YOUR WEALTH ASCENT
   Global Theme / Design System
   ========================================================= */

/* ---------------------------------------------------------
   Theme Variables
   --------------------------------------------------------- */

:root {
    --bg-dark: #0a0a0a;
    --gold: #c5a059;
    --gold-hover: #b08d48;
    --card-bg: #141414;
    --border: #222222;
    --gray: #999999;
}


/* ---------------------------------------------------------
   Global Base Styles
   --------------------------------------------------------- */

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: #fff;
}


/* ---------------------------------------------------------
   Shared Theme Utilities
   --------------------------------------------------------- */

.bg-gold {
    background-color: var(--gold);
}

.bg-gold:hover {
    background-color: var(--gold-hover);
}

.text-gold {
    color: var(--gold);
}

.bg-card {
    background-color: var(--card-bg);
}

.border-theme {
    border-color: var(--border);
}

.text-muted {
    color: var(--gray);
}

/* =========================================================
   PROTECTED PAGE AUTH GATE
   Prevent protected content from flashing before auth check
   ========================================================= */

/* Keep the page width stable when switching between client-plan tabs
   whose content heights differ enough to add/remove the vertical scrollbar. */
html {
    scrollbar-gutter: stable;
}

body.portal-auth-pending {
    overflow: hidden;
}

body.portal-auth-pending > * {
    visibility: hidden;
}

/* =========================================================
   PROTECTED PAGE LOADING SCREEN
   Keeps protected content hidden while showing a safe
   loading state during authentication / legal verification.
   ========================================================= */

body.portal-auth-pending > #portal-loading-screen {
    visibility: visible;
}

body:not(.portal-auth-pending) > #portal-loading-screen {
    display: none;
}

/* =========================================================
   CLIENT TOP-LEVEL VIEW NAVIGATION
   Canonical styling shared by Dashboard, Financial Profile,
   Financial Plan, Reports & Progress, and Account Profile.
   The Account Profile tab treatment is the visual baseline.
   ========================================================= */

.client-view-tabs {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.375rem;
    gap: 0.25rem;
}

.client-view-tab {
    border: 1px solid transparent;
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: #fff;
    text-align: center;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.client-view-tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.client-view-tab[aria-selected="true"] {
    border-color: rgba(197, 160, 89, 0.30);
    background-color: rgba(197, 160, 89, 0.10);
    color: var(--gold);
}

.client-view-tab[aria-selected="true"]:hover {
    background-color: rgba(197, 160, 89, 0.10);
}

.client-view-tab--locked {
    color: var(--gray);
}

.client-view-tab-title {
    display: block;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.client-view-tab-caption {
    display: none;
    margin-top: 0.125rem;
    color: var(--gray);
    font-size: 0.625rem;
    line-height: 0.875rem;
}

@media (min-width: 640px) {
    .client-view-tab-caption {
        display: block;
    }
}

/* Six Financial Profile tabs are intentionally denser. Keep their
   captions hidden until desktop width while preserving the same tab
   shape, selection treatment, and separation. */
@media (min-width: 640px) and (max-width: 1023px) {
    #profile-view-tabs .client-view-tab-caption {
        display: none;
    }
}

/* =========================================================
   ADMIN TOP-LEVEL VIEW NAVIGATION
   Mirrors the Account Profile reference treatment. These
   explicit state selectors keep the visual contract tied to
   aria-selected rather than runtime utility generation.
   ========================================================= */

#admin-view-tabs [data-admin-view-tab] {
    border: 1px solid transparent;
    color: #fff;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#admin-view-tabs [data-admin-view-tab]:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#admin-view-tabs [data-admin-view-tab][aria-selected="true"] {
    border-color: rgba(197, 160, 89, 0.30);
    background-color: rgba(197, 160, 89, 0.10);
    color: var(--gold);
}

#admin-view-tabs [data-admin-view-tab][aria-selected="true"]:hover {
    background-color: rgba(197, 160, 89, 0.10);
}


/* =========================================================
   ADMIN SELECTED-CLIENT NAVIGATION
   Uses the same canonical selected-state language as the
   client-facing Account Profile navigation.
   ========================================================= */

#admin-client-view-tabs [data-admin-client-view-tab] {
    border: 1px solid transparent;
    color: #fff;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#admin-client-view-tabs [data-admin-client-view-tab]:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#admin-client-view-tabs [data-admin-client-view-tab][aria-selected="true"] {
    border-color: rgba(197, 160, 89, 0.30);
    background-color: rgba(197, 160, 89, 0.10);
    color: var(--gold);
}

#admin-client-view-tabs [data-admin-client-view-tab][aria-selected="true"]:hover {
    background-color: rgba(197, 160, 89, 0.10);
}


/* =========================================================
   ADMIN FINANCIAL DETAIL NAVIGATION
   Secondary navigation inside the selected-client Financials
   workspace. Uses the same gold selected-state language while
   remaining subordinate to the main Admin and client tabs.
   ========================================================= */

#admin-financial-view-tabs [data-admin-financial-view-tab] {
    border: 1px solid transparent;
    color: #fff;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#admin-financial-view-tabs [data-admin-financial-view-tab]:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#admin-financial-view-tabs [data-admin-financial-view-tab][aria-selected="true"] {
    border-color: rgba(197, 160, 89, 0.30);
    background-color: rgba(197, 160, 89, 0.10);
    color: var(--gold);
}

#admin-financial-view-tabs [data-admin-financial-view-tab][aria-selected="true"]:hover {
    background-color: rgba(197, 160, 89, 0.10);
}


/* =========================================================
   ADMIN ACTION QUEUE FILTER NAVIGATION
   Keeps queue filters visually aligned with the portal's
   canonical gold selected-state language.
   ========================================================= */

#advisor-dashboard-filters [data-advisor-filter] {
    border: 1px solid transparent;
    color: #fff;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#advisor-dashboard-filters [data-advisor-filter]:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#advisor-dashboard-filters [data-advisor-filter][aria-selected="true"] {
    border-color: rgba(197, 160, 89, 0.30);
    background-color: rgba(197, 160, 89, 0.10);
    color: var(--gold);
}

#advisor-dashboard-filters [data-advisor-filter][aria-selected="true"]:hover {
    background-color: rgba(197, 160, 89, 0.10);
}

/* ADMIN PLAN MANAGEMENT FILTER NAVIGATION */
#admin-plan-filters [data-admin-plan-filter]{border:1px solid transparent;color:#fff;transition:background-color 150ms ease,border-color 150ms ease,color 150ms ease;}
#admin-plan-filters [data-admin-plan-filter]:hover{background-color:rgba(255,255,255,.05);}
#admin-plan-filters [data-admin-plan-filter][aria-selected="true"]{border-color:rgba(197,160,89,.30);background-color:rgba(197,160,89,.10);color:var(--gold);}

/* v3.1.13 — Plan form validation guidance */
.ywa-validation-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28), 0 0 0 4px rgba(197, 160, 89, 0.12);
}

.ywa-validation-flash {
    animation: ywa-validation-flash 0.7s ease-in-out 2;
}

@keyframes ywa-validation-flash {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28), 0 0 0 4px rgba(197, 160, 89, 0.12);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.72), 0 0 0 7px rgba(197, 160, 89, 0.24);
    }
}
