/* =====================================================================
   NCIA Client Portal — premium UI system
   Built on the brand tokens in css/style.css (--ncia-red, --ncia-navy, …),
   which loads before this file. Every class hook the PHP pages use is kept;
   this file only restyles them.
   ===================================================================== */

:root {
    --p-navy: var(--ncia-navy, #0B1F33);
    --p-navy-2: #12324F;
    --p-navy-deep: #081726;
    --p-red: var(--ncia-red, #E1251B);
    --p-red-dark: var(--ncia-red-dark, #A61B14);
    --p-ink: #1c2733;
    --p-muted: #6E747A;
    --p-line: rgba(11, 31, 51, 0.10);
    --p-surface: #ffffff;
    --p-bg: #eef1f5;
    --p-radius: 18px;
    --p-radius-sm: 12px;
    --p-radius-lg: 26px;
    --p-shadow-sm: 0 2px 8px rgba(11, 31, 51, 0.06);
    --p-shadow: 0 18px 44px rgba(11, 31, 51, 0.10);
    --p-shadow-lg: 0 30px 70px rgba(11, 31, 51, 0.18);
    --p-ring: 0 0 0 0.22rem rgba(225, 37, 27, 0.18);
}

* { box-sizing: border-box; }

body.portal-page {
    background:
        radial-gradient(1100px 540px at 88% -8%, rgba(225, 37, 27, 0.07), transparent 60%),
        radial-gradient(900px 520px at -6% 6%, rgba(11, 31, 51, 0.08), transparent 55%),
        var(--p-bg);
    color: var(--p-ink);
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ============================ TOP BAR ============================ */
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(100deg, var(--p-navy-deep), var(--p-navy) 55%, var(--p-navy-2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(8, 23, 38, 0.28);
}

.portal-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 68px;
}

.portal-brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }

.portal-brand__logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.portal-brand__label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding-left: 0.85rem;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.portal-topbar__actions { display: flex; align-items: center; gap: 0.85rem; }

.portal-topbar__link {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
.portal-topbar__link:hover { color: #fff; }

/* User chip (avatar + name) */
.portal-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.85rem 0.3rem 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.portal-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--p-red), var(--p-red-dark));
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 16px rgba(225, 37, 27, 0.4);
}

.portal-user-chip__name {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-topbar .btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.5rem 1.05rem;
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--p-red), var(--p-red-dark));
    border: none;
    box-shadow: 0 10px 22px rgba(225, 37, 27, 0.32);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.portal-topbar .btn-logout:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 14px 28px rgba(225, 37, 27, 0.4); }

/* ============================ SHELL ============================ */
.portal-main { flex: 1 0 auto; padding: 2.25rem 0 4.5rem; }

.portal-flash {
    border: none;
    border-radius: var(--p-radius-sm);
    box-shadow: var(--p-shadow-sm);
    padding: 0.9rem 1.15rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border-left: 4px solid currentColor;
    animation: portalFade 0.5s ease both;
}

.portal-footer {
    flex-shrink: 0;
    background: linear-gradient(100deg, var(--p-navy-deep), var(--p-navy));
    color: rgba(255, 255, 255, 0.66);
    padding: 1.4rem 0;
}
.portal-footer__inner { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; text-align: center; font-size: 0.85rem; }
.portal-footer__sep { opacity: 0.45; }

/* ===================== DASHBOARD HEADER (account) ===================== */
.portal-account,
.portal-dash {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 1.6rem 1.75rem;
    margin-bottom: 1.9rem;
    border-radius: var(--p-radius-lg);
    color: #fff;
    background: linear-gradient(120deg, var(--p-navy-deep), var(--p-navy) 48%, var(--p-navy-2));
    box-shadow: var(--p-shadow);
    animation: portalRise 0.55s ease both;
}
.portal-account::after,
.portal-dash::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(420px 220px at 92% -40%, rgba(225, 37, 27, 0.5), transparent 60%),
        radial-gradient(360px 200px at 100% 130%, rgba(255, 255, 255, 0.08), transparent 60%);
    pointer-events: none;
}
.portal-dash > * { position: relative; z-index: 1; }

.portal-dash__avatar {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    font-size: 1.35rem;
    box-shadow: 0 10px 26px rgba(225, 37, 27, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.18);
}

