/**
 * Jeonse Deposit Guarantee Calculator Styles
 * 전세보증금 반환보증 계산기 전용 스타일
 *
 * @package Zipper
 */

/* ===== 레이아웃 오버라이드 ===== */
.tool-section:has(.jdg-input-section) .tool-layout-split {
    grid-template-columns: 300px 1fr;
}

@media (max-width: 900px) {
    .tool-section:has(.jdg-input-section) .tool-layout-split {
        grid-template-columns: 1fr;
    }
}

/* ===== 탭 네비게이션 ===== */
.jdg-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 16px;
}

.jdg-tab {
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.jdg-tab:hover {
    color: #2d2a26;
    background: rgba(255, 255, 255, 0.5);
}

.jdg-tab.active {
    color: #fff;
    background: #d4af37;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

/* ===== 입력 섹션 ===== */
.jdg-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.jdg-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    box-sizing: border-box;
}

.jdg-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.jdg-input-group input[type="text"],
.jdg-input-group select {
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.jdg-input-group input[type="text"]:focus,
.jdg-input-group select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.jdg-input-group input[type="text"]::placeholder {
    color: #a09a94;
}

.jdg-optional {
    font-size: 11px;
    font-weight: 400;
    color: #a09a94;
}

/* 금액 읽기 표시 */
.jdg-amount-display {
    font-size: 12px;
    color: #d4af37;
    font-weight: 500;
    margin-top: 4px;
    min-height: 18px;
}

/* 간편 버튼 그룹 */
.jdg-quick-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-width: 100%;
}

.jdg-quick-btn {
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.jdg-quick-btn:hover {
    border-color: #d4af37;
    background: #fff;
    color: #d4af37;
}

/* ===== 라디오 그룹 ===== */
.jdg-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.jdg-radio-group.jdg-radio-vertical {
    flex-direction: column;
}

.jdg-radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: #2d2a26;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.jdg-radio-vertical .jdg-radio-option {
    flex: none;
    justify-content: flex-start;
}

.jdg-radio-option:hover {
    border-color: #d4af37;
    background: #fff;
}

.jdg-radio-option.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

.jdg-radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===== 액션 버튼 ===== */
.jdg-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    max-width: 100%;
}

.jdg-reset-btn,
.jdg-share-btn {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.jdg-reset-btn {
    color: #7a756d;
    background: #fff;
    border: 1px solid #e8e4dc;
}

.jdg-reset-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.jdg-share-btn {
    color: #3498db;
    background: #fff;
    border: 1px solid #3498db;
}

.jdg-share-btn:hover {
    background: rgba(52, 152, 219, 0.08);
}

/* 숨김 */
.jdg-hidden {
    display: none !important;
}

/* ===== 대기 상태 ===== */
.jdg-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #a09a94;
}

.jdg-waiting > i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #d4af37;
}

.jdg-waiting > p {
    font-size: 14px;
    margin-bottom: 16px;
}

.jdg-waiting-guide {
    text-align: left;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
    max-width: 400px;
    margin: 0 auto;
}

.jdg-waiting-guide .guide-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.jdg-waiting-guide .guide-title i {
    color: #d4af37;
}

.jdg-waiting-guide ul {
    margin: 0;
    padding-left: 18px;
}

.jdg-waiting-guide li {
    font-size: 12px;
    color: #5f5a56;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ===== 메인 결과 (최저가 추천) ===== */
.jdg-main-result {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

.jdg-main-label {
    font-size: 14px;
    color: #7a756d;
    margin-bottom: 8px;
}

.jdg-recommend-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #d4af37;
    margin-bottom: 10px;
}

.jdg-main-value {
    font-size: 42px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 6px;
}

.jdg-main-value .unit {
    font-size: 20px;
    font-weight: 600;
    color: #b8860b;
    margin-left: 4px;
}

.jdg-main-sub {
    font-size: 13px;
    color: #7a756d;
}

.jdg-main-sub strong {
    color: #d4af37;
    font-weight: 700;
}

/* ===== 3사 비교 카드 ===== */
.jdg-compare-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.jdg-compare-card {
    text-align: center;
    padding: 14px 10px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    transition: all 0.2s;
}

.jdg-compare-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.12);
}

.jdg-compare-card.cheapest {
    background: rgba(46, 204, 113, 0.08);
    border-color: rgba(46, 204, 113, 0.4);
}

.jdg-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 2px;
}

.jdg-compare-card.cheapest .jdg-card-name {
    color: #27ae60;
}

.jdg-card-feature {
    font-size: 11px;
    color: #a09a94;
    margin-bottom: 8px;
}

.jdg-card-rate {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 6px;
}

.jdg-card-fee {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 4px;
}

.jdg-compare-card.cheapest .jdg-card-fee {
    color: #27ae60;
}

.jdg-card-fee .unit {
    font-size: 12px;
    font-weight: 500;
    color: #7a756d;
}

.jdg-card-monthly {
    font-size: 11px;
    color: #a09a94;
}

/* ===== 차트 섹션 ===== */
.jdg-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.jdg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.jdg-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.jdg-section-title i {
    color: #d4af37;
}

.jdg-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #217346;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.jdg-download-btn:hover {
    background: #1a5c38;
}

.jdg-download-btn i {
    font-size: 14px;
}

