:root {
    --charcoal: #3a3a3d;
    --dark: #262626;
    --orange: #c9670f;
    --orange-secondary: #bf4e14;
    --orange-dark: #9f4f08;
    --light: #f2f2f2;
    --border: #d9d9d9;
    --text: #262626;
    --white: #ffffff;
    --success: #1f6b3a;
    --danger: #a12727;
    --warning: #8a5b00;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Calibri, Arial, sans-serif;
    color: var(--text);
    background: #f7f7f7;
    line-height: 1.5;
}
a { color: var(--orange-dark); }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--charcoal); border-bottom: 4px solid var(--orange); color: white; }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--orange); color: var(--orange); font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand small { color: #ddd; }
.main-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.main-nav a, .link-button { color: white; text-decoration: none; font: inherit; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; }
.page-content { min-height: calc(100vh - 140px); padding: 32px 0 48px; }
.site-footer { background: var(--dark); color: #ddd; padding: 18px 0; font-size: 14px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
h1, h2 { margin-top: 0; }
h1 { font-size: 30px; margin-bottom: 4px; }
h2 { font-size: 20px; }
.page-heading p { margin: 0; color: #666; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 4px; border: 1px solid transparent; text-decoration: none; font-weight: 700; cursor: pointer; }
.button-primary { background: var(--orange); color: white; }
.button-primary:hover { background: var(--orange-dark); }
.button-secondary { background: white; border-color: var(--border); color: var(--text); }
.panel, .auth-card { background: white; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.05); padding: 24px; border-radius: 5px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-left: 5px solid var(--orange); padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { color: #666; }
.stat-card strong { font-size: 32px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--charcoal); color: white; font-size: 14px; }
.status { display: inline-block; padding: 4px 9px; border-radius: 20px; background: #ececec; font-size: 13px; font-weight: 700; }
.status-completed { background: #dcefe2; color: var(--success); }
.status-draft { background: #e8e8e8; }
.status-email_failed, .status-voided, .status-expired { background: #f6dddd; color: var(--danger); }
.status-sent, .status-opened, .status-awaiting_second, .status-awaiting_adjuster { background: #fff0c9; color: var(--warning); }
.large-status { font-size: 15px; padding: 8px 14px; }
.empty-state { text-align: center; padding: 40px 20px; }
.search-form { display: flex; gap: 10px; margin-bottom: 18px; }
.search-form input { flex: 1; min-height: 44px; border: 1px solid var(--border); padding: 10px 12px; border-radius: 4px; font: inherit; }
.form-panel { padding: 0; overflow: hidden; }
.form-section { padding: 24px; border-bottom: 1px solid var(--border); }
.form-section h2 { padding-bottom: 8px; border-bottom: 3px solid var(--orange); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea, .stacked-form input { width: 100%; min-height: 44px; border: 1px solid #bcbcbc; border-radius: 3px; padding: 10px 12px; font: inherit; background: #fff; }
.field textarea { min-height: 90px; }
.field small { display: block; color: #666; margin-top: 5px; }
.required, .field-error { color: var(--danger); }
.field-error { margin-top: 5px; font-size: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 24px; background: var(--light); }
.auth-card { width: min(460px, 100%); margin: 40px auto; }
.stacked-form { display: grid; gap: 10px; }
.stacked-form .button { margin-top: 8px; }
.message { padding: 12px 15px; margin-bottom: 18px; border-radius: 4px; background: #e7eef8; }
.message-success { background: #dcefe2; color: var(--success); }
.message-error { background: #f6dddd; color: var(--danger); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.detail-list { margin: 0; }
.detail-list div { display: grid; grid-template-columns: 150px 1fr; padding: 9px 0; border-bottom: 1px solid var(--border); }
.detail-list dt { font-weight: 700; }
.detail-list dd { margin: 0; }
.next-step-panel { border-top: 5px solid var(--orange); }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-left: 4px solid var(--orange); padding: 8px 12px; background: var(--light); display: grid; grid-template-columns: 1fr auto; }
.timeline-item small { grid-column: 1 / -1; color: #666; }
.claim-action-row, .adjuster-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.claim-action-row form, .adjuster-actions form { margin: 0; }
.documents-panel { margin-bottom: 18px; }
.document-list { display: grid; }
.document-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 13px; padding: 14px 0; border-top: 1px solid var(--border); }
.document-row small { display: block; color: #666; margin-top: 2px; }
.document-check, .answer-complete { width: 27px; height: 27px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--success); color: white; }
.adjuster-actions { justify-content: space-between; margin-bottom: 18px; }
.answer-sections { display: grid; gap: 18px; }
.answer-card h2 { display: flex; align-items: center; gap: 10px; border-bottom: 3px solid var(--orange); padding-bottom: 10px; }
.answer-list { margin: 0; }
.answer-list > div { display: grid; grid-template-columns: minmax(180px, 38%) 1fr; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.answer-list dt { font-weight: 700; }
.answer-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-mark { display: block; width: min(260px, 100%); max-height: 100px; object-fit: contain; object-position: left center; border: 1px solid var(--border); }
.next-step-panel input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border); margin: 7px 0 12px; }

/* Policyholder questionnaire intentionally has its own shell and no adjuster navigation. */
.questionnaire-body { background: #f3f5f7; }
.questionnaire-container { width: min(760px, calc(100% - 32px)); margin: 0 auto; }
.questionnaire-header { background: var(--charcoal); border-bottom: 5px solid var(--orange); color: white; padding: 14px 0; }
.questionnaire-header .questionnaire-container { display: flex; align-items: center; gap: 16px; }
.questionnaire-header strong, .questionnaire-header small { display: block; }
.questionnaire-header strong { font-size: 22px; line-height: 1.1; }
.questionnaire-header small { color: #ddd; margin-top: 2px; }
.questionnaire-logo { width: 74px; height: 60px; object-fit: contain; }
.questionnaire-brand-copy { min-width: 0; }
.questionnaire-header-claim { margin-left: auto; text-align: right; font-weight: 700; }
.questionnaire-header-claim small { font-weight: 400; }
.questionnaire-main { min-height: calc(100vh - 160px); padding: 25px 0 45px; }
.questionnaire-progress { margin-bottom: 17px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 7px; }
.progress-track { height: 12px; background: #d6d9dd; border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); }
.save-status { display: flex; align-items: center; gap: 8px; margin: -4px 0 17px; color: var(--success); font-size: 14px; font-weight: 700; }
.save-status span { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; color: white; background: var(--success); }
.questionnaire-card { background: white; border: 1px solid var(--border); border-radius: 7px; padding: 30px; box-shadow: 0 3px 12px rgba(0,0,0,.07); }
.questionnaire-card h1 { font-size: 28px; border-bottom: 3px solid var(--orange); padding-bottom: 12px; }
.questionnaire-field { margin: 0 0 22px; }
.questionnaire-field > label, .signature-wrap > label { display: block; font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.questionnaire-control:not([type="radio"]):not([type="checkbox"]) { width: 100%; min-height: 52px; padding: 12px; font: inherit; font-size: 17px; border: 1px solid #999; border-radius: 5px; background: white; }
textarea.questionnaire-control { min-height: 110px; }
.questionnaire-field ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.questionnaire-field ul label, .checkbox-field > label { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 14px; border: 2px solid #bbb; border-radius: 7px; font-size: 17px; font-weight: 700; cursor: pointer; background: var(--white); }
.questionnaire-field ul label:hover, .questionnaire-field ul label:focus-within, .checkbox-field > label:hover { border-color: var(--orange); background: #fff8f1; }
.questionnaire-field ul label:has(input:checked), .checkbox-field > label:has(input:checked) { border-color: var(--orange-secondary); background: #fff1e8; box-shadow: inset 0 0 0 1px var(--orange-secondary); }
.questionnaire-field input[type="radio"], .questionnaire-field input[type="checkbox"] { width: 23px; height: 23px; flex: 0 0 23px; }
.notice { background: #fff4d5; border-left: 5px solid var(--orange); padding: 16px; margin: 20px 0; }
.questionnaire-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
.questionnaire-actions .button { min-height: 56px; min-width: 160px; font-size: 18px; border-radius: 6px; }
.review-section { border: 1px solid var(--border); border-radius: 5px; margin: 18px 0; overflow: hidden; }
.review-heading { background: var(--light); display: flex; justify-content: space-between; padding: 13px 16px; }
.review-heading h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.review-complete { width: 25px; height: 25px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--success); color: white; font-size: 15px; }
.review-edit { font-weight: 700; padding: 5px 8px; }
.review-section dl { margin: 0; padding: 5px 16px; }
.review-section dl div { padding: 10px 0; border-bottom: 1px solid #eee; }
.review-section dt { font-weight: 700; }
.review-section dd { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-mark { display: block; width: min(220px, 100%); max-height: 90px; object-fit: contain; object-position: left center; border: 1px solid var(--border); background: white; }
.signature-wrap { margin-top: -5px; }
.drawing-pad { display: block; width: 100%; height: 180px; border: 2px solid #777; border-radius: 5px; background: white; touch-action: none; margin-bottom: 10px; }
.drawing-pad[data-mark-type="signature"] { height: 280px; }
.drawing-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-button { position: relative; overflow: hidden; }
.upload-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.confirmation-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: white; font-size: 42px; margin: 0 auto 20px; }
.confirmation-logo { display: block; width: 130px; height: auto; margin: 0 auto 18px; }
.confirmation-lead { text-align: center; font-size: 20px; }
.confirmation-details { margin: 24px 0; border: 1px solid var(--border); border-radius: 6px; }
.confirmation-details div { display: grid; grid-template-columns: 150px 1fr; gap: 15px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.confirmation-details div:last-child { border-bottom: 0; }
.confirmation-details dt { font-weight: 700; }
.confirmation-details dd { margin: 0; }
.confirmation-received { padding: 16px; border-left: 5px solid var(--orange); background: var(--light); font-weight: 700; }
.confirmation-dashboard-link { margin: 24px 0 0; }
.confirmation-dashboard-link .button { width: 100%; min-height: 54px; }
.not-ready-card { text-align: center; margin-top: 40px; }
.not-ready-mark { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; background: var(--orange); color: white; font-size: 40px; font-weight: 700; }
.questionnaire-footer { background: var(--dark); color: #ddd; text-align: center; padding: 16px 0; font-size: 13px; }

@media (max-width: 800px) {
    .header-inner, .page-heading { align-items: flex-start; flex-direction: column; padding-top: 16px; padding-bottom: 16px; }
    .main-nav { gap: 12px; }
    .stat-grid, .detail-grid, .form-grid { grid-template-columns: 1fr; }
    .field-full { grid-column: auto; }
    .search-form { flex-direction: column; }
    .button { width: 100%; }
    .form-actions { flex-direction: column-reverse; }
    .document-row { grid-template-columns: auto 1fr; }
    .document-row .status, .document-row .button { grid-column: 2; width: 100%; }
    .answer-list > div { grid-template-columns: 1fr; gap: 3px; }
    .questionnaire-card { padding: 21px 17px; }
    .questionnaire-card h1 { font-size: 24px; }
    .questionnaire-actions { flex-direction: column-reverse; }
    .questionnaire-actions .button { width: 100%; }
    .questionnaire-header .questionnaire-container { align-items: flex-start; flex-wrap: wrap; }
    .questionnaire-header-claim { width: 100%; margin-left: 90px; text-align: left; }
    .progress-copy { align-items: flex-start; }
    .progress-copy span { max-width: 70%; }
    .review-heading { align-items: flex-start; }
    .confirmation-details div { grid-template-columns: 1fr; gap: 3px; }
    .drawing-pad[data-mark-type="signature"] { height: 240px; }
}

/* InFlow Claim Forms Portal branding */
.brand-logo {
    height: 60px;
    width: auto;
    display: block;
    flex: 0 0 auto;
}

.brand-copy {
    display: block;
    min-width: 0;
}

.brand-copy strong {
    display: block;
    color: var(--white);
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: .2px;
}

.brand-copy small {
    display: block;
    margin-top: 4px;
    color: #e6e6e6;
    font-size: 14px;
}

.login-brand {
    text-align: center;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--orange);
}

.login-logo {
    width: min(250px, 80%);
    height: auto;
    display: block;
    margin: 0 auto 12px;
}

.login-product-name {
    color: var(--charcoal);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.login-byline {
    margin-top: 5px;
    color: #666;
    font-size: 16px;
    font-weight: 700;
}

.auth-card h1,
.auth-card > p {
    text-align: center;
}

@media (max-width: 800px) {
    .brand-logo {
        height: 52px;
    }

    .brand-copy strong {
        font-size: 19px;
    }

    .login-product-name {
        font-size: 24px;
    }
}
