/* ========================================
   SECTION 13: 빠른 상담 + 팝업 공지
   벤치마킹: 중앙사이버평생교육원
======================================== */

/* ───── 플로팅 빠른메뉴 ───── */
.floating-btns {
    position: fixed;
    right: 24px;
    bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 998;
}
.floating-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    white-space: nowrap;
}
.floating-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
.floating-btn i { font-size: 18px; width: 20px; text-align: center; }

/* 무료 상담 */
.floating-btn--consult {
    background: linear-gradient(135deg, #553AE7, #6B52ED);
    animation: consultPulse 2s ease-in-out infinite;
}
/* 카톡 상담 */
.floating-btn--kakao {
    background: #FEE500;
    color: #3C1E1E;
}
.floating-btn--kakao:hover { background: #F5DC00; }
/* 전화 상담 */
.floating-btn--phone {
    background: #059669;
}
.floating-btn--phone:hover { background: #047857; }
/* 맨 위로 */
.floating-btn--top {
    width: 48px; height: 48px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: var(--text);
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
}
.floating-btn--top.visible {
    opacity: 1;
    pointer-events: auto;
}
.floating-btn--top:hover { background: #fff; transform: translateY(-2px); }
.floating-btn--top i { font-size: 16px; width: auto; }

@keyframes consultPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(85,58,231,.4); }
    50% { box-shadow: 0 4px 30px rgba(85,58,231,.6), 0 0 0 8px rgba(85,58,231,.1); }
}

/* 모바일: 텍스트 숨기고 아이콘만 */
@media (max-width: 768px) {
    .floating-btns { right: 12px; bottom: 16px; gap: 8px; }
    .floating-btn { padding: 12px; border-radius: 50%; }
    .floating-btn span { display: none; }
    .floating-btn i { font-size: 20px; }
}

/* ───── 상담 패널 ───── */
.consult-panel {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 360px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2), 0 0 0 1px rgba(0, 0, 0, .05);
    z-index: 1001;
    overflow: hidden;
    transform: translateY(20px) scale(.95);
    opacity: 0;
    pointer-events: none;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}
.consult-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.consult-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #553AE7, #6B52ED);
    color: #fff;
}
.consult-panel-header h3 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.consult-close {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.consult-close:hover { background: rgba(255,255,255,.3); }

.consult-panel-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

.consult-desc {
    font-size: 17px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

.consult-field { margin-bottom: 12px; }
.consult-field label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.consult-field .req { color: #ef4444; }
.consult-field input,
.consult-field select,
.consult-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border .2s;
    outline: none;
    background: #fafbfc;
}
.consult-field input:focus,
.consult-field select:focus,
.consult-field textarea:focus {
    border-color: #553AE7;
    background: #fff;
}
.consult-field textarea { resize: none; }

.consult-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 17px;
    margin-bottom: 10px;
}
.consult-success {
    background: #ecfdf5;
    color: #059669;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 17px;
    margin-bottom: 10px;
}

.consult-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #553AE7, #6B52ED);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .2s;
    font-family: inherit;
}
.consult-submit:hover { opacity: .9; transform: translateY(-1px); }
.consult-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.consult-privacy {
    margin-top: 12px;
    font-size: 17px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}
.consult-privacy i { color: #10b981; }

/* ───── 팝업 공지 ───── */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: popupFadeIn .3s ease;
}
@keyframes popupFadeIn { from { opacity: 0; } to { opacity: 1; } }

.popup-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .35);
    animation: popupSlideUp .35s cubic-bezier(.4, 0, .2, 1);
}
@keyframes popupSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 배너 영역 */
.popup-banner {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #553AE7 0%, #7B64EE 100%);
    min-height: 60px;
}
.popup-banner img {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 220px;
}
.popup-x-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
    backdrop-filter: blur(4px);
}
.popup-x-btn:hover { background: rgba(0, 0, 0, .65); }

/* 바디 영역 */
.popup-body {
    padding: 24px 24px 20px;
    text-align: center;
}
.popup-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
}
.popup-desc {
    font-size: .9rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* 쿠폰 영역 */
.popup-coupon {
    margin-bottom: 16px;
}
.popup-coupon-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}
.popup-coupon-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f3ff;
    border: 2px dashed #553AE7;
    border-radius: 10px;
    padding: 10px 16px;
}
.popup-coupon-box code {
    font-size: 1.1rem;
    font-weight: 700;
    color: #553AE7;
    letter-spacing: .08em;
}
.popup-coupon-copy {
    background: #553AE7;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    transition: background .2s;
}
.popup-coupon-copy:hover { background: #4028C4; }

/* CTA 버튼 */
.popup-cta-btn {
    display: inline-block;
    padding: 12px 36px;
    background: linear-gradient(135deg, #553AE7, #6B52ED);
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(85, 58, 231, .3);
}
.popup-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(85, 58, 231, .4);
}

/* 푸터 */
.popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}
.popup-today {
    font-size: 17px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.popup-today input { cursor: pointer; }
.popup-close-btn {
    padding: 6px 16px;
    background: #6b7280;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
    font-family: inherit;
}
.popup-close-btn:hover { opacity: .85; }

/* 쿠폰 복사 완료 토스트 */
.popup-coupon-copied {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    pointer-events: none;
    animation: popupFadeIn .2s ease;
}

/* ───── 반응형 ───── */
@media (max-width: 768px) {
    .consult-trigger {
        right: 12px;
        bottom: 160px;
        padding: 10px 14px;
        font-size: 16px;
    }
    .consult-trigger span { display: none; }
    .consult-trigger i { font-size: 20px; }
    .consult-panel {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        max-height: 90vh;
    }
    .popup-box { max-width: 95vw; }
    .popup-body { padding: 20px 16px 16px; }
    .popup-title { font-size: 1.1rem; }
}
