/* =========================================================================
   💳 AQM 결제 모달 및 토스 스타일 알럿(Toss Alert) 전용 스타일시트
   ========================================================================= */

/* 1. 모달 전역 오버레이(Overlay) */
.aqm-pay-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* 반투명 다크 배경 */
    backdrop-filter: blur(8px); /* 백드롭 필터(Backdrop Filter) 블러 효과 */
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.aqm-pay-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 2. 모달 컨테이너(Container) */
.aqm-pay-modal-container {
    background: #ffffff;
    border-radius: 24px; /* 둥근 모서리 */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 440px; /* 적정 너비 제한 */
    margin: 16px;
    padding: 32px 24px 24px 24px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* 튕기는 듯한 부드러운 바운스 효과 */
    box-sizing: border-box;
}

.aqm-pay-modal-overlay.active .aqm-pay-modal-container {
    transform: scale(1);
}

/* 3. 헤더 및 닫기 버튼 */
.aqm-pay-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aqm-pay-modal-close:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* 4. 모달 콘텐츠 구성 */
.aqm-pay-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.aqm-pay-modal-desc {
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* 상품 요약 카드 */
.aqm-pay-product-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.aqm-pay-product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    word-break: keep-all; /* 한글이 어절 단위로 떨어지게 하여 기만 따로 다음 줄로 가는 현상 방지 */
}

.aqm-pay-product-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: #2563eb;
    white-space: nowrap; /* 금액과 '원'이 쪼개져서 줄바꿈되지 않도록 방지 */
}

/* 모바일 좁은 화면 대응 (가로 너비 480px 이하) */
@media (max-width: 480px) {
    .aqm-pay-product-card {
        flex-direction: column; /* 세로(column) 정렬로 변경 */
        align-items: stretch; /* 전체 너비 차지 */
        gap: 8px; /* 세로 간격 */
    }
    
    .aqm-pay-product-name {
        text-align: left;
    }
    
    .aqm-pay-product-price {
        text-align: right; /* 가격은 오른쪽 아래에 배치하여 가독성 증대 */
    }
}

/* 5. 결제 수단 버튼 레이아웃 */
.aqm-pay-method-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aqm-pay-btn {
    width: 100%;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.aqm-pay-btn:active {
    transform: scale(0.98);
}

/* 신용카드 버튼 (KCP / PayApp 공용) */
.aqm-pay-btn-card {
    background-color: #0f172a;
    color: #ffffff;
}

.aqm-pay-btn-card:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* 카카오페이 버튼 */
.aqm-pay-btn-kakaopay {
    background-color: #fee500;
    color: #191919;
    padding: 0 !important;
    height: 54px !important;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    font-family: "Noto Sans KR", -apple-system, sans-serif;
    font-size: 21px; /* 카카오페이 텍스트 로고 크기 */
    letter-spacing: -1.2px;
}

.aqm-pay-btn-kakaopay:hover {
    filter: brightness(0.95);
    transform: scale(1.015);
    box-shadow: 0 4px 14px rgba(254, 229, 0, 0.25);
}

.aqm-pay-btn-kakaopay:active {
    transform: scale(0.985);
}

.aqm-brand-kakao {
    font-weight: 500; /* 카카오 텍스트는 약간 얇고 둥글게 */
}

.aqm-brand-kakaopay {
    font-weight: 900; /* 페이(pay) 텍스트는 아주 볼드하게 */
    margin-left: 2px;
}

/* 6. 토스 스타일 경고 모달 (Toss Style Alert Popup) */
.aqm-toss-alert-container {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 360px; /* 알럿은 약간 좁게 */
    margin: 16px;
    padding: 36px 24px 20px 24px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    text-align: center;
}

.aqm-pay-modal-overlay.active .aqm-toss-alert-container {
    transform: scale(1);
}

.aqm-toss-icon-box {
    width: 56px;
    height: 56px;
    background-color: #fee2e2; /* 연한 적색 배경 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.aqm-toss-icon-box i {
    color: #ef4444; /* 경고 적색 */
    width: 28px;
    height: 28px;
}

.aqm-toss-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.aqm-toss-message {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
    word-break: keep-all;
}

.aqm-toss-btn-confirm {
    background-color: #3182f6; /* 토스 전용 블루 브랜드 컬러 */
    color: #ffffff;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s ease;
}

.aqm-toss-btn-confirm:hover {
    background-color: #1b64da;
}

.aqm-toss-btn-confirm:active {
    transform: scale(0.98);
}

/* 7. 결제 완료 모달 (Success Modal) */
.aqm-success-container {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
    margin: 16px;
    padding: 40px 24px 24px 24px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    text-align: center;
}

.aqm-pay-modal-overlay.active .aqm-success-container {
    transform: scale(1);
}

/* 체크 마크 성공 애니메이션 */
.aqm-success-icon-box {
    width: 64px;
    height: 64px;
    background-color: #ecfdf5; /* 연한 녹색 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
}

.aqm-success-icon-box i {
    color: #10b981; /* 성공 초록색 */
    width: 32px;
    height: 32px;
}

.aqm-success-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.aqm-success-desc {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
    word-break: keep-all;
}

/* 성공 상세 명세표 */
.aqm-success-details {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 28px;
    text-align: left;
}

.aqm-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.aqm-detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.aqm-detail-row:first-child {
    padding-top: 0;
}

.aqm-detail-label {
    color: #64748b;
    font-weight: 600;
}

.aqm-detail-val {
    color: #1e293b;
    font-weight: 700;
}

.aqm-detail-val.highlight {
    color: #10b981;
}

.aqm-success-btn {
    background-color: #10b981;
    color: #ffffff;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s ease;
}

.aqm-success-btn:hover {
    background-color: #059669;
}

.aqm-success-btn:active {
    transform: scale(0.98);
}

/* 🔔 시선 집중 진동(Shake) 애니메이션 */
@keyframes aqmShake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-6px); }
    30%, 60%, 90% { transform: translateX(6px); }
}

