/* ═══════════════════════════════════════
   MPLATS V2 — 결제/구독 스타일
   ═══════════════════════════════════════ */

.pay-page {
    min-height: 100vh;
    background: #f8fafc;
    font-family: 'Pretendard', -apple-system, 'Noto Sans KR', sans-serif;
}

/* 초기 숨김 (JS에서 classList.remove로 노출) */
.pay-hidden { display: none; }

/* ─── 헤더 ─── */
.pay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.pay-logo img { height: 28px; }
.pay-header-right { display: flex; gap: 16px; align-items: center; }
.pay-header-link {
    font-size: 14px;
    color: #475569;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background .15s;
}
.pay-header-link:hover { background: #f1f5f9; color: #1e293b; }

/* ─── 히어로 ─── */
.pay-hero {
    text-align: center;
    padding: 48px 24px 32px;
}
.pay-hero-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.pay-hero-desc {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* 과금주기 토글 */
.pay-cycle-toggle {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 10px;
    padding: 4px;
}
.pay-cycle-btn {
    padding: 8px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
}
.pay-cycle-btn.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.pay-cycle-discount {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* ─── 현재 구독 배너 ─── */
.pay-current-banner {
    max-width: 900px;
    margin: 0 auto 24px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 100%);
    border-radius: 10px;
    text-align: center;
}
.pay-current-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pay-current-label { font-size: 13px; color: #6366f1; font-weight: 600; }
.pay-current-plan { font-size: 16px; color: #1e293b; }
.pay-current-period { font-size: 13px; color: #64748b; }

/* ─── 플랜 카드 그리드 ─── */
.pay-plans {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 48px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.pay-loading {
    text-align: center;
    color: #94a3b8;
    padding: 40px;
    grid-column: 1 / -1;
}

.pay-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform .2s, box-shadow .2s;
}
.pay-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
.pay-card.recommended {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139,92,246,.2);
}
.pay-card.current {
    border-color: #3b82f6;
    background: #f8faff;
}
.pay-card-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #8b5cf6;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.pay-card-badge.current {
    background: #3b82f6;
}
.pay-card-name {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}
.pay-card-desc {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 20px;
    min-height: 36px;
}

/* 가격 */
.pay-card-price { margin-bottom: 20px; }
.pay-price-amount {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.pay-price-unit { font-size: 14px; color: #64748b; margin-left: 2px; }
.pay-price-yearly {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}
.pay-price-save {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 기능 목록 */
.pay-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    flex: 1;
}
.pay-card-features li {
    font-size: 13px;
    color: #475569;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
}
.pay-card-features li:last-child { border-bottom: none; }
.pay-card-features li::before {
    content: '✓';
    color: #10b981;
    font-weight: 700;
    margin-right: 8px;
}

/* CTA 버튼 */
.pay-card-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    box-sizing: border-box;
}
.pay-card-btn.primary {
    background: #6d28d9;
    color: #fff;
}
.pay-card-btn.primary:hover { background: #5b21b6; }
.pay-card-btn.free {
    background: #f1f5f9;
    color: #475569;
}
.pay-card-btn.free:hover { background: #e2e8f0; }
.pay-card-btn.enterprise {
    background: #0f172a;
    color: #fff;
}
.pay-card-btn.enterprise:hover { background: #1e293b; }
.pay-card-btn.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ─── 기능 비교 테이블 ─── */
.pay-compare-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 48px;
}
.pay-compare-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin-bottom: 24px;
}
.pay-compare-table-wrap { overflow-x: auto; }
.pay-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.pay-compare-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
}
.pay-compare-table th:first-child { text-align: left; }
.pay-compare-table td {
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.pay-compare-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: #1e293b;
}
.pay-compare-table td.yes { color: #10b981; font-weight: 600; }
.pay-compare-table td.no { color: #cbd5e1; }

/* ─── 하단 ─── */
.pay-footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #94a3b8;
}
.pay-footer a { color: #6d28d9; }

/* ═══════ 체크아웃 페이지 ═══════ */

.checkout-wrap {
    max-width: 520px;
    margin: 40px auto;
    padding: 0 24px;
}
.checkout-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 32px;
}
.checkout-card.success { text-align: center; }
.checkout-success-icon { margin-bottom: 16px; }
.checkout-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
}
.checkout-summary {
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}
.checkout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
}
.checkout-row:last-child { border-bottom: none; }
.checkout-row span { font-size: 14px; color: #64748b; }
.checkout-row strong { font-size: 14px; color: #0f172a; }
.checkout-row.total {
    background: #f8fafc;
}
.checkout-row.total strong { font-size: 18px; color: #6d28d9; }
.checkout-row.discount strong { color: #16a34a; font-size: 13px; }

.checkout-agree {
    margin: 20px 0;
}
.checkout-agree label {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-pay-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    background: #6d28d9;
    color: #fff;
    cursor: pointer;
    transition: all .2s;
}
.checkout-pay-btn:hover { background: #5b21b6; }
.checkout-pay-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}
.checkout-pay-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

.checkout-note {
    margin-top: 16px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.6;
}

/* ─── 결제 정책 요약 박스 (Checkout 동의 영역) ─── */
.checkout-policy-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 20px 0 16px;
}
/* STEP E: 업그레이드·다운그레이드 안내 박스 (modifier) */
.checkout-policy-box.checkout-policy-upgrade {
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.checkout-policy-box.checkout-policy-downgrade {
    background: #fff5f7;
    border-color: #fde2e7;
}
.checkout-policy-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.checkout-policy-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    color: #475569;
    line-height: 1.7;
}
.checkout-policy-list li { padding: 1px 0; }
.checkout-policy-link {
    color: #6d28d9;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}
.checkout-policy-link:hover { text-decoration: underline; }
.checkout-agree a {
    color: #6d28d9;
    text-decoration: none;
}
.checkout-agree a:hover { text-decoration: underline; }

/* ─── 결제 정책 모달 ─── */
.checkout-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}
.checkout-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.checkout-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.checkout-modal-header strong {
    font-size: 16px;
    color: #0f172a;
}
.checkout-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.checkout-modal-close:hover { color: #0f172a; }
.checkout-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
}
.checkout-modal-body strong { color: #0f172a; }
.checkout-modal-body p { margin: 0 0 6px; }
.checkout-modal-body ul { margin: 0 0 12px; padding-left: 18px; }
.checkout-modal-body a {
    color: #6d28d9;
    text-decoration: none;
}
.checkout-modal-body a:hover { text-decoration: underline; }
.checkout-modal-body .modal-note {
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
}
.checkout-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

/* ═══════ 반응형 ═══════ */
@media (max-width: 768px) {
    .pay-hero-title { font-size: 24px; }
    .pay-plans { grid-template-columns: 1fr; }
    .pay-header { padding: 12px 16px; }
    .checkout-modal-body { font-size: 12.5px; }
}
