/* ROAD SIGNAGE AFRICA — customer account, quote builder and form styles (module B). */
:root {
    --rsa-accent: #F2B705;
    --rsa-ink: #1C1F24;
    --rsa-muted: #6b7078;
    --rsa-line: #e3e5e8;
    --rsa-soft: #f6f7f9;
    --rsa-card: #ffffff;
    --rsa-ok: #1d7a3e;
    --rsa-ok-bg: #e8f6ec;
    --rsa-err: #a12626;
    --rsa-err-bg: #fdecec;
    --rsa-warn-bg: #fff6d6;
    --rsa-radius: 10px;
}

.rsa-acc, .rsa-builder, .rsa-card, .rsa-form, .rsa-notice, .rsa-quote-actions {
    font-family: 'Poppins', Helvetica, Arial, sans-serif;
    color: var(--rsa-ink);
}
.rsa-acc *, .rsa-builder *, .rsa-card * { box-sizing: border-box; }

/* ---------- generic ---------- */
.rsa-card {
    background: var(--rsa-card);
    border: 1px solid var(--rsa-line);
    border-radius: var(--rsa-radius);
    padding: 18px;
    margin: 0 0 16px;
}
.rsa-card h3, .rsa-card h4 { margin: 0 0 10px; font-weight: 600; }
.rsa-muted { color: var(--rsa-muted); }
.rsa-small { font-size: .875em; }
.rsa-empty { padding: 24px; text-align: center; background: var(--rsa-soft); border-radius: var(--rsa-radius); color: var(--rsa-muted); }

.rsa-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0 0 16px;
    background: var(--rsa-ok-bg);
    color: var(--rsa-ok);
    border-left: 4px solid var(--rsa-ok);
    font-size: .95em;
}
.rsa-notice.err { background: var(--rsa-err-bg); color: var(--rsa-err); border-left-color: var(--rsa-err); }

/* ---------- forms ---------- */
.rsa-form { display: block; }
.rsa-grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rsa-grid-form .rsa-wide, .rsa-grid-form .rsa-check, .rsa-grid-form > p { grid-column: 1 / -1; }
.rsa-row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rsa-field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; font-size: .9em; }
.rsa-grid-form .rsa-field, .rsa-row-form .rsa-field { margin: 0; }
.rsa-field > span { font-weight: 500; }
.rsa-field input, .rsa-field select, .rsa-field textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid #cfd3d8;
    border-radius: 8px;
    background: #fff;
    color: var(--rsa-ink);
}
.rsa-field input[type="file"] { padding: 8px; background: var(--rsa-soft); }
.rsa-field input:focus, .rsa-field select:focus, .rsa-field textarea:focus { outline: 2px solid var(--rsa-accent); outline-offset: 1px; border-color: var(--rsa-ink); }
.rsa-check { display: flex; gap: 8px; align-items: flex-start; font-size: .9em; margin: 4px 0 12px; }
.rsa-check input { margin-top: 4px; }
.rsa-grow { flex: 1 1 260px; }

.rsa-acc .button, .rsa-builder .button, .rsa-quote-actions .button, .rsa-card .button {
    font-family: inherit;
    border-radius: 8px;
    font-weight: 600;
}
.rsa-acc .button.alt, .rsa-builder .button.alt, .rsa-quote-actions .button.alt, .rsa-card .button.alt, .rsa-btn-quote {
    background: var(--rsa-accent) !important;
    color: var(--rsa-ink) !important;
    border-color: var(--rsa-accent) !important;
}
.rsa-link-btn { background: none; border: 0; font-size: 1.3em; line-height: 1; cursor: pointer; color: var(--rsa-muted); padding: 2px 6px; }
.rsa-link-btn:hover { color: var(--rsa-err); }

/* ---------- account ---------- */
.rsa-acc-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.rsa-acc-head h2 { margin: 0; font-weight: 600; }
.rsa-stat { display: flex; flex-direction: column; align-items: flex-end; }
.rsa-stat span { font-size: .8em; color: var(--rsa-muted); text-transform: uppercase; letter-spacing: .05em; }
.rsa-stat strong { font-size: 1.35em; }