.aqm-shake {
    animation: aqmShake 0.4s ease-in-out;
}

/* =========================================================================
   🎁 [멤버십 요금제 상품 선택 모달 전용 스타일]
   ========================================================================= */

.aqm-pay-plan-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.aqm-pay-plan-modal-close:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.aqm-pay-plan-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.aqm-pay-plan-card {
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.aqm-pay-plan-card:hover {
    transform: translateY(-2px);
    border-color: #eab308;
    box-shadow: 0 10px 20px rgba(234, 179, 8, 0.08);
}

.aqm-pay-plan-card:active {
    transform: scale(0.98);
}

/* 인기 상품(Popular) 카드 강조 */
.aqm-pay-plan-card.popular {
    border-color: #facc15;
    background-color: #fffbeb;
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.12);
}

.aqm-pay-plan-card.popular:hover {
    border-color: #eab308;
    box-shadow: 0 12px 24px rgba(250, 204, 21, 0.2);
}

/* 배지 */
.aqm-pay-plan-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 800;
    color: #475569;
    background-color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.aqm-pay-plan-badge.popular {
    background-color: #facc15;
    color: #111827;
}

/* 제목 */
.aqm-pay-plan-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
}

/* 가격 */
.aqm-pay-plan-price {
    font-size: 1.2rem;
    font-weight: 900;
    color: #2563eb;
    margin-bottom: 6px;
}

.aqm-pay-plan-card.popular .aqm-pay-plan-price {
    color: #d97706; /* 인기 상품 가격 골드 하이라이트 */
}

/* 설명 */
.aqm-pay-plan-info {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
    word-break: keep-all;
}

/* 토스페이 버튼 */
.aqm-pay-btn-tosspay {
    background-color: #ffffff; /* 파란 로고의 가시성을 위해 순백색 배경 적용 */
    color: #0050ff;
    padding: 0 !important;
    height: 54px !important;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    border: 1px solid #e2e8f0; /* 신용카드/이체 수단들과 조화를 이루는 연한 테두리 */
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 21px; /* 토스페이 텍스트 로고 크기 */
    letter-spacing: -0.8px;
}

.aqm-pay-btn-tosspay:hover {
    background-color: #f8fafc; /* 마우스 호버 시 자연스러운 미세 회색톤 변화 */
    transform: scale(1.015);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.aqm-pay-btn-tosspay:active {
    transform: scale(0.985);
}

.aqm-brand-toss {
    font-weight: 900;
    font-style: italic; /* toss 단어만 토스의 사선 느낌 적용 */
    color: #0050ff;
}

.aqm-brand-tosspay {
    font-family: "Noto Sans KR", -apple-system, sans-serif; /* 카카오페이 pay 폰트와 동일하게 결합 */
    font-weight: 900;
    font-style: normal; /* 카카오페이와 통일하기 위해 이탤릭(기울임) 해제 */
    color: #0050ff; /* toss 브랜드와 동일하게 파란색으로 통일 */
    margin-left: 1px; /* 공백 좁히기 */
    letter-spacing: -1.2px; /* 자간까지 일치화 */
}

/* 실시간 계좌이체 버튼 */
.aqm-pay-btn-trans {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #1f2937;
    height: 54px !important;
    border-radius: 16px;
    font-weight: 700;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.aqm-pay-btn-trans:hover {
    background-color: #e5e7eb;
    transform: scale(1.015);
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.08);
}

.aqm-pay-btn-trans:active {
    transform: scale(0.985);
}

/* 결제 버튼 내 브랜드 심볼 아이콘 스타일 정의 */
.aqm-pay-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    object-fit: contain;
}
