/**
 * Welfare Membership Eligibility Scanner Styles
 * 복지멤버십 수급 가능성 스캐너
 *
 * @package Zipper
 */

.wms-hidden {
    display: none !important;
}

.wms-main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

.wms-input-col {
    position: sticky;
    top: 20px;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

.wms-result-col {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.wms-section,
.wms-result-summary,
.wms-chart-section,
.wms-table-section,
.wms-apply-section {
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    max-width: 100%;
    box-sizing: border-box;
}

.wms-section-title,
.wms-block-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.wms-section-title i,
.wms-block-title i {
    color: #d4af37;
}

.wms-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.wms-block-sub {
    font-size: 12px;
    line-height: 1.55;
    color: #6d665d;
    margin-top: 2px;
}

.wms-input-group {
    margin-bottom: 12px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.wms-input-group:last-child {
    margin-bottom: 0;
}

.wms-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.wms-input-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.wms-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    line-height: 1.4;
}

.wms-select,
.wms-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #2d2a26;
    font-size: 13px;
    line-height: 1.45;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.wms-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 34px 10px 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236f6758' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.wms-input {
    padding: 10px 56px 10px 12px;
    text-align: right;
    font-weight: 700;
}

.wms-input::placeholder {
    color: #b7afa2;
    font-weight: 500;
}

.wms-select:hover,
.wms-input:hover {
    border-color: #d4c67a;
}

.wms-select:focus,
.wms-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    background: #fff;
}

.wms-amount-wrap {
    position: relative;
    overflow: visible;
}

.wms-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 18px;
    text-align: right;
    font-size: 12px;
    color: #8a8279;
    pointer-events: none;
}

.wms-korean-amount {
    margin-top: 5px;
    font-size: 12px;
    color: #6f665d;
    min-height: 16px;
    line-height: 1.45;
}

.wms-hint {
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #746d64;
}

.wms-preview-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.wms-preview-item {
    background: #f7f4ee;
    border: 1px solid #ebe4d7;
    border-radius: 8px;
    padding: 8px;
}

.wms-preview-label {
    display: block;
    font-size: 11px;
    color: #7b736a;
    margin-bottom: 2px;
}

.wms-preview-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #2d2a26;
    line-height: 1.35;
}

.wms-check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.wms-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #e6dfd2;
    border-radius: 8px;
    background: #fcfbf9;
    font-size: 12px;
    line-height: 1.4;
    color: #4e473f;
    cursor: pointer;
}

.wms-check-label input {
    margin: 0;
    accent-color: #b9962d;
}

.wms-check-label:has(input:checked) {
    border-color: #d4af37;
    background: #fff8e7;
}

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

.wms-btn {
    flex: 1;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}

.wms-btn:active {
    transform: translateY(1px);
}

.wms-btn-primary {
    background: linear-gradient(135deg, #d4af37, #c09a2c);
    color: #fff;
    box-shadow: 0 3px 8px rgba(192, 154, 44, 0.28);
}

.wms-btn-primary:hover {
    background: linear-gradient(135deg, #c6a32f, #b48f27);
}

.wms-btn-ghost {
    background: #f4efe6;
    color: #665f56;
    border-color: #e1d8c9;
}

.wms-btn-ghost:hover {
    background: #ece4d6;
}

.wms-waiting {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f7f4ed;
    border-color: #e8dfcf;
}

.wms-waiting i {
    color: #b9962d;
    font-size: 16px;
    margin-top: 2px;
}

.wms-waiting p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #5f584f;
}

.wms-result-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wms-summary-badge {
    display: inline-flex;
    align-self: flex-start;
    border-radius: 999px;
    border: 1px solid #eedca8;
    background: #fff7dc;
    color: #8a6c19;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
}

.wms-summary-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.35;
    color: #2d2a26;
}

.wms-summary-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #655d54;
}

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