.portal-dash__copy { flex: 1 1 240px; min-width: 0; }
.portal-dash__welcome { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }

.portal-account__name,
.portal-dash__name {
    margin: 0.15rem 0 0.5rem;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
}

.portal-dash__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.portal-chip svg { width: 15px; height: 15px; opacity: 0.85; }

/* legacy meta/date (kept in case markup variant uses them) */
.portal-account__meta { margin: 0.15rem 0 0; color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; }
.portal-account__date { color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; }
.portal-dash__date { margin-left: auto; text-align: right; color: rgba(255, 255, 255, 0.72); font-size: 0.85rem; font-weight: 500; }

/* ============================ NAV TABS ============================ */
.portal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 2rem;
    padding: 0.4rem;
    background: var(--p-surface);
    border: 1px solid var(--p-line);
    border-radius: 999px;
    box-shadow: var(--p-shadow-sm);
}

.portal-tab {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 130px;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--p-navy);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.portal-tab svg { width: 18px; height: 18px; }
.portal-tab:hover { background: rgba(11, 31, 51, 0.05); color: var(--p-red); }

.portal-tab.is-active {
    background: linear-gradient(135deg, var(--p-red), var(--p-red-dark));
    color: #fff;
    box-shadow: 0 12px 26px rgba(225, 37, 27, 0.32);
}
.portal-tab.is-active:hover { color: #fff; }

/* ========================= SECTION TITLES ========================= */
.portal-section-title {
    position: relative;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 1.15rem;
    padding-left: 0.85rem;
    color: var(--p-navy);
}
.portal-section-title::before {
    content: "";
    position: absolute;
    left: 0; top: 0.15em; bottom: 0.15em;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(var(--p-red), var(--p-red-dark));
}

/* ============================ CARDS ============================ */
.portal-card {
    background: var(--p-surface);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    padding: 1.85rem;
    box-shadow: var(--p-shadow);
    animation: portalRise 0.5s ease both;
}
.portal-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 1.25rem; color: var(--p-navy); }

/* ===================== LISTS (policies, etc.) ===================== */
.portal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }

.portal-list__item {
    position: relative;
    background: var(--p-surface);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    padding: 1.2rem 3rem 1.2rem 1.4rem;
    cursor: pointer;
    box-shadow: var(--p-shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    animation: portalRise 0.5s ease both;
}
.portal-list__item::before {
    content: "";
    position: absolute;
    left: 0; top: 14px; bottom: 14px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(var(--p-red), var(--p-red-dark));
    opacity: 0.85;
}
.portal-list__item::after {
    content: "›";
    position: absolute;
    right: 1.25rem; top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
    line-height: 1;
    color: var(--p-muted);
    transition: transform 0.18s ease, color 0.18s ease;
}
.portal-list__item:hover {
    transform: translateY(-3px);
    box-shadow: var(--p-shadow);
    border-color: rgba(225, 37, 27, 0.35);
}
.portal-list__item:hover::after { transform: translateY(-50%) translateX(4px); color: var(--p-red); }
.portal-list__item:focus-visible { outline: none; box-shadow: var(--p-ring), var(--p-shadow); }
.portal-list__item h3 { font-size: 1.08rem; font-weight: 800; margin: 0 0 0.35rem; color: var(--p-navy); }
.portal-list__item small { color: var(--p-muted); line-height: 1.75; }
.portal-list__item a { color: var(--p-red-dark); font-weight: 600; }

.portal-empty {
    background: var(--p-surface);
    border: 1px dashed rgba(11, 31, 51, 0.22);
    border-radius: var(--p-radius);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--p-muted);
    box-shadow: var(--p-shadow-sm);
}

/* ===================== POLICY FILTER + BADGES ===================== */
.policy-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.policy-filter__btn {
    border: 1px solid var(--p-line); background: #fff; color: var(--p-navy);
    border-radius: 999px; padding: 0.5rem 1.1rem; font-weight: 700; font-size: 0.85rem; cursor: pointer;
    box-shadow: var(--p-shadow-sm); transition: all 0.18s ease;
}
.policy-filter__btn:hover { border-color: rgba(225, 37, 27, 0.35); color: var(--p-red); }
.policy-filter__btn.is-active {
    background: linear-gradient(135deg, var(--p-red), var(--p-red-dark));
    border-color: transparent; color: #fff;
    box-shadow: 0 10px 22px rgba(225, 37, 27, 0.3);
}
.policy-filter__count { opacity: 0.7; font-weight: 600; }