.rsa-doc-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.rsa-doc-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    padding: 14px 16px;
    background: var(--rsa-card);
    border: 1px solid var(--rsa-line);
    border-left: 4px solid var(--rsa-accent);
    border-radius: var(--rsa-radius);
}
.rsa-doc-row.is-overdue { border-left-color: var(--rsa-err); }
.rsa-doc-title { font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rsa-doc-meta { font-size: .85em; color: var(--rsa-muted); margin-top: 2px; }
.rsa-doc-amt { font-weight: 700; font-size: 1.1em; text-align: right; white-space: nowrap; }
.rsa-doc-amt small { display: block; font-weight: 400; font-size: .7em; color: var(--rsa-muted); }
.rsa-doc-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rsa-doc-acts .button { padding: 7px 14px; font-size: .9em; }
.rsa-inline { display: inline-flex; gap: 8px; margin: 0; }
.rsa-doc-acts details { width: 100%; }
.rsa-doc-acts details summary, .rsa-approve details summary, .rsa-job details summary { cursor: pointer; font-size: .9em; color: var(--rsa-muted); margin: 4px 0; }
.rsa-doc-acts details form { margin-top: 10px; }
.rsa-doc-acts details textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid #cfd3d8; border-radius: 8px; margin-bottom: 8px; }

.rsa-badge {
    display: inline-block;
    font-size: .72em;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--rsa-soft);
    color: var(--rsa-muted);
    white-space: nowrap;
}
.rsa-st-issued, .rsa-st-pending, .rsa-st-artwork_sent, .rsa-st-awaiting_artwork { background: var(--rsa-warn-bg); color: #7a5b00; }
.rsa-st-accepted, .rsa-st-paid, .rsa-st-verified, .rsa-st-completed, .rsa-st-installed, .rsa-st-artwork_approved { background: var(--rsa-ok-bg); color: var(--rsa-ok); }
.rsa-st-part_paid, .rsa-st-in_production, .rsa-st-ready, .rsa-st-dispatched, .rsa-st-installation_scheduled { background: #e7f0fb; color: #1d4f8a; }
.rsa-st-overdue, .rsa-st-declined, .rsa-st-failed, .rsa-st-cancelled, .rsa-st-expired { background: var(--rsa-err-bg); color: var(--rsa-err); }

.rsa-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.rsa-table th { text-align: left; font-weight: 600; font-size: .8em; text-transform: uppercase; letter-spacing: .04em; color: var(--rsa-muted); padding: 8px; border-bottom: 2px solid var(--rsa-line); }
.rsa-table td { padding: 10px 8px; border-bottom: 1px solid var(--rsa-line); }
.rsa-table .num { text-align: right; white-space: nowrap; }

.rsa-bank dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 10px; }
.rsa-bank dt { color: var(--rsa-muted); }
.rsa-bank dd { margin: 0; font-weight: 600; }

/* ---------- jobs ---------- */
.rsa-job-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rsa-job-head h3 { margin: 0 0 4px; }
.rsa-steps { list-style: none; display: flex; gap: 0; margin: 12px 0 16px; padding: 0; counter-reset: step; }
.rsa-steps li { flex: 1; position: relative; text-align: center; font-size: .75em; color: var(--rsa-muted); padding-top: 26px; }
.rsa-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 22px; height: 22px; line-height: 22px; border-radius: 50%;
    background: var(--rsa-line); color: var(--rsa-muted); font-weight: 600; z-index: 1;
}
.rsa-steps li::after { content: ''; position: absolute; top: 10px; left: -50%; width: 100%; height: 3px; background: var(--rsa-line); }
.rsa-steps li:first-child::after { display: none; }
.rsa-steps li.done::before { background: var(--rsa-ink); color: #fff; }
.rsa-steps li.done::after { background: var(--rsa-ink); }
.rsa-steps li.current::before { background: var(--rsa-accent); color: var(--rsa-ink); box-shadow: 0 0 0 4px rgba(242, 183, 5, .25); }
.rsa-steps li.current { color: var(--rsa-ink); font-weight: 600; }

.rsa-list { list-style: none; margin: 0 0 12px; padding: 0; }
.rsa-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rsa-line); }
.rsa-list li form { margin: 0; }
.rsa-timeline { list-style: none; padding: 0; margin: 8px 0 0; font-size: .88em; }
.rsa-timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--rsa-line); }
.rsa-timeline time { color: var(--rsa-muted); margin-right: 6px; }
.rsa-files { margin: 0 0 12px; padding-left: 18px; }
.rsa-approve { background: var(--rsa-soft); border-radius: 8px; padding: 14px; margin-top: 10px; }

.rsa-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.rsa-actions-grid > form { background: var(--rsa-soft); border-radius: var(--rsa-radius); padding: 16px; }
.rsa-quote-actions h4 { margin: 0 0 6px; font-weight: 600; }

/* ---------- quote builder ---------- */
.rsa-search { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rsa-search .rsa-field { margin: 0; }
.rsa-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.rsa-tile {
    display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
    padding: 12px; border: 1px solid var(--rsa-line); border-radius: var(--rsa-radius);
    text-decoration: none; color: var(--rsa-ink); font-weight: 600; text-align: center; background: #fff;
    transition: border-color .15s, transform .15s;
}
.rsa-tile:hover { border-color: var(--rsa-accent); transform: translateY(-2px); }
.rsa-tile img { width: 100%; height: 100px; object-fit: contain; }
.rsa-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.rsa-product { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.rsa-product-img img { width: 100%; height: 180px; object-fit: contain; background: var(--rsa-soft); border-radius: 8px; }
.rsa-product h3 { margin: 0; font-size: 1.05em; }
.rsa-product h3 a { color: inherit; text-decoration: none; }
.rsa-price { font-weight: 700; margin: 6px 0 10px; }
.rsa-price-quote { font-weight: 600; color: var(--rsa-muted); }
.rsa-accessories { border: 1px dashed var(--rsa-line); border-radius: 8px; padding: 10px; margin: 0 0 12px; }
.rsa-accessories legend { font-size: .85em; font-weight: 600; padding: 0 4px; }
.rsa-accessory-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: .88em; padding: 4px 0; }
.rsa-accessory-row input { width: 80px; padding: 6px; border: 1px solid #cfd3d8; border-radius: 6px; font: inherit; }
.rsa-quote-only { margin-top: 16px; }

@media (max-width: 640px) {
    .rsa-card { padding: 14px; }
    .rsa-grid-form { grid-template-columns: 1fr; }
    .rsa-doc-row { grid-template-columns: 1fr; }
    .rsa-doc-amt { text-align: left; }
    .rsa-steps li span { display: none; }
    .rsa-steps li.current span { display: block; position: absolute; top: 28px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
    .rsa-steps { padding-bottom: 14px; }
    .rsa-table thead { display: none; }
    .rsa-table tr { display: block; border-bottom: 1px solid var(--rsa-line); padding: 6px 0; }
    .rsa-table td { display: flex; justify-content: space-between; border: 0; padding: 4px 0; }
    .rsa-table td::before { content: attr(data-label); color: var(--rsa-muted); font-size: .85em; }
    .rsa-products { grid-template-columns: 1fr; }
}