.wms-summary-item {
    border: 1px solid #ebe4d8;
    border-radius: 10px;
    background: #fcfaf5;
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wms-summary-item.is-kpi {
    border-color: #e4cc84;
    background: #fff7df;
}

.wms-summary-label {
    font-size: 12px;
    color: #786f65;
    line-height: 1.35;
}

.wms-summary-value {
    font-size: 22px;
    color: #2d2a26;
    line-height: 1.25;
    font-weight: 800;
}

.wms-chart-wrap {
    position: relative;
    width: 100%;
    min-height: 250px;
}

.wms-chart-wrap canvas {
    width: 100% !important;
    height: 250px !important;
    max-width: 100%;
}

.wms-chart-fallback {
    margin-top: 8px;
    font-size: 12px;
    color: #8e4f42;
    background: #fff0eb;
    border: 1px solid #f2c6b8;
    border-radius: 8px;
    padding: 8px 10px;
}

.wms-chart-fallback-table-wrap {
    margin-top: 10px;
}

.wms-fallback-table {
    width: 100%;
    border-collapse: collapse;
}

.wms-fallback-table th,
.wms-fallback-table td {
    border: 1px solid #eee6d9;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.45;
}

.wms-fallback-table th {
    background: #f7f2e9;
    color: #564e45;
    font-weight: 700;
}

.wms-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wms-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.wms-table th,
.wms-table td {
    border: 1px solid #ece5d9;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.45;
    vertical-align: top;
}

.wms-table th {
    background: #f8f3ea;
    color: #554e46;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.wms-table td {
    color: #3f3a35;
    background: #fff;
}

.wms-empty-row td {
    text-align: center;
    color: #7d756b;
    background: #fdfbf7;
}

.wms-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.wms-pill-pass {
    background: #e9f7ee;
    border: 1px solid #afd9bc;
    color: #276a3f;
}

.wms-pill-check {
    background: #fff8e7;
    border: 1px solid #ead59a;
    color: #805f08;
}

.wms-pill-fail {
    background: #fff0ec;
    border: 1px solid #f2c6bb;
    color: #9f3f34;
}

.wms-download-btn {
    flex-shrink: 0;
}

.wms-download-btn.tool-btn.tool-btn-excel {
    color: #fff;
    background: #59ab79;
    border: 1px solid #59ab79;
}

.wms-download-btn.tool-btn.tool-btn-excel:hover {
    background: #4f9f70;
    border-color: #4f9f70;
}

.wms-apply-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wms-apply-list li {
    font-size: 13px;
    line-height: 1.55;
    color: #514a42;
}

.wms-apply-list a {
    color: #245ea8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wms-disclaimer {
    border: 1px solid #edd7b0;
    border-radius: 10px;
    background: #fff8e8;
    color: #5c513f;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.6;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.wms-disclaimer i {
    color: #b78725;
    font-size: 15px;
    margin-top: 1px;
}

.tool-description .tool-date-notice {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #eadfbf;
    border-radius: 8px;
    background: #fff9ea;
    font-size: 13px;
    line-height: 1.6;
    color: #564f45;
}

@media (max-width: 900px) {
    .wms-main-layout {
        grid-template-columns: 280px 1fr;
        gap: 14px;
    }

    .wms-section,
    .wms-result-summary,
    .wms-chart-section,
    .wms-table-section,
    .wms-apply-section {
        padding: 14px;
    }

    .wms-summary-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .wms-main-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .wms-input-col {
        position: static;
        top: auto;
    }

    .wms-input-row,
    .wms-input-row-3,
    .wms-check-grid,
    .wms-summary-grid {
        grid-template-columns: 1fr;
    }

    .wms-btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .wms-block-head {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .wms-download-btn {
        width: 100%;
    }

    .wms-chart-wrap {
        min-height: 230px;
    }

    .wms-chart-wrap canvas {
        height: 230px !important;
    }
}

@media (max-width: 480px) {
    .wms-section,
    .wms-result-summary,
    .wms-chart-section,
    .wms-table-section,
    .wms-apply-section {
        padding: 12px;
        border-radius: 10px;
    }

    .wms-summary-title {
        font-size: 18px;
    }

    .wms-summary-value {
        font-size: 20px;
    }

    .wms-select,
    .wms-input {
        font-size: 16px;
        line-height: 1.4;
    }

    .wms-input {
        padding-right: 58px;
    }

    .wms-table th,
    .wms-table td,
    .wms-fallback-table th,
    .wms-fallback-table td {
        font-size: 11px;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .wms-table-wrap {
        overflow-x: visible;
    }

    .wms-table {
        min-width: 0;
        table-layout: fixed;
    }

    .wms-table thead {
        display: none;
    }

    .wms-table,
    .wms-table tbody,
    .wms-table tr,
    .wms-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .wms-table tbody {
        display: grid;
        gap: 10px;
    }

    .wms-table tr {
        border: 1px solid #ece5d9;
        border-radius: 12px;
        background: #fff;
        overflow: hidden;
    }

    .wms-table td {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 8px;
        padding: 9px 10px;
        border-bottom: 1px solid #f1eadf;
        font-size: 12px;
        line-height: 1.5;
        word-break: break-word;
    }

    .wms-table tr td:last-child {
        border-bottom: 0;
    }

    .wms-table td::before {
        color: #6d665d;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.45;
        content: '';
    }

    .wms-table td:nth-child(1)::before { content: '제도'; }
    .wms-table td:nth-child(2)::before { content: '소득기준'; }
    .wms-table td:nth-child(3)::before { content: '입력비율'; }
    .wms-table td:nth-child(4)::before { content: '재산지표'; }
    .wms-table td:nth-child(5)::before { content: '가구가점'; }
    .wms-table td:nth-child(6)::before { content: '판정'; }
    .wms-table td:nth-child(7)::before { content: '비고'; }

    .wms-empty-row td {
        display: block;
        text-align: center;
        padding: 12px 10px;
    }

    .wms-empty-row td::before {
        display: none;
    }

    .wms-pill {
        white-space: normal;
        overflow-wrap: anywhere;
        justify-content: flex-start;
    }
}