.policy-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.55rem; }
.badge-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.24rem 0.7rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-active  { background: rgba(22, 163, 74, 0.12);  color: #15803d; }
.badge-expired { background: rgba(11, 31, 51, 0.08);   color: var(--p-muted); }
.badge-paid    { background: rgba(13, 110, 253, 0.12); color: #0b5ed7; }
.badge-unpaid  { background: rgba(245, 158, 11, 0.16); color: #b45309; }

/* ============================ FORMS ============================ */
.portal-page label { font-weight: 600; color: var(--p-navy); margin-bottom: 0.3rem; font-size: 0.92rem; }

.portal-page .form-control,
.portal-page .form-select {
    border-radius: var(--p-radius-sm);
    padding: 0.7rem 0.95rem;
    border: 1.5px solid rgba(11, 31, 51, 0.16);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.portal-page .form-control:focus,
.portal-page .form-select:focus {
    border-color: var(--p-red);
    box-shadow: var(--p-ring);
}
.portal-help { color: var(--p-muted); font-size: 0.82rem; }

/* Buttons (extends site btn-premium / btn-outline-navy) */
.portal-page .btn-premium,
.portal-auth .btn-premium {
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(225, 37, 27, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.portal-page .btn-premium:hover,
.portal-auth .btn-premium:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 16px 32px rgba(225, 37, 27, 0.36); }
.portal-page .btn-outline-navy { border-radius: 999px; font-weight: 700; }

/* ============================ TABLES ============================ */
.portal-table-wrap {
    background: var(--p-surface);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    overflow: hidden;
    box-shadow: var(--p-shadow);
}
.portal-table { margin: 0; width: 100%; border-collapse: collapse; }
.portal-table thead th {
    background: linear-gradient(100deg, var(--p-navy-deep), var(--p-navy));
    color: #fff;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 0.95rem 1rem;
    white-space: nowrap;
}
.portal-table tbody td { padding: 0.85rem 1rem; border-top: 1px solid var(--p-line); font-size: 0.92rem; vertical-align: top; color: var(--p-ink); }
.portal-table tbody tr { transition: background 0.15s ease; }
.portal-table tbody tr:nth-child(even) { background: rgba(11, 31, 51, 0.022); }
.portal-table tbody tr:hover { background: rgba(225, 37, 27, 0.05); }

.portal-status-badge {
    display: inline-block;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(225, 37, 27, 0.1);
    color: var(--p-red-dark);
    white-space: nowrap;
}

/* ===================== DOCUMENT TABS (policy) ===================== */
.portal-doc-tabs.nav-pills { gap: 0.5rem; margin-bottom: 1.4rem; }
.portal-doc-tabs .nav-link {
    color: var(--p-navy) !important;   /* beat site .nav-link white !important */
    background: #fff;
    border: 1px solid var(--p-line);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 0.55rem 1.15rem;
    box-shadow: var(--p-shadow-sm);
    transition: all 0.18s ease;
}
.portal-doc-tabs .nav-link:hover { border-color: var(--p-red); color: var(--p-red) !important; transform: translateY(-1px); }
.portal-doc-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--p-red), var(--p-red-dark)) !important;
    border-color: transparent;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(225, 37, 27, 0.32);
}
.portal-doc-download { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--p-red-dark); text-decoration: none; }
.portal-doc-download:hover { text-decoration: underline; }

/* ===================== POLICY DETAIL PAGE ===================== */
.portal-back {
    display: inline-flex; align-items: center; gap: 0.45rem;
    margin-bottom: 1.25rem;
    padding: 0.5rem 1.05rem 0.5rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--p-line);
    color: var(--p-navy);
    font-weight: 700; font-size: 0.85rem; text-decoration: none;
    box-shadow: var(--p-shadow-sm);
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.portal-back svg { width: 16px; height: 16px; }
.portal-back:hover { transform: translateX(-2px); color: var(--p-red); border-color: rgba(225, 37, 27, 0.35); }

.policy-hero {
    position: relative; overflow: hidden;
    background: var(--p-surface);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius-lg);
    box-shadow: var(--p-shadow);
    padding: 1.85rem;
    margin-bottom: 1.9rem;
    animation: portalRise 0.5s ease both;
}
.policy-hero::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
    background: linear-gradient(var(--p-red), var(--p-red-dark));
}
.policy-hero__top { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.policy-hero__icon {
    flex: 0 0 auto; width: 54px; height: 54px; border-radius: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(225, 37, 27, 0.14), rgba(225, 37, 27, 0.04));
    color: var(--p-red);
}
.policy-hero__icon svg { width: 27px; height: 27px; }
.policy-hero__head { flex: 1 1 240px; min-width: 0; }
.policy-hero__title { margin: 0; font-size: 1.32rem; font-weight: 800; color: var(--p-navy); line-height: 1.22; }
.policy-hero__sub { margin: 0.3rem 0 0; color: var(--p-muted); font-size: 0.9rem; }

