/*
 * Tax Calculator - input on the left, label on the right.
 * Complete replacement for assets/css/tax-calculator.css.
 * Layout-only update: PHP, JavaScript, and country data stay unchanged.
 */

.tc-calc {
    font-family: inherit;
    max-width: 640px;
    color: #f2f2f2;
}

/* Keep each input and its label on the same row at every screen size. */
.tc-calc .tc-field {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: center;
    column-gap: 14px;
    row-gap: 6px;
    margin-bottom: 18px;
}

.tc-calc label,
.tc-calc legend {
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
}

/* The existing PHP puts labels first; visually place them on the right. */
.tc-calc .tc-field > label {
    grid-column: 2;
    grid-row: 1;
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
    text-align: left;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.tc-calc input[type="text"],
.tc-calc select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 10px;
    border: 1px solid #777;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    background: #ffffff;
    color: #111111;
}

/* All dropdowns and money inputs occupy the left column. */
.tc-calc .tc-field > input[type="text"],
.tc-calc .tc-field > select {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}

.tc-calc .tc-help {
    font-size: 13px;
    color: #bdbdbd;
    line-height: 1.4;
}

/* The standard-deduction explanation stays below its input/label row. */
.tc-calc .tc-field > .tc-help {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
}

.tc-calc input[readonly] {
    background: #e6e6e6;
    color: #111111;
}

.tc-calc .tc-fieldset {
    min-width: 0;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 14px;
    margin: 0 0 18px;
}

.tc-calc button#tc-calc-btn {
    background: #007cba;
    color: #ffffff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}

.tc-calc button#tc-calc-btn:hover,
.tc-calc button#tc-calc-btn:focus {
    background: #005a87;
}

.tc-calc .tc-error {
    color: #ff8a80;
    font-weight: 600;
    margin-top: 12px;
}

.tc-calc .tc-results {
    margin-top: 20px;
    padding: 16px;
    background: #222222;
    border: 1px solid #555555;
    border-radius: 6px;
}

.tc-calc .tc-results h3 {
    color: #ffffff;
    margin: 12px 0 8px;
    font-size: 18px;
}

.tc-calc .tc-results h3:first-child {
    margin-top: 0;
}

.tc-calc .tc-results p {
    color: #f2f2f2;
    margin: 6px 0;
}

.tc-calc .tc-results .tc-diff {
    font-size: 18px;
    font-weight: bold;
    color: #ffb74d;
    margin-top: 18px;
}

/* Preserve the JavaScript-controlled hidden state. */
.tc-calc [hidden] {
    display: none !important;
}

/* Keep the requested side-by-side layout, with a smaller gap on phones. */
@media (max-width: 480px) {
    .tc-calc .tc-field {
        column-gap: 10px;
    }
}
