/**
 * Property Tax Calc Engine - Base Styles
 * Slate and copper palette for propertytaxcalcs.com (slate #1E374D, copper #AF4F22,
 * gray #CED6DD). Override via per-calculator style.css if needed.
 */

/* ---- Conditional field visibility ---- */
.pt-calc-field-conditional.pt-calc-field-hidden {
    display: none !important;
}

/* ---- Wrapper ---- */
.pt-calc-wrapper {
    max-width: 760px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid #D8DFE5;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1E374D;
    box-sizing: border-box;
}
.pt-calc-wrapper * {
    box-sizing: border-box;
}

/* ---- Header ---- */
.pt-calc-header {
    margin-bottom: 1.75rem;
    text-align: center;
}
.pt-calc-logo {
    max-height: 48px;
    width: auto;
    margin-bottom: 1rem;
}
.pt-calc-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1E374D;
    line-height: 1.3;
}
.pt-calc-description {
    margin: 0;
    color: #55677A;
    font-size: 1rem;
    line-height: 1.5;
}

/* ---- Sections (fieldset groups) ---- */
.pt-calc-section {
    border: 1px solid #D8DFE5;
    border-radius: 10px;
    padding: 1.25rem 1.25rem 0.5rem;
    margin: 0 0 1.25rem 0;
    background: #F8FAFB;
}
.pt-calc-section-title {
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0 0.5rem;
    color: #AF4F22; /* deep blue - legal/professional trust */
}
.pt-calc-section-desc {
    margin: 0.25rem 0 1rem 0;
    color: #55677A;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ---- Inputs ---- */
.pt-calc-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) {
    .pt-calc-inputs {
        grid-template-columns: 1fr;
    }
    .pt-calc-wrapper {
        padding: 1.25rem;
    }
}
.pt-calc-field {
    display: flex;
    flex-direction: column;
}
.pt-calc-field label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: #1E374D;
}
.pt-calc-field label .required {
    color: #dc2626;
}
.pt-calc-field input[type="number"],
.pt-calc-field input[type="text"],
.pt-calc-field input[type="date"],
.pt-calc-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #AFBDC9;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    color: #1E374D;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pt-calc-field input:focus,
.pt-calc-field select:focus {
    outline: none;
    border-color: #AF4F22;
    box-shadow: 0 0 0 3px rgba(175, 79, 34, 0.18);
}

/* ---- Input with prefix/suffix (e.g., "sq ft" inline) ---- */
.pt-calc-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}
.pt-calc-input-wrap input {
    flex: 1;
    border-radius: 6px 0 0 6px;
}
.pt-calc-input-prefix,
.pt-calc-input-suffix {
    display: flex;
    align-items: center;
    padding: 0 0.7rem;
    background: #EDF1F4;
    border: 1px solid #AFBDC9;
    color: #55677A;
    font-size: 0.9rem;
    white-space: nowrap;
}
.pt-calc-input-prefix {
    border-right: none;
    border-radius: 6px 0 0 6px;
}
.pt-calc-input-suffix {
    border-left: none;
    border-radius: 0 6px 6px 0;
}
.pt-calc-input-wrap input:focus + .pt-calc-input-suffix {
    border-color: #AF4F22;
}

/* ---- Help text ---- */
.pt-calc-help {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: #55677A;
    line-height: 1.45;
}

/* ---- Radio / checkbox ---- */
.pt-calc-radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.pt-calc-radio-label,
.pt-calc-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
}

/* ---- Range slider ---- */
.pt-calc-range-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.pt-calc-range-wrap input[type="range"] {
    flex: 1;
}
.pt-calc-range-value {
    min-width: 80px;
    text-align: right;
    font-weight: 600;
    color: #AF4F22;
    font-variant-numeric: tabular-nums;
}

/* ---- Actions ---- */
.pt-calc-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.pt-calc-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.05s;
    font-family: inherit;
}
.pt-calc-submit {
    background: #AF4F22;
    color: #ffffff;
}
.pt-calc-submit:hover {
    background: #8F3F1A;
}
.pt-calc-submit:active {
    transform: translateY(1px);
}
.pt-calc-reset {
    background: #EDF1F4;
    color: #1E374D;
}
.pt-calc-reset:hover {
    background: #e5e7eb;
}

