/* Alameda County Assessor — Supplemental Tax Estimator (shared) */
:root {
    --color-primary: #002d62;
    --color-primary-hover: #001f47;
    --color-accent-blue: #e8f0fe;
    --color-accent-green: #e6f4ea;
    --color-accent-warn: #fff9e6;
    --color-text: #1a1a1a;
    --color-text-muted: #333;
    --color-link: #0047ab;
    --color-link-hover: #003080;
    --color-border: #d0d7de;
    --color-h1-rule: #2980b9;
    /* Pro-rata reference panel: matches bill-summary green + subtle border */
    --reference-panel-border: #b5d4be;
    --font-sans: Arial, Helvetica, "Segoe UI", sans-serif;
    --max-width: 1080px;
    --header-footer-pad: 1rem 1.25rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--color-text);
    background: #fff;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.75rem 1rem;
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    z-index: 10000;
    clip: auto;
}

a {
    color: var(--color-link);
    text-decoration: underline;
}

a:hover,
a:focus {
    color: var(--color-link-hover);
}

.site-header {
    background: var(--color-primary);
    color: #fff;
}

.site-header li a {
    padding: 6px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--header-footer-pad);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-brand img {
    height: 48px;
    width: auto;
    display: block;
}

.site-brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.site-brand-text small {
    display: block;
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.95;
}

.header-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.header-nav a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.header-nav a:hover,
.header-nav a:focus {
    color: #fff;
    text-decoration-thickness: 2px;
}

.page-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.page-wrap--estimator-start,
.page-wrap--results-wide {
    max-width: 1080px;
}

.results-entries-prorata-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    margin: 1.25rem 0 1.5rem;
}

.results-entries-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.results-entries-prorata-split .form-panel,
.results-entries-prorata-split .reference-panel {
    margin: 0;
}

/* Pro-rata reference column: same green as Supplemental Estimated Bill */
.reference-panel {
    background: var(--color-accent-green);
    border: 1px solid var(--reference-panel-border);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
}

.results-calc-panel .data-table {
    margin-top: 0;
}

.results-prorata-col .data-table {
    margin: 0;
}

.results-prorata-col .data-table caption {
    margin-bottom: 0.5rem;
}

/* Slightly tighter pro-rata table when beside entries */
.data-table--prorata-compact {
    font-size: 0.88rem;
}

.data-table--prorata-compact thead th,
.data-table--prorata-compact tbody td {
    padding: 0.45rem 0.5rem;
}

@media (max-width: 800px) {
    .results-entries-prorata-split {
        grid-template-columns: 1fr;
    }
}

.estimator-start-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1.25rem;
    margin: 1rem 0 1.5rem;
    align-items: stretch;
}

.estimator-start-split .form-panel {
    margin: 0;
}

.estimator-start-form .field-row input[type="text"],
.estimator-start-form .field-row input[type="date"] {
    max-width: 100%;
}

.estimator-start-instructions ul {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .estimator-start-split {
        grid-template-columns: 1fr;
    }
}

main h1 {
    color: var(--color-primary);
    line-height: 1.5em;
    font-size: 2em;
    font-weight: 500;
    border-bottom: 3px solid var(--color-h1-rule);
    padding-bottom: 10px;
}

main h2 {
    color: var(--color-primary);
    font-size: 1.2rem;
    margin: 1.75rem 0 0.75rem;
}

main h3 {
    color: var(--color-primary);
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
}

.callout > h2 {
    margin-top: 0;
}

main p {
    margin: 0 0 1rem;
    color: var(--color-text-muted);
}

main ul {
    margin: 0 0 1rem;
    padding-left: 1.35rem;
    color: var(--color-text-muted);
}

main li {
    margin-bottom: 0.35rem;
}

