:root {
    --navy: #17324d;
    --navy-2: #244866;
    --yellow: #f3c82e;
    --yellow-soft: #fff8d7;
    --ink: #17212b;
    --muted: #647383;
    --line: #dce4ea;
    --surface: #ffffff;
    --page: #f3f6f8;
    --success: #19764a;
    --success-soft: #e8f6ef;
    --danger: #b3261e;
    --danger-soft: #fff0ef;
    --shadow: 0 16px 40px rgba(21, 47, 70, .09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { -webkit-tap-highlight-color: transparent; }

.topbar {
    min-height: 76px;
    background: var(--navy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px max(24px, calc((100vw - 1120px) / 2));
    box-shadow: 0 4px 16px rgba(16, 39, 58, .18);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
    width: 52px; height: 56px; border-radius: 0; display: grid; place-items: center;
    background: transparent; color: var(--navy); font-weight: 900; letter-spacing: -.5px;
    border: 0; overflow: visible; flex: 0 0 auto;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; color: #c9d7e3; letter-spacing: .18em; font-weight: 700; margin-top: 2px; }
.user-area { display: flex; align-items: center; gap: 14px; }
.user-area form { margin: 0; }
.user-email { font-size: 14px; color: #dce7ef; }

.page-shell { width: min(1120px, calc(100% - 32px)); margin: 40px auto 64px; min-height: calc(100vh - 190px); }
.footer { color: var(--muted); text-align: center; font-size: 13px; padding: 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading.compact { align-items: flex-start; }
.page-heading h1 { margin: 4px 0 7px; color: var(--navy); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.page-heading p { margin: 0; }
.eyebrow { color: #856b00; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.muted { color: var(--muted); line-height: 1.55; }
.date-chip { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; color: var(--navy); font-weight: 650; box-shadow: 0 4px 14px rgba(21,47,70,.05); }
.back-link { display: inline-block; color: var(--navy-2); font-size: 14px; font-weight: 700; text-decoration: none; margin-bottom: 10px; }
.back-link:hover, .text-link:hover { text-decoration: underline; }

.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.action-card {
    display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
    min-height: 190px; padding: 28px; background: white; border: 1px solid var(--line);
    border-radius: 18px; text-decoration: none; box-shadow: var(--shadow); transition: transform .18s, border-color .18s;
}
.action-card:hover { transform: translateY(-3px); border-color: #b7c9d6; }
.action-card h2 { color: var(--navy); margin: 0 0 8px; }
.action-card p { color: var(--muted); line-height: 1.55; margin: 0; }
.action-icon { width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center; font-size: 32px; font-weight: 500; background: var(--yellow-soft); color: #785f00; }
.action-arrow { color: var(--navy); font-size: 28px; }
.info-strip { margin-top: 22px; padding: 18px 22px; border-radius: 14px; background: #eaf1f6; color: var(--navy); display: flex; gap: 14px; align-items: center; }
.info-strip span { color: var(--muted); }

.panel, .auth-card, .result-card, .verify-card { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.panel { padding: clamp(22px, 4vw, 36px); }
.auth-card { width: min(460px, 100%); margin: 72px auto; padding: 36px; }
.auth-card h1 { color: var(--navy); margin: 8px 0; font-size: 32px; }
.text-link { display: block; text-align: center; color: var(--navy-2); font-weight: 700; margin-top: 22px; font-size: 14px; }

.form-stack { display: grid; gap: 18px; margin-top: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.field-wide { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: var(--navy); font-size: 14px; font-weight: 750; }
input, select, textarea {
    width: 100%; border: 1px solid #bdcbd5; border-radius: 10px; background: white; color: var(--ink);
    padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(36,72,102,.13); }
.date-field { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.date-picker { position: relative; display: block; width: 100%; }
.date-display { padding-right: 44px; font-variant-numeric: tabular-nums; letter-spacing: .03em; background: white; cursor: pointer; }
.date-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.date-calendar { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--navy); font-size: 15px; pointer-events: none; z-index: 1; }
.date-picker:focus-within .date-display { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(36,72,102,.13); }
.field-help { color: var(--muted); font-size: 12px; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; align-items: center; margin-top: 12px; }
.button {
    appearance: none; border: 1px solid transparent; border-radius: 10px; padding: 12px 18px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
    font-weight: 800; cursor: pointer; transition: filter .15s, transform .15s;
}
.button:hover { filter: brightness(.97); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; filter: grayscale(.25); transform: none; }
.button-primary { background: var(--navy); color: white; }
.button-secondary { background: white; color: var(--navy); border-color: #b9c8d3; }
.button-ghost-light { background: transparent; color: var(--navy); border-color: transparent; }
.button-ghost { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.25); }
.button-small { padding: 8px 12px; font-size: 13px; }
.button-block { width: 100%; }
.button-download { background: #eef3f6; color: var(--navy); border-color: #d4e0e7; min-width: 72px; }

.alert { border-radius: 11px; padding: 13px 16px; margin-bottom: 16px; font-weight: 650; border: 1px solid; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f1c1bd; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #bce2cf; }
.notice { background: var(--yellow-soft); color: #63520b; padding: 14px 16px; border: 1px solid #edda81; border-radius: 10px; line-height: 1.5; margin-top: 22px; }

.summary-list, .verify-details { margin: 0; }
.summary-list > div, .verify-details > div { display: grid; grid-template-columns: 190px 1fr; gap: 22px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.summary-list > div:first-child, .verify-details > div:first-child { padding-top: 0; }
.summary-list dt, .verify-details dt { color: var(--muted); font-weight: 650; }
.summary-list dd, .verify-details dd { margin: 0; color: var(--ink); font-weight: 700; line-height: 1.45; }

.list-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.list-toolbar .button-ghost { color: var(--navy); border-color: #b9c8d3; background: #f5f8fa; }
.workflow-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.workflow-step { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.workflow-step > span { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--navy); font-weight: 900; }
.workflow-step strong { color: var(--navy); font-size: 14px; }
.workflow-step small { color: var(--muted); margin-top: 2px; }
.filter-panel { margin-bottom: 20px; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 18px; }
.section-heading h2 { color: var(--navy); margin: 3px 0 5px; font-size: 22px; }
.section-heading p { color: var(--muted); margin: 0; line-height: 1.45; }
.step-kicker { color: #836900; text-transform: uppercase; font-size: 11px; letter-spacing: .13em; font-weight: 900; }
.filter-form { display: flex; align-items: end; gap: 18px; padding: 18px; background: #f2f6f8; border: 1px solid #d5e0e7; border-radius: 12px; }
.filter-form label { flex: 1; max-width: 440px; }
.filter-form label small, .renewal-dates label small { color: var(--muted); font-weight: 500; line-height: 1.35; }
.filter-actions { display: flex; gap: 10px; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.quick-filters a { color: var(--navy); background: white; border: 1px solid #c7d5de; border-radius: 999px; padding: 7px 11px; text-decoration: none; font-weight: 750; }
.quick-filters a:hover { background: #edf3f6; }
.renewal-panel { margin-top: 20px; }
.filter-compact { margin-bottom: 18px; padding: 14px 18px; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 8px 22px rgba(21,47,70,.05); }
.filter-compact form { display: flex; align-items: end; gap: 10px; }
.filter-compact label { width: min(330px, 100%); }
.filter-compact label small { color: var(--muted); font-weight: 500; }
.filter-compact p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.renewal-panel-simple { padding-top: 28px; }
.eligibility-notice { display: flex; flex-direction: column; gap: 4px; margin-bottom: 22px; padding: 14px 16px; border-radius: 11px; border: 1px solid; }
.eligibility-notice.blocked { color: #785600; background: var(--yellow-soft); border-color: #e8d678; }
.eligibility-notice.available { color: var(--success); background: var(--success-soft); border-color: #b8ddca; }
.eligibility-notice span { font-size: 13px; line-height: 1.4; }
.simple-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 15px; }
.simple-section-heading h2 { color: var(--navy); margin: 0 0 4px; font-size: 21px; }
.simple-section-heading p { color: var(--muted); margin: 0; }
.company-heading { margin-top: 4px; padding-top: 22px; border-top: 1px solid var(--line); }
.renewal-dates { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 18px; align-items: end; padding: 20px; margin: -10px 0 24px; background: #edf3f7; border: 1px solid #d1dee7; border-radius: 14px; }
.compact-dates { margin-top: 0; margin-bottom: 22px; padding: 17px; }
.renewal-summary { min-height: 70px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 16px; background: white; border-radius: 10px; border-left: 4px solid var(--yellow); }
.renewal-summary span { color: var(--muted); font-size: 13px; }
.renewal-summary strong { color: var(--navy); font-size: 18px; }
.status-legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 16px 4px 8px; color: var(--muted); font-size: 13px; }
.compact-legend { padding-top: 5px; }
.status-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-dot.expired { background: var(--danger); }
.legend-dot.soon { background: #c88900; }
.legend-dot.active { background: var(--success); }
.check-list { display: grid; margin: 8px 0 20px; }
.check-row { display: grid; grid-template-columns: auto minmax(180px, 1fr) minmax(190px, auto) auto; align-items: center; gap: 16px; padding: 15px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row:hover { background: #f7fafb; }
.check-row.not-renewable { background: #f7f9fa; cursor: not-allowed; }
.check-row.not-renewable:hover { background: #f7f9fa; }
.check-row.not-renewable .company-info, .check-row.not-renewable .expiry-info { opacity: .72; }
.check-row input { width: 20px; height: 20px; accent-color: var(--navy); }
.check-row input:disabled { cursor: not-allowed; }
.check-row span { display: grid; gap: 3px; }
.check-row small { color: var(--muted); font-weight: 500; }
.expiry-info { text-align: right; }
.expiry-info strong { color: var(--navy); font-size: 14px; }
.status-badge { display: inline-flex !important; align-items: center; justify-content: center; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-expired { color: var(--danger); background: var(--danger-soft); }
.status-soon { color: #825b00; background: var(--yellow-soft); }
.status-active { color: var(--success); background: var(--success-soft); }
.status-unknown { color: var(--muted); background: #edf1f4; }
.renewal-state { justify-items: end; text-align: right; }
.renewal-state small { margin-top: 4px; max-width: 180px; }
.confirmation-meta { display: flex; justify-content: space-between; gap: 20px; padding: 0 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.confirmation-meta strong { color: var(--navy); }
.date-confirmation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.date-confirmation-grid > div { display: grid; gap: 5px; padding: 16px; background: #f3f7f9; border-radius: 10px; }
.date-confirmation-grid span { color: var(--muted); font-size: 13px; }
.date-confirmation-grid strong { color: var(--navy); }
.selected-list { display: grid; gap: 12px; padding: 22px 0 4px; }
.selected-list div { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.selected-list .selected-renewal-row { display: grid; grid-template-columns: auto 1fr auto; }
.selected-renewal-row small { color: var(--muted); font-weight: 500; }
.selection-heading { margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.selection-feedback { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 15px; border-radius: 10px; background: var(--yellow-soft); color: #695500; border: 1px solid #e9d77e; }
.selection-feedback.ready { background: var(--success-soft); color: var(--success); border-color: #b8ddca; }
.selection-feedback strong { white-space: nowrap; }
.explanatory-empty strong { color: var(--navy); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }

.empty-state { text-align: center; padding-block: 60px; }
.empty-state h1, .empty-state h2 { color: var(--navy); }
.empty-state p { color: var(--muted); }
.empty-icon { width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow-soft); color: #725b00; font-size: 24px; font-weight: 900; }
.success-badge { display: inline-flex; color: var(--success); background: var(--success-soft); padding: 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 850; }
.result-list { display: grid; gap: 14px; }
.result-card { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.result-card h2 { color: var(--navy); margin: 5px 0; font-size: 21px; }
.result-card p { color: var(--muted); margin: 0; }
.code-label, .verify-code { font: 800 12px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: #796200; }
.download-group { display: flex; gap: 8px; }

.public-page { background: linear-gradient(145deg, #edf2f5 0%, #f9fafb 55%, #fff8d7 100%); }
.verify-wrap { width: min(760px, 100%); margin: 30px auto; }
.verify-card { overflow: hidden; padding: clamp(24px, 5vw, 44px); border-top: 7px solid var(--navy); }
.verify-card.valid { border-top-color: var(--success); }
.verify-card.expired, .verify-card.invalid { border-top-color: #9a6b00; }
.verify-status { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.verify-status > div { display: grid; gap: 3px; }
.verify-status span:not(.verify-icon) { color: var(--muted); font-size: 13px; }
.verify-status strong { color: var(--success); font-size: 20px; }
.expired .verify-status strong { color: #8b6500; }
.verify-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); font-size: 25px; font-weight: 900; }
.expired .verify-icon, .invalid .verify-icon { background: var(--yellow-soft); color: #8b6500; }
.verify-card h1 { color: var(--navy); font-size: clamp(27px, 5vw, 40px); margin: 8px 0 30px; }
.verify-footnote { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 13px; }

@media (max-width: 760px) {
    .topbar { padding: 12px 16px; }
    .user-email { display: none; }
    .page-shell { width: min(100% - 24px, 1120px); margin-top: 24px; }
    .action-grid, .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .action-card { min-height: 160px; padding: 22px; grid-template-columns: auto 1fr; }
    .action-arrow { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .info-strip { align-items: flex-start; flex-direction: column; }
    .summary-list > div, .verify-details > div { grid-template-columns: 1fr; gap: 5px; }
    .result-card { align-items: flex-start; flex-direction: column; }
    .download-group { width: 100%; }
    .download-group .button { flex: 1; }
    .list-toolbar { align-items: stretch; flex-direction: column; }
    .workflow-steps { grid-template-columns: 1fr; }
    .filter-form, .section-heading { align-items: stretch; flex-direction: column; }
    .filter-compact form, .simple-section-heading { align-items: stretch; flex-direction: column; }
    .filter-compact form .button { width: 100%; }
    .filter-form label { max-width: none; }
    .filter-actions { flex-direction: column; }
    .filter-actions .button { width: 100%; }
    .renewal-dates, .date-confirmation-grid { grid-template-columns: 1fr; }
    .check-row { grid-template-columns: auto 1fr; }
    .expiry-info { text-align: left; grid-column: 2; }
    .status-badge { grid-column: 2; justify-self: start; }
    .renewal-state { grid-column: 2; justify-items: start; text-align: left; }
    .selected-list .selected-renewal-row { grid-template-columns: auto 1fr; }
    .selected-renewal-row small { grid-column: 2; }
    .selection-feedback { align-items: flex-start; flex-direction: column; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .auth-card { margin: 30px auto; padding: 26px; }
}

@media (max-width: 480px) {
    .brand strong { font-size: 14px; }
    .brand-mark { width: 44px; height: 48px; }
    .topbar .button { font-size: 0; width: 40px; height: 40px; padding: 0; }
    .topbar .button::after { content: '↪'; font-size: 18px; }
    .action-card { grid-template-columns: 1fr; }
    .action-icon { width: 48px; height: 48px; }
}

