/**
 * Roofing Calculator Styles
 * Roofing Calculator localized styles (ZH-TW)
 *
 * @package Zipper
 */

.rfc-hidden,
.rfc-waiting[hidden],
.rfc-panel[hidden] {
    display: none !important;
}

.rfc-intro {
    display: grid;
    gap: 10px;
}

.rfc-lead {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.7;
    color: #5f5a56;
}

.rfc-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e8e4dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rfc-preset-section,
.rfc-tip-section {
    background: #fffdf9;
}

.rfc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
}

.rfc-section-title i,
.rfc-note-card i,
.rfc-disclaimer i {
    color: #d4af37;
}

.rfc-toggle-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rfc-toggle-btn {
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    color: #5f5a56;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rfc-toggle-btn:hover,
.rfc-toggle-btn:focus {
    outline: none;
    border-color: #d4af37;
    color: #8a6500;
}

.rfc-toggle-btn.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.18);
}

.rfc-mode-help,
.rfc-field-hint,
.rfc-table-note,
.rfc-flow-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #7a756d;
}

.rfc-panel {
    display: flex;
}

.rfc-panel.rfc-hidden {
    display: none !important;
}

.rfc-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.rfc-field-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.rfc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.rfc-field-full {
    grid-column: 1 / -1;
}

.rfc-label {
    font-size: 13px;
    font-weight: 700;
    color: #5f5a56;
}

.rfc-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.rfc-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #fff;
    color: #2d2a26;
    font-size: 15px;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.rfc-input:hover {
    border-color: #d4c67a;
}

.rfc-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.rfc-input[aria-invalid="true"] {
    border-color: #c65b49;
    box-shadow: 0 0 0 3px rgba(198, 91, 73, 0.12);
    background: #fff7f5;
}

.rfc-input-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.rfc-note-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #efe0a8;
    background: #fcf7e8;
    font-size: 13px;
    line-height: 1.6;
    color: #6c6244;
}

.rfc-btn-group {
    display: flex;
    gap: 8px;
}

.rfc-btn-group .tool-btn {
    flex: 1 1 0;
}

.rfc-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rfc-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rfc-preset-btn:hover,
.rfc-preset-btn:focus,
.rfc-preset-btn.is-active {
    outline: none;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
}

.rfc-tip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding-left: 18px;
    color: #5f5a56;
    font-size: 14px;
    line-height: 1.6;
}

.rfc-waiting {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 24px 20px;
    border: 1px solid #f1d6bf;
    border-radius: 14px;
    background: #fff8f1;
    color: #9e6f46;
}

.rfc-waiting i {
    font-size: 28px;
}

.rfc-result-primary {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.14) 0%, rgba(255, 255, 255, 0.96) 54%, rgba(232, 228, 220, 0.72) 100%);
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 10px 24px rgba(45, 42, 38, 0.08);
}

.rfc-primary-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.rfc-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.rfc-status-badge.is-neutral {
    background: rgba(255, 255, 255, 0.88);
    color: #7a756d;
    border: 1px solid rgba(232, 228, 220, 0.9);
}

.rfc-status-badge.is-live {
    background: rgba(212, 175, 55, 0.16);
    color: #8a6500;
    border: 1px solid rgba(212, 175, 55, 0.32);
}

.rfc-status-badge.is-warning {
    background: rgba(198, 91, 73, 0.12);
    color: #a34d3e;
    border: 1px solid rgba(198, 91, 73, 0.26);
}

.rfc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #8a6500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rfc-copy-btn:hover,
.rfc-copy-btn:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.16);
}

.rfc-primary-title {
    font-size: 14px;
    font-weight: 700;
    color: #8a6500;
}

.rfc-primary-value {
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #2d2a26;
    word-break: break-word;
}

.rfc-primary-value .unit {
    margin-left: 6px;
    font-size: 0.42em;
    letter-spacing: 0;
    color: #8a6500;
}

.rfc-primary-label {
    font-size: 14px;
    font-weight: 700;
    color: #5f5a56;
}

.rfc-primary-summary,
.rfc-formula-box {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #625c55;
}

.rfc-formula-box {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(232, 228, 220, 0.9);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
}

.rfc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.rfc-kpi-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid #ece6dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.04);
}

.rfc-kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #7a756d;
}

.rfc-kpi-value {
    font-size: clamp(20px, 2vw, 24px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #2d2a26;
    word-break: break-word;
}

.rfc-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.rfc-flow-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid #ece6dc;
    border-radius: 14px;
    background: #fff;
}

.rfc-flow-label {
    font-size: 12px;
    font-weight: 700;
    color: #7a756d;
}

.rfc-flow-value {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #2d2a26;
    word-break: break-word;
}

.rfc-table-wrap {
    overflow-x: auto;
}

.rfc-summary-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 360px;
}

.rfc-summary-table th,
.rfc-summary-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #eee7dc;
    vertical-align: top;
    text-align: left;
    font-size: 14px;
    line-height: 1.55;
}

.rfc-summary-table th {
    width: 36%;
    color: #5f5a56;
    font-weight: 700;
    background: #fcfaf6;
}

.rfc-summary-table td {
    color: #2d2a26;
    font-weight: 600;
}

.rfc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px 16px;
    border-radius: 14px;
    background: #fffdf8;
    border: 1px solid #efe3b4;
    color: #6c6244;
    font-size: 13px;
    line-height: 1.65;
}

@media (max-width: 1100px) {
    .rfc-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rfc-flow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .rfc-toggle-group,
    .rfc-field-grid,
    .rfc-kpi-grid,
    .rfc-flow-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .rfc-btn-group {
        flex-direction: column;
    }

    .rfc-result-primary,
    .rfc-section {
        padding: 16px;
    }

    .rfc-primary-top {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .rfc-primary-value {
        font-size: 28px;
    }

    .rfc-kpi-value,
    .rfc-flow-value {
        font-size: 18px;
    }

    .rfc-summary-table th,
    .rfc-summary-table td {
        padding: 10px;
        font-size: 13px;
    }
}
