/*
 * CUSTOMER PORTAL LAYER
 *
 * THE RULE THIS SHEET OBEYS, AND WHY IT IS NOT OPTIONAL.
 *
 * There is not one custom property DECLARATION in this file. Every colour,
 * shadow and font below is `var(--brand-*)` or one of site.css's legacy aliases,
 * so a tenant's published palette - delivered by /tenant-brand.css.php, linked
 * last - reassigns all of it with no rule in here participating.
 *
 * contractor-standard.css is the counter-example this project already paid for:
 * it declared --standard-deep/mid/accent/soft/paper scoped to `.standard-site`
 * instead of reassigning the shared names, and a second tenant rendered with the
 * first tenant's focus ring, nav underline, button glow and footer, because
 * override rules cannot reach every use site. A theme is a REASSIGNMENT of
 * names, never a parallel set of new ones. Adding `--portal-*` here would have
 * repeated that defect on a surface whose whole purpose is to look like the
 * tenant.
 *
 * A tenant with NO published brand still renders correctly: site.css declares
 * every one of these names at :root, and the brand endpoint answers an empty
 * `:root {}` when there is nothing published. Nothing here depends on a tenant
 * value existing.
 *
 * NO JAVASCRIPT. Nothing in this sheet has an `.is-*` state class, because there
 * is no script to add one. site.css's .primary-nav is display:none under 860px
 * until JS adds .is-open - which is exactly why the portal has its own nav that
 * simply wraps instead of collapsing. A menu that needs a script is a menu that
 * does not exist for this audience.
 */

.portal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--brand-surface);
}

/* --------------------------------------------------------------------- */
/* Chrome                                                                 */
/* --------------------------------------------------------------------- */

.portal-top {
    color: var(--white);
    background: var(--brand-ink);
}

.portal-top__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 18px;
}

.portal-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
}

.portal-identity__mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--brand-mark-from), var(--brand-mark-to));
    color: var(--white);
    font-weight: 850;
    letter-spacing: 0.02em;
}

.portal-identity__text {
    display: grid;
    line-height: 1.25;
}

.portal-identity__text strong {
    font-size: 1.02rem;
}

.portal-identity__text span {
    color: var(--brand-line);
    font-size: 0.79rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-top__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.portal-who {
    color: var(--brand-line);
    font-size: 0.84rem;
}

.portal-signout {
    margin: 0;
}

.portal-signout button {
    padding: 9px 16px;
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    color: var(--white);
    background: transparent;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.portal-nav {
    background: var(--brand-primary);
}

.portal-nav__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-block: 6px;
}

.portal-nav a {
    display: inline-block;
    padding: 11px 15px;
    border-radius: 10px;
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.portal-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.16);
}

.portal-main {
    flex: 1;
    padding-block: 34px 60px;
}

.portal-foot {
    padding-block: 26px;
    border-top: 1px solid var(--brand-line);
    color: var(--brand-ink-soft);
    background: var(--white);
    font-size: 0.86rem;
}

.portal-foot__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
}

/* --------------------------------------------------------------------- */
/* Content                                                                */
/* --------------------------------------------------------------------- */

.portal-heading {
    margin: 0 0 6px;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.portal-lede {
    margin: 0 0 26px;
    max-width: 62ch;
    color: var(--brand-ink-soft);
}

.portal-lede--flush {
    margin: 0;
}

/* Grouping radios in a <fieldset> is what gives the group an accessible name
   from its <legend> without any script; the reset just removes the browser's
   default frame. */
.portal-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.portal-fieldset legend {
    padding: 0;
    margin-bottom: 6px;
}

.portal-panel {
    margin-bottom: 26px;
    padding: 22px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: var(--white);
    box-shadow: var(--brand-shadow-sm);
}

.portal-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.portal-panel__head h2 {
    margin: 0;
    font-size: 1.16rem;
    letter-spacing: -0.02em;
}

.portal-panel__head a {
    color: var(--brand-primary);
    font-size: 0.88rem;
    font-weight: 800;
}

.portal-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.portal-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--brand-line);
    border-radius: 12px;
    background: var(--brand-surface);
}

.portal-item__main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.portal-item__main strong {
    font-size: 1rem;
}

.portal-item__main span {
    color: var(--brand-ink-soft);
    font-size: 0.86rem;
}

.portal-item__side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.portal-item__side a {
    color: var(--brand-primary);
    font-weight: 800;
}

.portal-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.portal-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--brand-line);
    border-radius: 12px;
    color: var(--brand-ink-soft);
    background: var(--brand-surface);
}

.portal-tag {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--brand-primary-wash);
    color: var(--brand-ink);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-tag--due {
    background: var(--brand-accent-wash);
}

.portal-note {
    margin: 0 0 22px;
    padding: 15px 17px;
    border: 1px solid var(--brand-line);
    border-left: 4px solid var(--brand-primary);
    border-radius: 12px;
    background: var(--white);
}

.portal-note--error {
    border-left-color: var(--brand-accent);
    background: var(--brand-accent-wash);
}

.portal-note--success {
    border-left-color: var(--brand-primary-bright);
    background: var(--brand-primary-wash);
}

.portal-note strong {
    display: block;
    margin-bottom: 3px;
}

.portal-dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 0;
}

.portal-dl > div {
    display: grid;
    gap: 3px;
}

.portal-dl dt {
    color: var(--brand-ink-soft);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-dl dd {
    margin: 0;
    font-weight: 700;
}

.portal-table-wrap {
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    min-width: 460px;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.portal-table th,
.portal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--brand-line);
    text-align: left;
    vertical-align: top;
}

.portal-table th {
    color: var(--brand-ink-soft);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-table td:last-child,
.portal-table th:last-child {
    text-align: right;
}

.portal-prose {
    color: var(--brand-ink);
}

.portal-prose :is(h1, h2, h3, h4) {
    margin: 1.1em 0 0.4em;
    font-size: 1.02rem;
}

.portal-prose p,
.portal-prose ul,
.portal-prose ol {
    margin: 0 0 0.8em;
}

/* --------------------------------------------------------------------- */
/* Forms - plain, full page load, no script anywhere                      */
/* --------------------------------------------------------------------- */

.portal-form {
    display: grid;
    gap: 16px;
    max-width: 34rem;
}

.portal-field {
    display: grid;
    gap: 6px;
}

.portal-field > span {
    font-size: 0.86rem;
    font-weight: 800;
}

.portal-field input[type="email"],
.portal-field input[type="tel"],
.portal-field input[type="text"] {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--brand-line);
    border-radius: 12px;
    background: var(--white);
    color: var(--brand-ink);
}

.portal-field small {
    color: var(--brand-ink-soft);
}

.portal-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-choice label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    background: var(--white);
    font-weight: 700;
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.portal-inline-form {
    display: inline;
    margin: 0;
}

.portal-quiet-button {
    padding: 9px 15px;
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    color: var(--brand-ink);
    background: var(--white);
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

/* The bot-friction honeypot: off-screen rather than display:none, because a
   display:none field is the first thing a form-filling bot learns to skip.
   Copied from site.css's .field-honeypot for the same reason it exists there. */
.portal-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 560px) {
    .portal-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-top__inner {
        justify-content: flex-start;
    }
}