/* ---- Results ---- */
.pt-calc-results {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #F1F4F7; /* light blue */
    border: 1px solid #CED6DD;
    border-radius: 10px;
}
.pt-calc-results-title {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #8F3F1A;
}
.pt-calc-outputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) {
    .pt-calc-outputs {
        grid-template-columns: 1fr;
    }
}
.pt-calc-output {
    background: #ffffff;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid #CED6DD;
}
.pt-calc-output-label {
    display: block;
    font-size: 0.82rem;
    color: #55677A;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.pt-calc-output-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1E374D;
    font-variant-numeric: tabular-nums;
}
.pt-calc-output-emphasis {
    grid-column: 1 / -1;
    background: #1E374D;
    border-color: #1E374D;
}
.pt-calc-output-emphasis .pt-calc-output-label,
.pt-calc-output-emphasis .pt-calc-output-value {
    color: #ffffff;
}
.pt-calc-output-emphasis .pt-calc-output-value {
    font-size: 2rem;
}
/* Text outputs (verdicts, month names) read as a sentence, not a figure */
.pt-calc-output-text .pt-calc-output-value {
    font-size: 1.1rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.pt-calc-output-emphasis.pt-calc-output-text .pt-calc-output-value {
    font-size: 1.35rem;
}
.pt-calc-output-help {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: #55677A;
    line-height: 1.4;
}

/* ---- Breakdown table ---- */
.pt-calc-breakdown {
    margin-top: 1.5rem;
}
.pt-calc-breakdown-title {
    margin: 0 0 0.6rem 0;
    font-size: 0.95rem;
    color: #55677A;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pt-calc-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #CED6DD;
}
.pt-calc-breakdown-table td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #DCE3E9;
    font-size: 0.92rem;
    line-height: 1.4;
}
.pt-calc-breakdown-table tr:last-child td {
    border-bottom: none;
}
.pt-calc-breakdown-table td small {
    color: #55677A;
    font-size: 0.82rem;
}
.pt-calc-breakdown-amount {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.pt-calc-breakdown-note td {
    background: #F8FAFB;
    color: #55677A;
    font-style: italic;
}
/* Highlight the closing amount row only; a trailing note row stays a note */
.pt-calc-breakdown-table tr:last-child:not(.pt-calc-breakdown-note) {
    background: #F1F4F7;
    font-weight: 700;
}

/* ---- Explanation note ---- */
.pt-calc-explanation {
    margin: 1rem 0 0 0;
    padding: 0.8rem 1rem;
    background: #F8EFE9;
    border-left: 3px solid #AF4F22;
    border-radius: 4px;
    font-size: 0.88rem;
    color: #1E374D;
    line-height: 1.5;
}

/* ---- Sponsors ---- */
.pt-calc-sponsors {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px dashed #D8DFE5;
}
.pt-calc-sponsors-header {
    text-align: center;
    margin-bottom: 1rem;
}
.pt-calc-sponsors-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1E374D;
}
.pt-calc-sponsors-description {
    margin: 0;
    font-size: 0.85rem;
    color: #55677A;
}
.pt-calc-sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin-top: 0.75rem;
}
.pt-calc-sponsor-card {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #D8DFE5;
    border-radius: 8px;
    text-decoration: none;
    color: #1E374D;
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    min-height: 110px;
    justify-content: space-between;
}
.pt-calc-sponsor-card:hover {
    border-color: #AF4F22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.12);
    text-decoration: none;
}
.pt-calc-sponsor-logo {
    margin-bottom: 0.6rem;
    max-height: 32px;
}
.pt-calc-sponsor-logo img {
    max-height: 32px;
    width: auto;
}
.pt-calc-sponsor-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.pt-calc-sponsor-name {
    font-weight: 700;
    font-size: 0.98rem;
}
.pt-calc-sponsor-tagline {
    font-size: 0.82rem;
    color: #55677A;
    line-height: 1.35;
}
.pt-calc-sponsor-discount {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.15rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    align-self: flex-start;
}
.pt-calc-sponsor-coupon {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #55677A;
}
.pt-calc-sponsor-coupon code {
    background: #EDF1F4;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    color: #1E374D;
}
.pt-calc-sponsor-cta {
    margin-top: 0.6rem;
    font-weight: 600;
    color: #AF4F22;
    font-size: 0.88rem;
}
.pt-calc-sponsors-disclaimer {
    margin: 1rem 0 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: #8395A4;
    font-style: italic;
}

/* ---- Disclaimer ---- */
.pt-calc-disclaimer {
    margin: 1.25rem 0 0 0;
    padding-top: 1rem;
    border-top: 1px solid #D8DFE5;
    font-size: 0.8rem;
    color: #55677A;
    line-height: 1.5;
    font-style: italic;
}

/* ---- Errors ---- */
.pt-calc-error,
.pt-calc-error-message {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 0.95rem;
}
.pt-calc-results .pt-calc-error-message {
    margin-bottom: 0.75rem;
}
