/*
 * Client portal, on top of the Energy Reclaim site stylesheet (site.css, copied from the
 * website unchanged). Same rules as DESIGN.md there: flat, separated by rules and bands
 * of colour (never shadows or floating cards), 2px radius on controls, orange fills with
 * charcoal text, Big Shoulders capitals for headings, Work Sans for reading.
 */

.portal-main {
    padding-block: clamp(2rem, 1.2rem + 3vw, 4rem) var(--section);
    min-height: 60vh;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.portal-nav__form {
    margin: 0;
}

.portal-nav__tag {
    font-size: var(--step--1);
    font-weight: 650;
    color: var(--ink-3);
}

/* Page heading: wordmark capitals over the 6px orange rule, as on the site's page heads. */
.portal-head {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 6px solid var(--cobalt);
}

.portal-head__title {
    font-family: var(--wordmark);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 0.92;
    font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem);
    text-wrap: balance;
}

.portal-head__lede {
    max-width: 44rem;
    font-size: var(--step-1);
    color: var(--ink-2);
}

.portal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 650;
    color: var(--cobalt-text);
    text-decoration: none;
}

.portal-back .icon {
    transform: rotate(180deg);
}

.portal-section {
    display: grid;
    gap: 1rem;
    margin-top: 2.5rem;
}

.portal-section__title {
    font-family: var(--wordmark);
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem);
    line-height: 0.95;
    padding-top: 0.75rem;
    border-top: 2px solid var(--ink);
}

.portal-muted {
    color: var(--ink-3);
}

.portal-small {
    font-size: var(--step--1);
}

/* Panels: white, a rule round them; an orange top rule when they ask for something. */
.panel {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    padding: clamp(1.25rem, 0.9rem + 1.5vw, 2rem);
    background: var(--white);
    border: 1px solid var(--rule);
}

.panel--action {
    border-top: 4px solid var(--cobalt);
}

.panel--team {
    background: var(--grey);
    border-color: var(--grey-2);
}

.panel__title {
    font-size: var(--step-1);
    font-weight: 700;
    line-height: 1.3;
}

.portal-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 60rem) {
    .portal-grid--two {
        grid-template-columns: 1fr 1fr;
    }
}

/* Claim summary on the dashboard. */
.claim-card {
    display: grid;
    gap: 1rem;
    padding: clamp(1.25rem, 0.9rem + 1.5vw, 2rem);
    background: var(--white);
    border: 1px solid var(--rule);
    border-top: 4px solid var(--ink);
}

.claim-card--needs-you {
    border-top-color: var(--cobalt);
}

.claim-card__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1.5rem;
}

.claim-card__name {
    font-size: var(--step-1);
    font-weight: 700;
    line-height: 1.25;
}

.claim-card__facts {
    display: grid;
    gap: 0.5rem 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.fact {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.fact__value {
    font-weight: 560;
    overflow-wrap: anywhere;
}

.claim-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule-soft);
}

/* Status: the client wording, as a solid charcoal tag. */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    font-size: var(--step--1);
    font-weight: 650;
    background: var(--ink);
    color: var(--white);
}

/* Small state pills (documents, requests, reviews). */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 650;
    background: var(--grey-2);
    color: var(--ink);
    white-space: nowrap;
}

.pill--you {
    background: var(--cobalt);
}

.pill--good {
    background: #d8ead9;
}

.pill--warn {
    background: var(--cobalt-wash);
    color: var(--cobalt-text);
}

.pill--bad {
    background: var(--error-wash);
    color: var(--error);
}

/* Action lists. */
.action-list {
    display: grid;
    gap: 0;
}

.action-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding-block: 1rem;
    border-top: 1px solid var(--rule-soft);
}

.action-item:first-child {
    border-top: 0;
    padding-top: 0.25rem;
}

.action-item__text {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 18rem;
}

.action-item__title {
    font-weight: 650;
}

/* Timeline. */
.timeline {
    display: grid;
    gap: 0;
    border-left: 2px solid var(--rule);
    margin-left: 0.4rem;
}

.timeline__item {
    position: relative;
    display: grid;
    gap: 0.2rem;
    padding: 0 0 1.5rem 1.5rem;
}

