/**
 * Disability Pension + Allowance Calculator Styles
 * 장애인연금·장애수당 계산기
 *
 * @package Zipper
 */

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

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

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

.dpa-result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

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

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

.dpa-input-row-single {
    grid-template-columns: 1fr;
}

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

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

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

.dpa-select,
.dpa-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;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dpa-select {
    padding: 10px 32px 10px 12px;
    appearance: none;
    -webkit-appearance: none;
    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;
}

.dpa-input {
    padding: 10px 36px 10px 12px;
    font-weight: 600;
    text-align: right;
}

.dpa-input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

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

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

.dpa-input-wrap {
    position: relative;
}

.dpa-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #9a9488;
    pointer-events: none;
}

.dpa-household-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dpa-household-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #dfd8cb;
    border-radius: 8px;
    background: #f7f4ef;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    min-height: 40px;
    padding: 8px 10px;
    box-sizing: border-box;
    cursor: pointer;
}

.dpa-household-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #cfa73a;
}

.dpa-korean-amount {
    margin-top: 4px;
    min-height: 16px;
    text-align: right;
    font-size: 11px;
    color: #b58913;
}

.dpa-hint {
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: #8f897f;
}

.dpa-checklist {
    margin: 8px 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dpa-checklist li {
    font-size: 12px;
    line-height: 1.5;
    color: #5f5a56;
}

.dpa-ref-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.dpa-ref-item {
    border: 1px solid #eee6d5;
    border-radius: 8px;
    background: #fbfaf7;
    padding: 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dpa-ref-item span {
    font-size: 11px;
    color: #7f786b;
}

.dpa-ref-item strong {
    font-size: 13px;
    color: #2f2b24;
}

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

.dpa-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dpa-btn-primary {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #c49520 100%);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.26);
}

.dpa-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.34);
}

.dpa-btn-ghost {
    color: #5f5a56;
    border: 1px solid #dfd8cb;
    background: #f5f3ef;
}

.dpa-btn-ghost:hover {
    border-color: #d4c67a;
    background: #fff;
}

.dpa-waiting {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
    color: #7f755f;
    font-size: 13px;
    line-height: 1.5;
}

.dpa-waiting i {
    color: #d4af37;
    font-size: 30px;
    opacity: 0.45;
}

.dpa-waiting p {
    margin: 0;
}

.dpa-result-summary {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.dpa-summary-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.18);
    color: #7b6521;
    font-size: 12px;
    font-weight: 700;
}

.dpa-summary-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
}

.dpa-main-value {
    margin-top: 8px;
    margin-bottom: 10px;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #b58913;
}

.dpa-summary-note {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #7f786b;
}

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

.dpa-summary-item {
    border: 1px solid #e7ddc4;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
}

.dpa-summary-label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #867f71;
}

.dpa-summary-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #2f2b24;
}

.dpa-summary-item:nth-child(3) .dpa-summary-value {
    font-size: 22px;
    color: #b58913;
}

.dpa-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.dpa-tab {
    border: 1px solid #e2dbc9;
    border-radius: 8px;
    background: #f6f3ed;
    color: #6d6556;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.dpa-tab.is-active {
    border-color: #d4af37;
    background: #fff7e2;
    color: #7f5f14;
}

.dpa-tab-panel {
    border: 1px solid #eee6d5;
    border-radius: 10px;
    background: #faf8f2;
    padding: 14px;
}

.dpa-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dpa-panel-item {
    border: 1px solid #e4dccd;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
}

.dpa-panel-item span {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: #8a8273;
}

.dpa-panel-item strong {
    display: block;
    font-size: 15px;
    color: #2d2a26;
    line-height: 1.35;
}

.dpa-panel-rule {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #726b5c;
}

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

.dpa-block-sub {
    font-size: 12px;
    color: #887f6f;
    text-align: right;
}

.dpa-chart-wrap {
    position: relative;
    width: 100%;
    min-height: 300px;
    max-width: 100%;
    overflow: hidden;
}