.policy-status {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.74rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.policy-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.policy-status.is-active { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.policy-status.is-expired { background: rgba(11, 31, 51, 0.08); color: var(--p-muted); }

.policy-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.15rem 1.6rem;
    margin-top: 1.55rem; padding-top: 1.5rem; border-top: 1px solid var(--p-line);
}
.policy-meta__item { display: flex; gap: 0.7rem; align-items: flex-start; }
.policy-meta__ic {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(11, 31, 51, 0.05); color: var(--p-navy);
}
.policy-meta__ic svg { width: 18px; height: 18px; }
.policy-meta__label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--p-muted); }
.policy-meta__value { font-size: 0.98rem; font-weight: 600; color: var(--p-ink); word-break: break-word; }

.policy-hero__actions { margin-top: 1.6rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Document rows */
.doc-list { display: grid; gap: 0.7rem; }
.doc-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: #fff; border: 1px solid var(--p-line); border-radius: var(--p-radius-sm);
    box-shadow: var(--p-shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.doc-row:hover { transform: translateY(-2px); box-shadow: var(--p-shadow); border-color: rgba(225, 37, 27, 0.28); }
.doc-row__icon {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(225, 37, 27, 0.1); color: var(--p-red);
}
.doc-row__icon svg { width: 22px; height: 22px; }
.doc-row__body { flex: 1 1 auto; min-width: 0; }
.doc-row__name { font-weight: 700; color: var(--p-navy); word-break: break-word; }
.doc-row__meta { font-size: 0.8rem; color: var(--p-muted); margin-top: 0.1rem; }
.doc-row__btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.05rem; border-radius: 999px; font-weight: 700; font-size: 0.84rem; text-decoration: none;
    color: #fff; background: linear-gradient(135deg, var(--p-red), var(--p-red-dark));
    box-shadow: 0 8px 18px rgba(225, 37, 27, 0.28);
    transition: transform 0.15s ease, filter 0.15s ease;
}
.doc-row__btn svg { width: 15px; height: 15px; }
.doc-row__btn:hover { transform: translateY(-1px); filter: brightness(1.05); color: #fff; }

.doc-subhead { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--p-muted); margin: 0.4rem 0 0.7rem; }

.doc-empty {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    padding: 2.4rem 1rem; text-align: center; color: var(--p-muted);
}
.doc-empty svg { width: 34px; height: 34px; opacity: 0.5; }

.policy-note {
    display: flex; gap: 0.75rem; align-items: flex-start;
    margin-top: 1.6rem; padding: 1rem 1.15rem;
    background: rgba(11, 31, 51, 0.04); border: 1px solid var(--p-line);
    border-radius: var(--p-radius-sm); color: var(--p-ink); font-size: 0.9rem;
}
.policy-note svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--p-red); margin-top: 1px; }
.policy-note a { color: var(--p-red-dark); font-weight: 700; }

/* ======================= AUTH (login / reset) ======================= */
body.portal-auth {
    background:
        radial-gradient(1000px 600px at 80% -10%, rgba(225, 37, 27, 0.10), transparent 60%),
        var(--p-bg);
}