.timeline__item::before {
    content: "";
    position: absolute;
    left: -0.45rem;
    top: 0.35rem;
    width: 0.8rem;
    height: 0.8rem;
    background: var(--paper);
    border: 2px solid var(--ink);
}

.timeline__item--update::before {
    background: var(--cobalt);
    border-color: var(--cobalt);
}

.timeline__title {
    font-weight: 650;
}

.timeline__body {
    color: var(--ink-2);
    white-space: pre-line;
}

/* Documents. */
.doc-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    padding-block: 0.9rem;
    border-top: 1px solid var(--rule-soft);
}

.doc-row:first-child {
    border-top: 0;
}

.doc-row__name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    font-weight: 560;
    overflow-wrap: anywhere;
}

.doc-row__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.text-link {
    color: var(--cobalt-text);
    font-weight: 650;
    text-underline-offset: 0.18em;
}

button.text-link {
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    text-decoration: underline;
}

/* Upload. */
.upload-drop {
    display: grid;
    gap: 0.5rem;
    justify-items: start;
    padding: 1.25rem;
    border: 1.5px dashed var(--field);
    background: var(--paper);
}

.upload-drop input[type="file"] {
    max-width: 100%;
    font: inherit;
}

.progress {
    width: 100%;
    height: 0.6rem;
    background: var(--grey-2);
}

.progress__bar {
    height: 100%;
    background: var(--cobalt);
    transition: width 160ms var(--ease-out);
}

/* Messages inside a panel: a tint and a rule, never a shadow. */
.message {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--ink);
    background: var(--grey);
}

.message .icon {
    flex: none;
    margin-top: 0.15rem;
}

.message--error {
    border-color: var(--error);
    background: var(--error-wash);
    color: var(--error);
}

.message--success {
    border-color: #2f7a3a;
    background: #e6f2e7;
}

.message--note {
    border-color: var(--cobalt);
    background: var(--cobalt-wash);
}

/* Loading placeholders. */
.skeleton {
    height: 1rem;
    background: linear-gradient(90deg, var(--grey) 0%, var(--grey-2) 50%, var(--grey) 100%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease-in-out infinite;
}

.skeleton--block {
    height: 9rem;
}

@keyframes skeleton {
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
}

/* Contract review: the document beside the form on wide screens. */
.review-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 70rem) {
    .review-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        align-items: start;
    }

    .review-layout__doc {
        position: sticky;
        top: calc(var(--header-h) + 1rem);
    }
}

.review-layout__doc iframe {
    display: block;
    width: 100%;
    height: min(80vh, 60rem);
    border: 1px solid var(--rule);
    background: var(--white);
}

.review-group {
    display: grid;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--rule);
    border-top: 2px solid var(--ink);
}

.review-group__title {
    padding: 0.9rem 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--rule-soft);
}

.value-row {
    display: grid;
    gap: 0.5rem;
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--rule-soft);
}

.value-row:first-of-type {
    border-top: 0;
}

.value-row--uncertain {
    border-left: 4px solid var(--cobalt);
    background: #fffaf7;
}

.value-row__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
}

.value-row__label {
    font-weight: 650;
}

.value-row__value {
    font-size: var(--step-1);
    font-weight: 560;
    overflow-wrap: anywhere;
}

.value-row__value--missing {
    color: var(--ink-3);
    font-size: var(--step-0);
    font-weight: 450;
}

.value-row__evidence {
    font-size: var(--step--1);
    color: var(--ink-3);
}

.value-row__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.value-row__choices .check {
    margin-top: 0;
}

.value-row .input,
.value-row .select {
    margin-top: 0;
    max-width: 24rem;
}

.confirm-box {
    display: grid;
    gap: 1rem;
    padding: clamp(1.25rem, 0.9rem + 1.5vw, 2rem);
    background: var(--white);
    border: 1px solid var(--rule);
    border-top: 4px solid var(--cobalt);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* The sign-in card. */
.signin {
    max-width: 34rem;
}

[x-cloak] {
    display: none !important;
}

/* Radio choices are round; the site's .check styles square checkboxes. */
.check input[type="radio"] {
    border-radius: 50%;
}

@media (max-width: 69.99rem) {
    .review-layout__doc iframe {
        height: 55vh;
    }
}