.jdg-chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.jdg-chart-container canvas {
    max-height: 250px;
}

/* ===== 상세 보증료율 테이블 ===== */
.jdg-detail-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.jdg-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.jdg-detail-table th,
.jdg-detail-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0ede8;
}

.jdg-detail-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
    font-size: 12px;
}

.jdg-detail-table td {
    color: #2d2a26;
}

.jdg-detail-table tr:last-child td {
    border-bottom: none;
}

/* ===== 안내문 ===== */
.jdg-notice {
    text-align: center;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
    font-size: 12px;
    color: #a09a94;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.jdg-notice i {
    color: #d4af37;
    flex-shrink: 0;
}

/* ===== 126% 룰 검증 섹션 ===== */
.jdg-126-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.jdg-126-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.jdg-126-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #faf9f7;
    border-radius: 6px;
}

.jdg-126-label {
    font-size: 13px;
    color: #5f5a56;
}

.jdg-126-value {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
}

.jdg-126-verdict {
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
    background: #faf9f7;
    color: #7a756d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.jdg-126-verdict.pass {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.jdg-126-verdict.fail {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* ===== 가입 자격 카드 ===== */
.jdg-elig-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.jdg-elig-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s;
}

.jdg-elig-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.jdg-elig-name {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.jdg-elig-status {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: #f0ede8;
    color: #7a756d;
}

.jdg-elig-status.eligible {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.jdg-elig-status.ineligible {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.jdg-elig-status.conditional {
    background: rgba(243, 156, 18, 0.15);
    color: #e67e22;
}

.jdg-elig-detail {
    font-size: 12px;
    color: #7a756d;
    line-height: 1.5;
}

/* ===== 보증료 지원 섹션 ===== */
.jdg-subsidy-section {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.08) 0%, rgba(155, 89, 182, 0.02) 100%);
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.jdg-subsidy-section .jdg-section-title {
    color: #8e44ad;
}

.jdg-subsidy-section .jdg-section-title i {
    color: #8e44ad;
}

.jdg-subsidy-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 10px;
}

.jdg-subsidy-card {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.jdg-subsidy-card.jdg-subsidy-highlight {
    background: rgba(142, 68, 173, 0.1);
    border: 1px solid rgba(142, 68, 173, 0.2);
}

.jdg-subsidy-label {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 6px;
}

.jdg-subsidy-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
}

.jdg-subsidy-card.jdg-subsidy-highlight .jdg-subsidy-value {
    color: #8e44ad;
}

.jdg-subsidy-value.jdg-saving {
    color: #27ae60;
}

.jdg-subsidy-info {
    font-size: 12px;
    color: #7a756d;
    text-align: center;
    line-height: 1.5;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

/* ===== 대안 안내 섹션 ===== */
.jdg-alt-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.jdg-alt-content {
    font-size: 13px;
    color: #5f5a56;
    line-height: 1.6;
    margin-top: 10px;
}

.jdg-alt-content ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.jdg-alt-content li {
    margin-bottom: 6px;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .jdg-input-group input[type="text"]:not([type="radio"]):not([type="checkbox"]),
    .jdg-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .jdg-compare-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .jdg-chart-container {
        height: 220px;
    }

    .jdg-chart-container canvas {
        max-height: 220px;
    }

    .jdg-subsidy-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .jdg-main-result {
        padding: 20px 16px;
    }

    .jdg-main-value {
        font-size: 36px;
    }

    .jdg-main-value .unit {
        font-size: 18px;
    }

    .jdg-compare-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .jdg-compare-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 12px 14px;
    }

    .jdg-card-name {
        margin-bottom: 0;
        min-width: 70px;
    }

    .jdg-card-feature {
        display: none;
    }

    .jdg-card-rate {
        display: none;
    }

    .jdg-card-monthly {
        display: none;
    }

    .jdg-radio-group {
        gap: 6px;
    }

    .jdg-radio-option {
        padding: 7px 10px;
        font-size: 12px;
    }

    .jdg-chart-container {
        height: 200px;
    }

    .jdg-chart-container canvas {
        max-height: 200px;
    }

    .jdg-subsidy-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .jdg-subsidy-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .jdg-subsidy-label {
        margin-bottom: 0;
    }

    .jdg-126-row {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .tool-section:has(.jdg-input-section),
    .tool-section:has(.jdg-input-section) .tool-layout-split,
    .tool-section:has(.jdg-input-section) .tool-input-panel,
    .tool-section:has(.jdg-input-section) .tool-result-panel {
        max-width: 100%;
        overflow-x: hidden;
    }

    .jdg-quick-btns {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

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

    .jdg-main-value .unit {
        font-size: 16px;
    }

    .jdg-card-fee {
        font-size: 15px;
    }

    .jdg-detail-table {
        font-size: 12px;
    }

    .jdg-detail-table th,
    .jdg-detail-table td {
        padding: 8px 6px;
    }

    .jdg-subsidy-value {
        font-size: 16px;
    }
}

/* Excel button guard */
.tool-btn-excel {
  background: #59ab79;
  border-color: #59ab79;
}

.tool-btn-excel:hover,
.tool-btn-excel:focus-visible {
  background: #4f9f70;
  border-color: #4f9f70;
}