hr.section-rule {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

.callout {
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 1.5rem;
    border-radius: 2px;
}

.callout-warn {
    background: var(--color-accent-warn);
    border: 1px solid #e6d888;
    border-radius: 8px;
}

.callout-info {
    background: var(--color-accent-blue);
}

.callout-success {
    background: var(--color-accent-green);
}

.callout p:last-child,
.callout ul:last-child {
    margin-bottom: 0;
}

.form-panel {
    background: var(--color-accent-blue);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 2px;
}

.form-panel > h2 {
    margin-top: 0;
}

.form-panel section > h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--color-primary);
}

fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

legend {
    font-weight: 700;
    color: var(--color-primary);
    padding: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.field-row {
    margin-bottom: 1.1rem;
}

.field-row label {
    display: block;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.35rem;
}

.field-row .hint {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.field-row input[type="text"],
.field-row input[type="date"] {
    width: 100%;
    max-width: 22rem;
    padding: 0.5rem 0.65rem;
    font-size: 1rem;
    font-weight: 400;
    font-family: inherit;
    line-height: 1.5;
    color: var(--color-text);
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    box-sizing: border-box;
    min-height: calc(1.5em + 1rem + 2px);
}

/* Native date: keep light theme; inner segments use same font as text fields (WebKit/Blink). */
.field-row input[type="date"] {
    color-scheme: light;
}

.field-row input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.field-row input[type="date"]::-webkit-datetime-edit {
    padding: 0;
    font: inherit;
    color: inherit;
}

.field-row input[type="date"]::-webkit-datetime-edit-year-field,
.field-row input[type="date"]::-webkit-datetime-edit-month-field,
.field-row input[type="date"]::-webkit-datetime-edit-day-field {
    padding: 0 0.15em;
    font: inherit;
    color: inherit;
}

.field-row input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 0.35rem;
    margin-left: 0.35rem;
    opacity: 0.9;
    filter: grayscale(0.2);
}

.field-row input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.field-row input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.field-row input[readonly] {
    background: #fff;
    color: var(--color-text);
}

.roll-value-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.roll-value-link {
    margin: 0;
    padding-bottom: 0.35rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff !important;
    border: none;
    padding: 0.65rem 1.35rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 2px;
    text-decoration: none;
    display: inline-block;
}

a.btn-primary,
a.btn-secondary {
    text-decoration: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-primary-hover);
    color: #fff !important;
}

.btn-primary:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.btn-secondary {
    background: #fff;
    color: var(--color-primary) !important;
    border: 2px solid var(--color-primary);
    padding: 0.55rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 2px;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--color-accent-blue);
}

.results-region {
    margin: 2rem 0;
}

.results-region h2 {
    margin-top: 0;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

table.data-table caption {
    text-align: left;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

table.data-table thead th {
    background: var(--color-primary);
    color: #fff;
    text-align: left;
    padding: 0.65rem 0.75rem;
    font-weight: 700;
}

table.data-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    /* background: var(--color-accent-blue); */
    background: rgba(255, 255, 255, 0.5);
    
}

table.data-table tbody tr:nth-child(even) td {
    background: #fff;
}

/* Calculation / summary tables: row header (th) + value (td) */
table.data-table--calc tbody th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-primary);
    width: 52%;
}

table.data-table--calc tbody td {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

table.data-table--calc tbody tr:nth-child(odd) th,
table.data-table--calc tbody tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.5) !important;
}

table.data-table--calc tbody tr:nth-child(even) th,
table.data-table--calc tbody tr:nth-child(even) td {
    background: #fff;
}

table.data-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

table.data-table--prorata thead th:nth-child(n + 2),
table.data-table--prorata tbody td:nth-child(n + 2) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Highlight row matching sample purchase month (optional demo) */
table.data-table--prorata tbody tr.is-context-row td {
    font-weight: 700;
    box-shadow: inset 3px 0 0 0 var(--color-primary);
}

.help-box {
    background: var(--color-accent-blue);
    padding: 1.5rem 1.5rem 1.75rem;
    margin-top: 2.5rem;
    border-radius: 2px;
    text-align: center;
}

