/*
 * External portal (customer + assessor) styling. Reuses the workshop design tokens defined in
 * app.css (--bs-ink, --bs-hi-vis, fonts) but a distinct, calm, single-column layout — these pages
 * are seen by customers and insurers, not operators, so they carry no dense operational chrome.
 */

.pt {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bs-ink);
    color: #e9ecf1;
    font-family: var(--bs-font-ui);
}

.pt-wrap {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.pt-header {
    border-block-end: 3px solid var(--bs-hi-vis);
    padding-block: 1rem;
}

.pt-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pt-brand {
    font-family: var(--bs-font-display);
    font-size: 1.6rem;
    letter-spacing: 0.04em;
    color: #fff;
}

.pt-main {
    flex: 1;
    padding-block: 2.5rem 3rem;
}

.pt-card {
    background: var(--bs-paper);
    color: var(--bs-ink);
    border-radius: 14px;
    padding: 2rem 1.75rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.pt-eyebrow {
    font-family: var(--bs-font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b7280;
    margin: 0 0 0.5rem;
}

.pt-status__reg {
    font-family: var(--bs-font-display);
    font-size: 2.6rem;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1;
}

.pt-status__vehicle {
    color: #4b5563;
    margin: 0.35rem 0 1.25rem;
}

.pt-status__headline {
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0 0 1.5rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(0, 222, 145, 0.10);
    border-inline-start: 4px solid var(--bs-hi-vis);
}

.pt-status__headline--ready {
    background: rgba(0, 222, 145, 0.18);
}

.pt-status__headline--muted {
    background: #f3f4f6;
    border-inline-start-color: #9ca3af;
}

/* Vertical progress tracker. */
.pt-track {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.pt-track__step {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-block: 0.55rem;
    position: relative;
}

.pt-track__step:not(:last-child)::before {
    content: '';
    position: absolute;
    inset-inline-start: 8px;
    inset-block-start: 1.6rem;
    block-size: calc(100% - 0.5rem);
    inline-size: 2px;
    background: #d1d5db;
}

.pt-track__dot {
    inline-size: 18px;
    block-size: 18px;
    border-radius: 50%;
    background: #d1d5db;
    flex: 0 0 auto;
    z-index: 1;
}

.pt-track__label {
    font-weight: 500;
    color: #6b7280;
}

.pt-track__step--done .pt-track__dot { background: var(--bs-hi-vis); }
.pt-track__step--done .pt-track__label { color: var(--bs-ink); }

.pt-track__step--current .pt-track__dot {
    background: var(--bs-ink);
    box-shadow: 0 0 0 4px rgba(0, 222, 145, 0.30);
}
.pt-track__step--current .pt-track__label {
    color: var(--bs-ink);
    font-weight: 700;
}

.pt-status__note {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.pt-footer {
    padding-block: 1.25rem;
    color: #7e879a;
    font-size: 0.8rem;
    font-family: var(--bs-font-mono);
}

/* Assessor login + forms */
.pt-link {
    color: var(--bs-hi-vis);
    text-decoration: none;
    font-family: var(--bs-font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}
.pt-link:hover { text-decoration: underline; }

.pt-auth__title {
    font-family: var(--bs-font-display);
    font-size: 2.2rem;
    letter-spacing: 0.04em;
    margin: 0 0 0.35rem;
}

.pt-auth__lead {
    color: #4b5563;
    margin: 0 0 1.5rem;
}

.pt-auth__error {
    background: #fdecec;
    border-inline-start: 4px solid #d64545;
    color: #8a1f1f;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.pt-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.pt-field label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bs-ink);
}

.pt-field input {
    padding: 0.65rem 0.8rem;
    border: 1px solid #cbd2dc;
    border-radius: 8px;
    font: inherit;
}

.pt-field input:focus {
    outline: none;
    border-color: var(--bs-hi-vis);
    box-shadow: 0 0 0 3px rgba(0, 222, 145, 0.25);
}

.pt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 8px;
    background: var(--bs-hi-vis);
    color: var(--bs-ink-2);
    font-family: var(--bs-font-ui);
    font-weight: 700;
    cursor: pointer;
}
.pt-btn:hover { background: var(--bs-hi-vis-press); }

.pt-btn--ghost {
    background: transparent;
    border: 1px solid #cbd2dc;
    color: var(--bs-ink);
}

/* Estimate list */
.pt-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.pt-list__item { border-top: 1px solid #e5e7eb; }
.pt-list__link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.85rem 0.25rem;
    text-decoration: none;
    color: var(--bs-ink);
}
.pt-list__link:hover { background: #f7faf9; }
.pt-list__reg { font-family: var(--bs-font-display); font-size: 1.4rem; letter-spacing: 0.04em; }
.pt-list__meta { color: #6b7280; font-size: 0.85rem; }

/* Estimate detail table */
.pt-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.9rem; }
.pt-table th, .pt-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #e5e7eb; text-align: start; }
.pt-table thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; }
.pt-table tfoot th, .pt-table tfoot td { font-weight: 700; border-top: 2px solid #cbd2dc; }
.pt-num { text-align: end; font-family: var(--bs-font-mono); }

/* Decision form */
.pt-decision { margin-top: 1.5rem; border-top: 1px solid #e5e7eb; padding-top: 1.25rem; }
.pt-decision textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd2dc;
    border-radius: 8px;
    font: inherit;
    resize: vertical;
}
.pt-decision textarea:focus {
    outline: none;
    border-color: var(--bs-hi-vis);
    box-shadow: 0 0 0 3px rgba(0, 222, 145, 0.25);
}
.pt-hint { color: #6b7280; font-size: 0.8rem; }
.pt-decision__actions { display: flex; gap: 0.75rem; margin-top: 1rem; }

/* Horizontal scroll guard for the table on narrow screens */
@media (max-width: 480px) {
    .pt-table { display: block; overflow-x: auto; white-space: nowrap; }
}

.pt-eyebrow--spaced { margin-top: 1.75rem; }
.pt-track--compact .pt-track__step { padding-block: 0.35rem; }
.pt-track--compact .pt-track__step:not(:last-child)::before { inset-block-start: 1.2rem; }

.pt-docs { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.pt-docs__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
    border-top: 1px solid #e5e7eb;
}
.pt-docs__cat {
    font-family: var(--bs-font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

/* Message thread */
.pt-thread { list-style: none; margin: 0.75rem 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.pt-thread__msg { padding: 0.65rem 0.85rem; border-radius: 10px; background: #f3f4f6; max-width: 85%; }
.pt-thread__msg--assessor { align-self: flex-end; background: rgba(0, 222, 145, 0.12); }
.pt-thread__meta { margin: 0 0 0.25rem; font-size: 0.72rem; color: #6b7280; }
.pt-thread__body { margin: 0; }
.pt-msgform { margin-bottom: 1.5rem; }

/* Staff-side thread panel (rendered inside the app shell on the job screen) */
.portal-thread { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.portal-thread__msg { padding: 0.6rem 0.8rem; border-radius: 8px; background: rgba(0,0,0,0.03); }
.portal-thread__msg--assessor { border-inline-start: 3px solid var(--bs-hi-vis); }
.portal-thread__meta { margin: 0 0 0.25rem; font-size: 0.75rem; color: #6b7280; }
.portal-thread__body { margin: 0; white-space: pre-wrap; }
.portal-reply textarea { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #cbd2dc; border-radius: 6px; font: inherit; }

/* ---- Dark mode (RSPH-28) ----
   The portal page background is already dark; the light "paper" card is what needs re-theming when a
   staff member who chose dark mode lands here. Flip the card surface and the text that used the dark
   ink token, and darken the light neutral fills/borders. Brand + status colours are left untouched. */
[data-bs-theme="dark"] .pt-card { background: #1c1f24; color: #e6e9ee; }
[data-bs-theme="dark"] .pt-track__step--done .pt-track__label,
[data-bs-theme="dark"] .pt-track__step--current .pt-track__label,
[data-bs-theme="dark"] .pt-list__link,
[data-bs-theme="dark"] .pt-field label { color: #e6e9ee; }
[data-bs-theme="dark"] .pt-btn--ghost { color: #e6e9ee; border-color: #333a43; }
[data-bs-theme="dark"] .pt-field input,
[data-bs-theme="dark"] .pt-decision textarea,
[data-bs-theme="dark"] .portal-reply textarea { background: #23272e; color: #e6e9ee; border-color: #333a43; }
[data-bs-theme="dark"] .pt-status__headline--muted,
[data-bs-theme="dark"] .pt-thread__msg { background: #23272e; }
[data-bs-theme="dark"] .pt-list__item,
[data-bs-theme="dark"] .pt-table th,
[data-bs-theme="dark"] .pt-table td,
[data-bs-theme="dark"] .pt-decision,
[data-bs-theme="dark"] .pt-docs__item { border-color: #333a43; }
[data-bs-theme="dark"] .pt-table tfoot th,
[data-bs-theme="dark"] .pt-table tfoot td { border-top-color: #333a43; }
[data-bs-theme="dark"] .pt-list__link:hover { background: #23272e; }
[data-bs-theme="dark"] .pt-track__dot,
[data-bs-theme="dark"] .pt-track__step:not(:last-child)::before { background: #333a43; }