.dpa-chart-wrap canvas {
    width: 100% !important;
    height: 300px !important;
    display: block;
}

.dpa-chart-fallback {
    margin-top: 8px;
    font-size: 12px;
    color: #9a7147;
    background: #fff4ea;
    border: 1px solid #f0d6bf;
    border-radius: 8px;
    padding: 8px 10px;
}

.dpa-download-btn {
    font-size: 12px;
    white-space: nowrap;
    padding: 10px 14px;
    min-height: 42px;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 6px rgba(72, 146, 103, 0.28);
}

.dpa-download-btn:hover {
    box-shadow: 0 4px 12px rgba(67, 133, 93, 0.34);
    transform: translateY(-1px);
}

.tool-btn-excel {
    color: #fff;
    background: linear-gradient(135deg, #59ab79 0%, #4b9a69 100%);
    border: 1px solid #448e62;
}

.tool-btn-excel:hover {
    background: linear-gradient(135deg, #4f9f70 0%, #438f62 100%);
}

/* 공통 버튼 스타일과 충돌 방지를 위한 강제 우선 적용 */
.dpa-download-btn.tool-btn.tool-btn-excel {
    color: #fff !important;
    background: linear-gradient(135deg, #59ab79 0%, #4b9a69 100%) !important;
    border: 1px solid #448e62 !important;
}

.dpa-download-btn.tool-btn.tool-btn-excel:hover {
    background: linear-gradient(135deg, #4f9f70 0%, #438f62 100%) !important;
    border-color: #3d845a !important;
}

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

.dpa-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.dpa-table th,
.dpa-table td {
    border-bottom: 1px solid #eee8dc;
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    font-size: 12px;
    line-height: 1.5;
    color: #433f38;
}

.dpa-table th {
    background: #faf7f1;
    color: #6b6458;
    font-weight: 700;
    white-space: nowrap;
}

.dpa-table td strong {
    color: #2f2b24;
}

.dpa-empty-row td {
    text-align: center;
    color: #8f897f;
    padding: 16px 10px;
}

.dpa-result-pass {
    color: #2f8f55;
    font-weight: 700;
}

.dpa-result-review {
    color: #a9783a;
    font-weight: 700;
}

.dpa-apply-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: #726b5c;
    line-height: 1.5;
}

.dpa-apply-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.dpa-apply-link {
    display: block;
    border: 1px solid #e9e2d4;
    border-radius: 8px;
    background: #fbfaf7;
    padding: 10px 12px;
    color: #73580e;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dpa-apply-link:hover {
    background: #fff4de;
    border-color: #dcc174;
}

.dpa-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid #f0d9c5;
    border-radius: 10px;
    background: #fff8f1;
    color: #7f5d36;
    font-size: 12px;
    line-height: 1.55;
    padding: 12px 14px;
}

.dpa-disclaimer i {
    color: #d4973a;
    font-size: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

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

    .dpa-summary-title {
        font-size: 17px;
    }

    .dpa-main-value {
        font-size: 30px;
    }
}

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

    .dpa-input-col {
        position: static;
    }

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

    .dpa-input-row,
    .dpa-summary-grid,
    .dpa-panel-grid {
        grid-template-columns: 1fr;
    }

    .dpa-main-value {
        font-size: 27px;
    }

    .dpa-chart-wrap {
        min-height: 260px;
    }

    .dpa-chart-wrap canvas {
        height: 260px !important;
    }

    .dpa-block-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .dpa-block-sub {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .dpa-btn-group {
        flex-direction: column;
    }

    .dpa-btn {
        width: 100%;
    }

    .dpa-tabs {
        grid-template-columns: 1fr;
    }

    .dpa-household-group {
        grid-template-columns: 1fr;
    }

    .dpa-table {
        min-width: 560px;
    }

    .dpa-summary-value {
        font-size: 17px;
    }

    .dpa-summary-item:nth-child(3) .dpa-summary-value {
        font-size: 20px;
    }
}
