/* ==========================================================================
   AFWC Forms — TEE Calculator
   ========================================================================== */

.afwc-form-wrapper {
    padding: 2rem 0 4rem;
}

/* Centered AFWC logo */
.afwc-logo-wrapper {
    text-align: center;
    margin-bottom: 1.5rem;
}

.afwc-logo {
    max-width: 350px;
    height: auto;
}

/* Form controls */
.afwc-form-wrapper .form-control {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hpwgreen);
}

.afwc-form-wrapper .form-control:focus {
    border-color: var(--hpwgreen);
    box-shadow: 0 0 0 0.2rem rgba(104, 117, 78, 0.25);
}

/* Inline label+input rows (matches PDF layout) */
.afwc-inline-grid {
    padding: 0.75rem 1rem;
}

.afwc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
    margin-bottom: 0.5rem;
}

.afwc-field-row:last-child {
    margin-bottom: 0;
}

.afwc-inline-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.afwc-inline-field label {
    font-weight: 500;
    color: #333;
    font-size: 1rem;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
}

.afwc-inline-field .form-control {
    flex: 1;
    min-width: 0;
    max-width: 140px;
}

/* Place field in the second grid column */
.afwc-field-right {
    grid-column: 2;
}

/* Buttons */
.afwc-btn {
    font-weight: 600;
    padding: 0.6rem 2rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.afwc-btn-calculate {
    background-color: var(--hpwgreen) !important;
    color: #fff !important;
    outline: none;
}

.afwc-btn-calculate:hover,
.afwc-btn-calculate:focus,
.afwc-btn-calculate:active {
    background-color: rgba(84, 97, 58, 1.00) !important;
    color: #fff !important;
    outline: none;
    box-shadow: none;
}

.afwc-btn-download {
    background-color: var(--hpwgreen) !important;
    color: #fff !important;
}

.afwc-btn-download:hover:not(:disabled),
.afwc-btn-download:focus:not(:disabled),
.afwc-btn-download:active:not(:disabled) {
    background-color: rgba(84, 97, 58, 1.00) !important;
    color: #fff !important;
    outline: none;
    box-shadow: none;
}

.afwc-btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.afwc-btn-reset {
    background-color: #fff;
    color: #333;
    border: 1px solid var(--hpwgreen);
    margin-left: 0.5rem;
}

.afwc-btn-reset:hover {
    background-color: rgba(104, 117, 78, 0.1);
    color: #333;
}

/* Card component — matches PDF's section boxes */
.afwc-card {
    border: 1px solid var(--hpwgreen);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
    padding: 0;
    min-width: 0;
}

/* Summary cards — no green header, just bordered box with bold title */
.afwc-summary-card {
    border: 1px solid var(--hpwgreen);
    border-radius: 1rem;
    background-color: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
    height: 100%;
}

.afwc-summary-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.afwc-card-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.afwc-card-body {
    background-color: #fff;
    padding: 1rem;
}

/* Override .headline defaults within the form wrapper */
.afwc-form-wrapper .headline > div {
    margin: 2rem 0 1.5rem;
    border-radius: .5rem;
}

.afwc-form-wrapper .headline > div > h5 {
    text-transform: none;
}

/* Percentage total validation */
.afwc-pct-line { margin-top: 0.5rem; font-weight: 600; }
.afwc-pct-line.valid { color: var(--hpwgreen); }
.afwc-pct-line.invalid { color: #c0392b; }

/* Macro TEE label in summary card */
.afwc-macro-tee {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.afwc-macro-tee span {
    font-weight: 700;
    color: var(--hpwgreen);
}

/* Results tables */
.afwc-results-table {
    width: 100%;
    border-collapse: collapse;
}

.afwc-results-table th,
.afwc-results-table td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(104, 117, 78, 0.5);
    font-size: 0.85rem;
}

.afwc-results-table th {
    font-weight: 600;
    color: #333;
    width: 55%;
}

.afwc-results-table td {
    color: var(--hpwgreen);
    font-weight: 700;
}

/* Macro grid */
.afwc-macro-table {
    width: 100%;
    border-collapse: collapse;
}

.afwc-macro-table th,
.afwc-macro-table td {
    padding: 0.4rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(104, 117, 78, 0.5);
    font-size: 0.85rem;
}

.afwc-macro-table th {
    background-color: transparent;
    font-weight: 600;
    color: #333;
}

.afwc-macro-table td {
    color: var(--hpwgreen);
    font-weight: 700;
}

.afwc-macro-table td:first-child {
    color: #333;
    font-weight: 600;
}

.afwc-macro-table td:first-child,
.afwc-macro-table th:first-child {
    text-align: left;
}

/* Chart wrapper */
.afwc-chart-wrapper {
    background: #fff;
    border: 1px solid rgba(104, 117, 78, 0.5);
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

/* Inline unit toggle */
.afwc-unit-note {
    font-size: 0.8rem;
    color: #888;
    font-weight: 400;
}

/* Responsive — tablet */
@media (max-width: 768px) {
    .afwc-inline-field .form-control {
        max-width: none;
    }
}

/* Responsive — mobile */
@media (max-width: 576px) {
    .afwc-field-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .afwc-field-right {
        grid-column: auto;
    }

    .afwc-inline-field .form-control {
        max-width: none;
    }
}

/* Printable area — hidden on screen */
.afwc-printable {
    display: none;
}

/* Printable area styling (used by html2pdf) */
.afwc-printable-content {
    font-family: 'Open Sans', Arial, sans-serif;
    color: #333;
    padding: 0.25in;
    max-width: 7.5in;
}

.afwc-printable-content h2 {
    color: #333;
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.afwc-printable-content .print-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.afwc-printable-content .print-divider {
    border: none;
    border-top: 3px solid #333;
    margin: 0.75rem 0;
}

.afwc-printable-content h4 {
    color: #333;
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    font-weight: 700;
}

.afwc-printable-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.afwc-printable-content table th,
.afwc-printable-content table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

.afwc-printable-content table th {
    background-color: transparent;
    font-weight: 600;
    color: #333;
}

.afwc-printable-content table tr:last-child th,
.afwc-printable-content table tr:last-child td {
    border-bottom: none;
}

.afwc-printable-content .print-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #aaa;
    text-align: center;
}
