/* ===== MyPage Specific Styles ===== */

/* Login Screen */
.mypage-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, #f8f9ff 0%, #fff 100%);
    padding-top: 64px;
}
.login-card {
    background: #fff; border-radius: 20px; padding: 48px 40px;
    max-width: 420px; width: 90%; text-align: center;
    box-shadow: 0 20px 60px rgba(102,126,234,0.12);
}
.login-card h2 { font-size: 1.6rem; font-weight: 700; color: #1a1a2e; margin-bottom: 12px; }
.login-card p { font-size: 0.95rem; color: #666; margin-bottom: 28px; line-height: 1.6; }

/* Loading Screen */
.mypage-loading {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: linear-gradient(180deg, #f8f9ff 0%, #fff 100%);
    padding-top: 64px;
}
.mypage-loading p { margin-top: 16px; color: #888; font-size: 0.95rem; }

/* Main Screen */
.mypage-main {
    min-height: calc(100vh - 180px); padding-top: 100px; padding-bottom: 24px;
    background: linear-gradient(180deg, #f8f9ff 0%, #fff 100%);
}
.mypage-inner { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.site-footer .footer-bottom {
    padding-top: 12px;
    border-top: none;
}
.site-footer .footer-bottom p { margin: 4px 0; }
.mypage-title {
    font-size: 2rem; font-weight: 700; color: #1a1a2e; margin-bottom: 32px;
}

/* Cards */
.card {
    background: #fff; border-radius: 16px; padding: 32px;
    margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #eef0f8;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eef0f8;
}
.card-header h2 { font-size: 1.15rem; font-weight: 600; color: #1a1a2e; margin: 0; }
.card-icon { text-align: center; margin-bottom: 16px; }

/* Status Badge */
.status-badge {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600;
}
.status-badge.active { background: #e6f4ea; color: #137333; }
.status-badge.cancelled { background: #fef3cd; color: #856404; }
.status-badge.expired { background: #fce8e6; color: #c5221f; }
.status-badge.payment_failed { background: #fce8e6; color: #c5221f; }

/* Info Grid */
.info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.info-item {
    display: flex; flex-direction: column; gap: 4px;
}
.info-label { font-size: 0.8rem; font-weight: 500; color: #888; text-transform: uppercase; letter-spacing: 0.3px; }
.info-value { font-size: 0.95rem; font-weight: 600; color: #1a1a2e; }

/* Notices */
.cancel-notice, .fail-notice {
    display: flex; align-items: flex-start; gap: 12px;
    margin-top: 24px; padding: 16px; border-radius: 10px;
}
.cancel-notice {
    background: #fff8e1; border: 1px solid #ffe082;
}
.cancel-notice strong { color: #e65100; font-size: 0.9rem; }
.cancel-notice p { color: #bf360c; font-size: 0.85rem; margin: 4px 0 0; }

/* 다운그레이드 예약 박스: 내용 좌측, 취소 버튼 우측(복사 버튼과 동일 형태) */
.downgrade-notice {
    display: flex; align-items: center; gap: 16px;
    margin-top: 24px; padding: 16px;
    border-radius: 10px; border: 1px solid rgba(102,126,234,0.3);
    background: #f0f0ff;
}
.downgrade-notice-content {
    display: flex; align-items: flex-start; gap: 12px; flex: 1;
}
.downgrade-notice-content strong { color: #667eea; font-size: 0.9rem; }
.downgrade-notice-content p { color: #555; font-size: 0.85rem; margin: 4px 0 0; }
.downgrade-notice .btn-cancel-downgrade-link {
    flex-shrink: 0;
}

.fail-notice {
    background: #fce8e6; border: 1px solid #f5c6cb;
}
.fail-notice strong { color: #c5221f; font-size: 0.9rem; }
.fail-notice p { color: #c5221f; font-size: 0.85rem; margin: 4px 0 0; }

/* 정기결제 재시도 중 (active + 실패 1회 이상) — 노란 계열 */
.retry-notice {
    display: flex; align-items: flex-start; gap: 12px;
    margin-top: 24px; padding: 16px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fcd34d;
}
.retry-notice svg { flex-shrink: 0; }
.retry-notice strong { color: #b45309; font-size: 0.9rem; }
.retry-notice p { color: #92400e; font-size: 0.85rem; margin: 4px 0 0; line-height: 1.55; }
.notice-top { margin-top: 0; margin-bottom: 16px; }
.notice-fail-reason {
    margin-top: 10px; font-size: 0.82rem; line-height: 1.55;
}
.retry-notice .notice-fail-reason { color: #78350f; margin-bottom: 0; }
.fail-notice .notice-fail-reason { color: #942a2a; margin-bottom: 0; }
#paymentRetryModalBody .payment-retry-modal-reason {
    display: block; margin-top: 12px; font-size: 0.88rem; color: #555; line-height: 1.55;
}

/* License Key */
.license-key-display {
    display: flex; align-items: center; gap: 12px;
    background: #f8f9ff; border: 2px solid #667eea; border-radius: 10px;
    padding: 16px;
}
.license-key-display code {
    flex: 1; font-family: 'Courier New', monospace; font-size: 0.95rem;
    word-break: break-all; color: #1a1a2e; user-select: all;
}
.license-hint { font-size: 0.85rem; color: #888; margin-top: 12px; }

/* Action Buttons */
.action-buttons {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.action-btn {
    display: inline-flex; align-items: center; gap: 8px;
    flex: 1; min-width: 160px; justify-content: center;
}
.btn-danger {
    background: #fff; border: 2px solid #ea4335; color: #ea4335;
    padding: 12px 28px; border-radius: 8px; font-weight: 600;
    font-size: 0.95rem; transition: all 0.25s ease; cursor: pointer;
}
.btn-danger:hover { background: #ea4335; color: #fff; transform: translateY(-2px); }

/* Subscription Card - Multi */
.subscription-expired { opacity: 0.6; }
.subscription-card { transition: all 0.3s ease; }

/* License Items in Subscription Card */
.sub-licenses {
    margin-top: 24px;
    padding-top: 0;
    padding-bottom: 20px;
    border-top: none;
    border-bottom: none;
}
.sub-licenses-title { font-size: 0.95rem; font-weight: 600; color: #1a1a2e; margin-bottom: 12px; }
.license-item {
    background: #f8f9ff; border-radius: 10px; padding: 16px; margin-bottom: 10px;
    border: 1px solid #e0e4f0;
}
.license-item:last-child { margin-bottom: 0; }
.license-item-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.license-item-label { font-size: 0.8rem; font-weight: 600; color: #667eea; }
.status-badge-sm {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 0.7rem; font-weight: 600;
}
.status-badge-sm.active { background: #e6f4ea; color: #137333; }
.status-badge-sm.cancelled { background: #fef3cd; color: #856404; }
.status-badge-sm.expired { background: #fce8e6; color: #c5221f; }
.license-key-code {
    font-family: 'Courier New', monospace; font-size: 0.85rem;
    word-break: break-all; color: #1a1a2e; user-select: all;
}
.license-hwid-info {
    font-size: 0.78rem; color: #888; margin-top: 6px;
}

/* Subscription Actions */
.sub-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid #eef0f8; }

/* Add Subscription Card */
.add-subscription-card { text-align: center; padding: 24px; border: 2px dashed #d5daf0; background: transparent; box-shadow: none; }
.add-subscription-card:hover { border-color: #667eea; background: #fafbff; }

/* No Subscription / Expired */
.no-subscription, .expired-card {
    text-align: center; padding: 48px 32px;
}
.no-subscription h2, .expired-card h2 { font-size: 1.3rem; font-weight: 700; color: #1a1a2e; margin-bottom: 12px; }
.no-subscription p, .expired-card p { font-size: 0.95rem; color: #666; margin-bottom: 24px; }

/* Confirm Modal */
.confirm-modal {
    display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #fff; border-radius: 20px; padding: 40px;
    max-width: 440px; width: 90%; z-index: 2001;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}
.confirm-modal.active { display: block; }
.confirm-modal h3 { font-size: 1.2rem; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }
.confirm-modal p { font-size: 0.9rem; color: #666; line-height: 1.6; margin-bottom: 20px; }
.cancel-reason-wrap { margin-bottom: 24px; }
.cancel-reason-wrap label { display: block; font-size: 0.85rem; font-weight: 500; color: #888; margin-bottom: 8px; }
.cancel-reason-wrap textarea {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px;
    font-family: inherit; font-size: 0.9rem; resize: vertical;
    transition: border-color 0.2s ease;
}
.cancel-reason-wrap textarea:focus { border-color: #667eea; outline: none; }
.confirm-actions { display: flex; gap: 12px; justify-content: flex-end; }

.card-change-modal { max-width: 520px; }

/* Nav Logout */
.nav-logout {
    font-size: 0.8rem; padding: 0; margin-left: 8px;
}

/* Toast */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #1a1a2e; color: #fff; padding: 12px 28px; border-radius: 10px;
    font-size: 0.9rem; font-weight: 500; z-index: 3000;
    opacity: 0; transition: all 0.3s ease; pointer-events: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Cancel Defense 3-Step Modal ===== */
.cancel-defense-modal { max-width: 480px; }
.cancel-defense-modal h3 { text-align: center; }

.cancel-loss-visual {
    background: #fff8f0; border: 1px solid #ffe0b2; border-radius: 12px;
    padding: 20px; margin: 20px 0 16px;
}
.cancel-progress-label {
    display: flex; justify-content: space-between; margin-bottom: 8px;
    font-size: 0.85rem; color: #666;
}
.cancel-progress-bar {
    height: 12px; background: #eee; border-radius: 6px; overflow: hidden;
}
.cancel-progress-fill {
    height: 100%; border-radius: 6px; transition: width 0.6s ease;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}
.cancel-loss-warning {
    margin: 12px 0 0; font-size: 0.9rem; color: #e65100; text-align: center;
}
.cancel-step-desc {
    font-size: 0.85rem; color: #888; line-height: 1.6; text-align: center; margin-bottom: 20px;
}

.cancel-finance-box {
    background: #f8f9ff; border: 1px solid #e0e4f0; border-radius: 12px;
    padding: 20px; margin: 20px 0 16px;
}
.cancel-finance-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; font-size: 0.9rem; color: #555;
}
.cancel-finance-row strong { color: #1a1a2e; font-weight: 700; }
.cancel-finance-divider {
    height: 1px; background: #e0e4f0; margin: 8px 0;
}
.cancel-finance-highlight {
    color: #e65100; font-weight: 600;
}
.cancel-finance-highlight strong { color: #e65100; }

.cancel-confirm-checkbox {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 16px 0 20px; padding: 16px; background: #fef3f3; border-radius: 10px;
    border: 1px solid #fce0e0; cursor: pointer; font-size: 0.85rem; color: #555; line-height: 1.5;
}
.cancel-confirm-checkbox input[type="checkbox"] {
    margin-top: 2px; flex-shrink: 0; width: 18px; height: 18px; accent-color: #ea4335;
}
.cancel-step-soft {
    text-align: center; font-size: 0.8rem; color: #aaa; margin-top: 12px;
}
.btn-text-muted {
    color: #aaa !important; border-color: #ddd !important; font-size: 0.85rem !important;
}

/* Progress Bar in Subscription Card */
.sub-progress-section {
    margin-top: 20px; padding: 16px; background: #f8f9ff; border-radius: 10px;
    border: 1px solid #e0e4f0;
}
.sub-progress-label {
    display: flex; justify-content: space-between; margin-bottom: 8px;
    font-size: 0.85rem; color: #666;
}
.sub-progress-bar {
    height: 10px; background: #eee; border-radius: 5px; overflow: hidden;
}
.sub-progress-fill {
    height: 100%; border-radius: 5px; transition: width 0.6s ease;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}
.sub-progress-hint {
    font-size: 0.78rem; color: #888; margin-top: 8px; text-align: center;
}

/* Latest download card */
.download-card-desc {
    margin: 0 0 14px;
    color: #555;
    font-size: 0.88rem;
    line-height: 1.45;
}
.download-card-desc ul {
    list-style: disc;
    margin: 0;
    padding: 0 0 0 1.15em;
}
.download-card-desc li {
    position: relative;
    margin: 6px 0;
}
.download-card-desc li::before {
    content: none;
}
/* 브라우저 기본 마커 색 보정 */
.download-card-desc li::marker {
    color: #555;
    font-weight: inherit;
}
/* li 뒤에 붙은 <br>가 중복 간격을 만들 수 있어 숨김 */
.download-card-desc br {
    display: none;
}
/* download card 내 링크는 텍스트와 구분되게 블루톤 적용 */
.download-card-desc a {
    color: #667eea;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}
.download-card-desc a:hover {
    color: #764ba2;
}
.download-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.download-version {
    font-size: 0.84rem;
    color: #777;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .info-grid { grid-template-columns: 1fr; gap: 16px; }
    .action-buttons { flex-direction: column; }
    .action-btn { min-width: auto; }
    .card { padding: 24px; }
    .mypage-title { font-size: 1.6rem; }
    .login-card { padding: 36px 24px; }
    .confirm-modal { padding: 28px 20px; }
    .license-key-display { flex-direction: column; }
    .download-card-actions { align-items: stretch; }
    .download-card-actions .btn { width: 100%; text-align: center; }
    .download-card .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .download-card .card-header .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