.portal-auth__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; min-height: 100vh; }

.portal-auth__brand {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, var(--p-navy-deep), var(--p-navy) 55%, var(--p-navy-2));
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem clamp(2rem, 5vw, 5rem);
}
.portal-auth__brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(620px 360px at 88% 8%, rgba(225, 37, 27, 0.42), transparent 60%),
        radial-gradient(520px 360px at -5% 100%, rgba(255, 255, 255, 0.08), transparent 55%);
    pointer-events: none;
}
.portal-auth__brand > * { position: relative; z-index: 1; }

.portal-auth__logo { max-width: 200px; margin-bottom: 2rem; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35)); }
.portal-auth__eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #FF8079; margin-bottom: 0.6rem; }
.portal-auth__tagline { color: #fff; font-size: clamp(1.7rem, 3vw, 2.45rem); font-weight: 800; line-height: 1.18; max-width: 460px; margin: 0 0 2rem; }

.portal-auth__features { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; max-width: 420px; }
.portal-auth__feature { display: flex; align-items: center; gap: 0.8rem; font-size: 0.98rem; color: rgba(255, 255, 255, 0.9); }
.portal-auth__feature-ic {
    flex: 0 0 auto;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.portal-auth__feature-ic svg { width: 17px; height: 17px; }

.portal-auth__website {
    display: inline-flex; align-items: center; gap: 0.4rem;
    margin-top: 2.25rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600; text-decoration: none; width: max-content;
}
.portal-auth__website:hover { color: #fff; }

.portal-auth__form-side { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }

.portal-auth__card {
    width: 100%;
    max-width: 430px;
    background: var(--p-surface);
    border-radius: var(--p-radius-lg);
    box-shadow: var(--p-shadow-lg);
    padding: 2.6rem 2.4rem;
    animation: portalRise 0.55s ease both;
}
.portal-auth__card h1 { font-size: 1.7rem; font-weight: 800; color: var(--p-navy); margin-bottom: 0.35rem; }
.portal-auth__card p.lead-text { color: var(--p-muted); font-size: 0.96rem; margin-bottom: 1.6rem; }
.portal-auth__card label { font-size: 0.85rem; }
.portal-auth__card .form-control { border-radius: 999px; padding: 0.75rem 1.15rem; }

.portal-auth__forgot { display: block; text-align: right; font-size: 0.85rem; color: var(--p-muted); margin: -0.3rem 0 1.25rem; text-decoration: none; font-weight: 600; }
.portal-auth__forgot:hover { color: var(--p-red); }

.portal-auth__submit { width: 100%; border-radius: 999px; padding: 0.8rem; font-weight: 800; font-size: 1rem; letter-spacing: 0.02em; }

/* ============================ ANIMATIONS ============================ */
@keyframes portalRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes portalFade { from { opacity: 0; } to { opacity: 1; } }

.portal-list__item:nth-child(2) { animation-delay: 0.04s; }
.portal-list__item:nth-child(3) { animation-delay: 0.08s; }
.portal-list__item:nth-child(4) { animation-delay: 0.12s; }
.portal-list__item:nth-child(5) { animation-delay: 0.16s; }
.portal-list__item:nth-child(6) { animation-delay: 0.20s; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 860px) {
    .portal-auth__grid { grid-template-columns: 1fr; }
    .portal-auth__brand { display: none; }
    .portal-auth__card { box-shadow: var(--p-shadow); }
}

@media (max-width: 720px) {
    .portal-brand__label { display: none; }
    .portal-topbar__link { display: none; }
    .portal-user-chip__name { display: none; }
    .portal-dash__date { margin-left: 0; width: 100%; text-align: left; }
    .portal-dash { padding: 1.3rem; }
    .portal-account__name, .portal-dash__name { font-size: 1.35rem; }
    .portal-tabs { flex-wrap: nowrap; overflow-x: auto; border-radius: 16px; -webkit-overflow-scrolling: touch; }
    .portal-tab { flex: 0 0 auto; min-width: max-content; }
    .portal-tab span.portal-tab__label { display: none; }
    .portal-tab svg { width: 20px; height: 20px; }
}

@media (max-width: 575.98px) {
    .portal-card { padding: 1.35rem; }
}