.help-box h2 {
    margin-top: 0;
    text-align: center;
}

.help-box .contact-block {
    text-align: left;
    max-width: 32rem;
    margin: 1rem auto 0;
    color: var(--color-text-muted);
}

.bill-summary {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--color-accent-green);
    border-radius: 2px;
}

.bill-summary h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.bill-summary dl {
    margin: 0;
    display: grid;
    gap: 0.5rem 1rem;
}

.bill-summary dt {
    font-weight: 600;
    color: var(--color-primary);
}

.bill-summary dd {
    margin: 0 0 0.75rem;
    color: var(--color-text-muted);
}

.bill-summary dd:last-of-type {
    margin-bottom: 0;
}

.pay-warning {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: var(--color-accent-warn);
    border-radius: 2px;
    font-weight: 600;
    color: var(--color-text);
}

.footer-stack {
    margin-top: 1rem;
}

.footer-stack--tight {
    margin-top: 0.75rem;
}

.site-footer {
    background: var(--color-primary);
    color: #fff;
    margin-top: 2rem;
}

.footer-columns {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem 2rem;
}

.footer-columns h2 {
    font-size: 1rem;
    margin: 0 0 0.65rem;
    color: #fff;
}

.footer-columns p,
.footer-columns address {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    font-style: normal;
}

.footer-columns a {
    color: #fff;
}

.footer-columns a:hover,
.footer-columns a:focus {
    text-decoration-thickness: 2px;
}

.footer-bar {
    background: #001a3d;
    padding: 0.65rem 1.25rem;
    text-align: center;
    font-size: 0.85rem;
}

.footer-bar p {
    margin: 0;
}

.footer-bar a {
    color: #fff;
}

/* Screen-reader-only helper (WCAG: content available to AT, not visually) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Results page: fixed values as text + hidden inputs; two editable fields */
.results-form {
    margin: 0;
}

.field-label {
    display: block;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.35rem;
}

.field-row--static .result-display {
    display: inline-block;
    min-width: min(100%, 22rem);
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: #f6f8fa;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.result-display--inline {
    display: inline;
    padding: 0;
    border: none;
    background: transparent;
    font-variant-numeric: tabular-nums;
}

table.data-table--calc label.calc-row-label {
    display: inline;
    margin: 0;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
}

table.data-table--calc tbody th .hint {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.calc-cell-editable {
    vertical-align: middle;
}

.calc-input-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
}

table.data-table--calc .calc-editable-input {
    width: 6.5rem;
    margin: 0;
    padding: 0.35rem 0.5rem;
    font-size: inherit;
    font-family: inherit;
    text-align: right;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: #fff;
    font-variant-numeric: tabular-nums;
}

table.data-table--calc .calc-editable-input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.calc-suffix {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

/* Form validation (WCAG 3.3.1 — errors not by color alone) */
.form-validation-status {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-left: 4px solid #b00020;
    background: #fdf2f2;
    color: #1a1a1a;
    font-weight: 600;
    display: none;
}

.form-validation-status.is-visible {
    display: block;
}

.field-error-msg {
    margin: 0.35rem 0 0;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #8a1538;
    display: none;
}

.field-error-msg.is-visible {
    display: block;
}

.field-error-msg--table {
    margin-top: 0.5rem;
    text-align: left;
}

input[aria-invalid="true"],
.calc-editable-input[aria-invalid="true"] {
    border-color: #b00020;
    box-shadow: 0 0 0 1px #b00020;
}

input:focus-visible,
.calc-editable-input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.refund-flag {
    display: inline-block;
    margin-left: 0.35rem;
    font-weight: 700;
    color: #5c4a00;
}

table.data-table--prorata tbody tr[aria-current="true"] td:first-child {
    font-weight: 700;
}

@media (max-width: 600px) {
    main h1 {
        font-size: 1.45rem;
    }
}
