:root {
    --brand-green: #166534;
    --brand-green-dark: #14532d;
    --brand-green-soft: #dcfce7;
    --brand-green-light: #f0fdf4;
    --text-primary: #17202a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --surface: #ffffff;
    --page-bg: #f5f7f9;
}

html { min-height: 100%; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
    color: var(--text-primary);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main { flex: 1; }
a { text-decoration: none; }

.customer-navbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.brand-link, .auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 500;
}
.brand-link:hover, .auth-brand:hover { color: var(--brand-green); }
.brand-mark {
    width: 37px;
    height: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--brand-green);
    color: #fff;
    font-size: 16px;
}
.brand-link strong, .auth-brand strong { color: var(--brand-green); font-weight: 800; }
.navbar-portal-link { color: #475569; font-size: 13px; font-weight: 600; }
.navbar-portal-link:hover { color: var(--brand-green); }
.customer-footer {
    padding: 20px 0;
    background: #fff;
    border-top: 1px solid var(--border);
    color: #94a3b8;
    font-size: 11px;
}

/* Authentication */
.auth-page {
    min-height: calc(100vh - 125px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 16px;
    background: radial-gradient(circle at top, #effcf3 0, #f5f7f9 42%, #f5f7f9 100%);
}
.auth-card {
    width: 100%;
    max-width: 455px;
    padding: 34px 36px 28px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .07);
}
.auth-brand { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--brand-green);
    background: var(--brand-green-light);
    border: 1px solid #bbf7d0;
    border-radius: 17px;
    font-size: 22px;
}
.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--brand-green);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.35px;
}
.auth-title { margin: 0 0 9px; color: #0f172a; font-size: 25px; font-weight: 800; }
.auth-description { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.email-destination {
    display: inline-flex;
    align-items: center;
    margin-top: 15px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 25px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 650;
}
.input-icon-wrap { position: relative; }
.input-icon-wrap > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #94a3b8;
}
.input-icon-wrap .form-control { padding-left: 43px; }
.auth-card .form-control { min-height: 50px; border-color: #cbd5e1; border-radius: 9px; }
.auth-card .form-control:focus { border-color: var(--brand-green); box-shadow: 0 0 0 3px rgba(22, 101, 52, .10); }
.code-input { height: 58px; text-align: center; font-size: 25px; font-weight: 800; letter-spacing: 10px; }
.auth-submit { min-height: 51px; border: 0; border-radius: 9px; background: var(--brand-green); font-size: 14px; font-weight: 750; }
.auth-submit:hover { background: var(--brand-green-dark); }
.auth-divider { display: flex; align-items: center; gap: 13px; margin: 27px 0 20px; color: #94a3b8; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.company-login-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f8fafc;
    color: #334155;
    transition: .2s ease;
}
.company-login-link:hover { border-color: #bbf7d0; background: var(--brand-green-light); color: var(--brand-green); }
.company-login-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 10px; background: #dcfce7; color: var(--brand-green); }
.company-login-text { display: flex; flex-direction: column; gap: 3px; }
.company-login-text strong { font-size: 12px; }
.company-login-text small { color: var(--text-secondary); font-size: 10px; }
.company-login-link > i:last-child { margin-left: auto; font-size: 12px; }
.auth-footer { margin-top: 24px; text-align: center; }
.auth-footer > a { color: var(--text-secondary); font-size: 11px; }
.auth-footer > a:hover { color: var(--brand-green); }
.security-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 17px; color: #94a3b8; font-size: 10px; }
.security-note i { color: var(--brand-green); }

/* Dashboard */
.portal-page { min-height: calc(100vh - 125px); background: var(--page-bg); }
.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 190px;
    padding: 32px 36px;
    border: 1px solid #ccebd4;
    border-radius: 18px;
    background: linear-gradient(115deg, #f0fdf4 0%, #fff 80%);
}
.dashboard-hero h1 { margin: 0 0 8px; color: #0f172a; font-size: 28px; font-weight: 800; }
.dashboard-hero p { margin: 0 0 13px; color: var(--text-secondary); font-size: 14px; }
.hero-email { color: var(--brand-green); font-size: 12px; font-weight: 650; }
.hero-illustration { width: 124px; height: 124px; flex: 0 0 124px; display: grid; place-items: center; margin-right: 38px; border-radius: 30px; background: rgba(22, 101, 52, .09); color: var(--brand-green); font-size: 53px; transform: rotate(-7deg); }
.metric-card { height: 100%; display: flex; align-items: center; gap: 15px; padding: 19px 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.metric-icon { width: 47px; height: 47px; flex: 0 0 47px; display: grid; place-items: center; border-radius: 13px; font-size: 19px; }
.metric-icon.green { color: #166534; background: #dcfce7; }
.metric-icon.blue { color: #1d4ed8; background: #dbeafe; }
.metric-card span { display: block; margin-bottom: 3px; color: var(--text-secondary); font-size: 11px; }
.metric-card strong { color: #0f172a; font-size: 24px; font-weight: 800; }
.content-card { padding: 25px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 4px 15px rgba(15, 23, 42, .025); }
.content-card-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.content-card-header h2 { margin: 0 0 5px; color: #0f172a; font-size: 18px; font-weight: 800; }
.content-card-header p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.request-list { display: flex; flex-direction: column; }
.request-row { display: flex; align-items: center; gap: 15px; padding: 19px 0; border-top: 1px solid #edf0f4; }
.request-row:first-child { border-top: 0; }
.request-row-icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; background: #f0fdf4; color: var(--brand-green); font-size: 17px; }
.request-main { flex: 1; min-width: 0; }
.request-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.request-title-row h3 { margin: 0; color: #17202a; font-size: 14px; font-weight: 750; }
.source-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 30px; background: #eff6ff; color: #1d4ed8; font-size: 9px; font-weight: 750; }
.request-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 8px; color: var(--text-secondary); font-size: 10px; }
.request-meta i { margin-right: 4px; color: #94a3b8; }
.request-bottom-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin-top: 8px; }
.offers-count { color: var(--brand-green); font-size: 10px; font-weight: 750; }
.request-open-btn { flex: 0 0 auto; border-radius: 8px; font-size: 11px; }
.empty-state { padding: 56px 20px; text-align: center; }
.empty-state > i { display: block; margin-bottom: 17px; color: #94a3b8; font-size: 39px; }
.empty-state h2, .empty-state h3 { color: #17202a; font-size: 17px; font-weight: 800; }
.empty-state p { color: var(--text-secondary); font-size: 12px; }

/* Request details */
.back-link { color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.back-link:hover { color: var(--brand-green); }
.detail-heading h1 { margin: 13px 0 5px; color: #0f172a; font-size: 23px; font-weight: 800; }
.detail-heading p { color: var(--text-secondary); font-size: 13px; }
.detail-block { margin-top: 20px; }
.detail-label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 11px; font-weight: 750; }
.description-box { padding: 17px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; color: #334155; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.side-card-title { margin-bottom: 18px; font-size: 15px; font-weight: 800; }
.side-detail { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid #edf0f4; font-size: 11px; }
.side-detail span { color: var(--text-secondary); }
.side-detail strong { color: #334155; text-align: right; }
.compare-prompt { padding: 22px; border: 1px solid #ccebd4; border-radius: 15px; background: linear-gradient(145deg, #f0fdf4, #fff); }
.compare-prompt-icon { width: 43px; height: 43px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 12px; background: #dcfce7; color: var(--brand-green); font-size: 18px; }
.compare-prompt h2 { margin: 0 0 7px; font-size: 17px; font-weight: 800; }
.compare-prompt p { color: var(--text-secondary); font-size: 12px; line-height: 1.6; }

/* Offer comparison */
.comparison-heading h1 { margin: 0 0 8px; color: #0f172a; font-size: 29px; font-weight: 850; }
.comparison-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.comparison-summary strong { margin-right: 7px; color: var(--brand-green); font-size: 14px; }
.comparison-summary span { color: var(--text-secondary); font-size: 11px; }
.comparison-hint i { color: var(--brand-green); }
.offer-compare-scroll { width: 100%; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.offer-compare-grid { display: grid; grid-template-columns: repeat(var(--offer-count), minmax(270px, 1fr)); gap: 15px; min-width: max-content; align-items: stretch; }
.offer-compare-card { width: min(315px, 82vw); display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: 0 4px 16px rgba(15, 23, 42, .035); }
.offer-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.offer-company-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #f0fdf4; color: var(--brand-green); }
.offer-ref { color: #94a3b8; font-size: 10px; font-weight: 700; }
.offer-compare-card h2 { margin: 0 0 5px; color: #17202a; font-size: 16px; font-weight: 800; }
.offer-card-subject { min-height: 30px; color: var(--text-secondary); font-size: 11px; }
.offer-total-label { margin-top: 13px; color: var(--text-secondary); font-size: 10px; }
.offer-total { margin: 2px 0 12px; color: var(--brand-green); font-size: 25px; font-weight: 850; letter-spacing: -.6px; }
.offer-total small { font-size: 11px; font-weight: 700; letter-spacing: 0; }
.offer-price-breakdown { padding: 10px 0; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; }
.offer-price-breakdown > div, .offer-terms > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 10px; }
.offer-price-breakdown span, .offer-terms span { color: var(--text-secondary); }
.offer-price-breakdown strong, .offer-terms strong { color: #334155; font-weight: 700; text-align: right; }
.offer-compare-section-title { margin-bottom: 8px; color: #334155; font-size: 11px; font-weight: 800; }
.offer-line-list { display: flex; flex-direction: column; gap: 9px; }
.offer-line-item { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px dashed #e2e8f0; }
.offer-line-item > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.offer-line-item strong { color: #334155; font-size: 10px; }
.offer-line-item small { color: var(--text-secondary); font-size: 9px; line-height: 1.45; }
.offer-line-total { flex: 0 0 auto; }
.offer-terms { padding-top: 2px; }
.offer-summary-box { margin-top: 13px; padding: 11px; border-radius: 9px; background: #f8fafc; color: #475569; font-size: 10px; line-height: 1.6; }
.offer-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 17px; color: #94a3b8; font-size: 9px; }
.comparison-note { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.comparison-note i { margin-top: 2px; color: var(--brand-green); }
.comparison-note p { margin: 0; color: var(--text-secondary); font-size: 11px; line-height: 1.6; }

@media (max-width: 575.98px) {
    .auth-card { padding: 28px 20px 23px; border-radius: 16px; }
    .auth-title { font-size: 22px; }
    .dashboard-hero { min-height: auto; padding: 25px 21px; }
    .dashboard-hero h1 { font-size: 22px; }
    .hero-illustration { width: 65px; height: 65px; flex-basis: 65px; margin-right: 0; border-radius: 18px; font-size: 28px; }
    .content-card { padding: 18px 15px; }
    .request-row { align-items: flex-start; gap: 10px; }
    .request-row-icon { width: 37px; height: 37px; flex-basis: 37px; font-size: 14px; }
    .request-open-btn { align-self: center; padding: 6px 8px; }
    .request-meta { gap: 5px 9px; }
    .comparison-heading h1 { font-size: 24px; }
}

@media print {
    .customer-navbar, .customer-footer, .no-print { display: none !important; }
    body, .portal-page { background: #fff; }
    .offer-compare-scroll { overflow: visible; }
    .offer-compare-grid { min-width: 0; grid-template-columns: repeat(2, 1fr); }
    .offer-compare-card { break-inside: avoid; box-shadow: none; }
}
