@charset "utf-8";
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard-dynamic-subset.css');

/* ============================================================
   modal.css — 모달 / 토스트 / 오버레이 공통 UI 베이스
   ============================================================ */

/* ── CSS 변수 ── */
:root {
    --rl-primary: #2563eb;
    --rl-primary-hover: #1d4ed8;
    --rl-gray-50: #f9fafb;
    --rl-gray-100: #f3f4f6;
    --rl-gray-200: #e5e7eb;
    --rl-gray-400: #9ca3af;
    --rl-gray-500: #6b7280;
    --rl-gray-600: #4b5563;
    --rl-gray-800: #1f2937;
    --rl-gray-900: #111827;
    --rl-overlay-bg: rgba(0,0,0,0.6);
    --rl-modal-radius: 20px;
    --rl-modal-shadow: 0 12px 40px rgba(0,0,0,0.15);
    --rl-btn-radius: 10px;
    --rl-toast-radius: 12px;
}

/* ── 오버레이 ── */
.rl-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--rl-overlay-bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rl-overlay.rl-animate {
    animation: rlFadeIn 0.2s ease both;
}

/* 풀스크린 모달: 모달이 .at-content 자손이라 래퍼 통숨김 불가 → 조상 경로만 남기고 테마 크롬 숨김 */
body.rl-fullscreen-modal #thema_wrapper > *:not(.at-body),
body.rl-fullscreen-modal #thema_wrapper > .at-body > *:not(.at-container):not(.at-row) {
    display: none !important;
}

/* ── 모달 박스 ── */
.rl-modal {
    background: #fff;
    border-radius: var(--rl-modal-radius);
    padding: 32px 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--rl-modal-shadow);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.rl-modal button,
.rl-modal a,
.rl-modal input,
.rl-modal select,
.rl-modal textarea {
    font-family: inherit;
}

.rl-overlay.rl-animate .rl-modal {
    animation: rlSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── 모달 타이틀/설명 ── */
.rl-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--rl-gray-900);
    margin: 0 0 12px;
    line-height: 1.4;
}

.rl-modal-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--rl-gray-500);
    margin: 0 0 24px;
    word-break: keep-all;
}

/* ── 소셜 버튼 공통 ── */
.rl-btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--rl-btn-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.rl-btn-social:active {
    transform: scale(0.98);
}

.rl-btn-social i {
    margin-right: 8px;
    font-size: 16px;
}

.rl-btn-kakao {
    background: #FEE500;
    color: #3C1E1E;
}
.rl-btn-kakao:hover {
    filter: brightness(0.96);
}

.rl-btn-apple {
    background: #000;
    color: #fff;
}
.rl-btn-apple,
.rl-btn-apple:visited,
.rl-btn-apple:link {
    color: #fff !important;
}
.rl-btn-apple:hover {
    filter: brightness(1.2);
}

.rl-btn-google {
    background: #fff;
    color: var(--rl-gray-800);
    border: 1px solid var(--rl-gray-200);
}
.rl-btn-google:hover {
    background: var(--rl-gray-50);
}

.rl-btn-email {
    background: transparent;
    color: var(--rl-gray-400);
    font-size: 13px;
    font-weight: 400;
    padding: 10px 20px;
}
.rl-btn-email:hover {
    color: var(--rl-gray-600);
}

/* ── 보조 액션 버튼 ── */
.rl-btn-sub {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--rl-btn-radius);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    background: var(--rl-gray-100);
    color: var(--rl-gray-500);
    margin-top: 4px;
    transition: background 0.15s ease;
}
.rl-btn-sub:hover {
    background: var(--rl-gray-200);
    color: var(--rl-gray-600);
    text-decoration: none;
}

/* ── 폴백 모달 전용 ── */

/* 아이콘 영역 */
.rl-modal-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 16px;
}

/* 버튼 그룹 (소셜 버튼들 래퍼) */
.rl-btn-group {
    margin-top: 20px;
}

/* 텍스트 링크 공통 (이탈/삭제 등 약한 액션) */
.rl-btn-dismiss,
.rl-btn-discard-text {
    display: block;
    padding: 8px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: color 0.15s ease;
}
.rl-btn-dismiss:hover,
.rl-btn-discard-text:hover {
    text-decoration: none;
}

/* 이탈 링크: 가입 CTA보다 확실히 약하게 */
.rl-btn-dismiss {
    margin-top: 16px;
    font-size: 12px;
    color: var(--rl-gray-400);
}
.rl-btn-dismiss:hover {
    color: var(--rl-gray-500);
}

/* 확인 단계: "돌아가서 가입하기" (primary) */
.rl-btn-back {
    background: var(--rl-primary);
    color: #fff;
}
.rl-btn-back,
.rl-btn-back:visited,
.rl-btn-back:link {
    color: #fff !important;
}
.rl-btn-back:hover {
    background: var(--rl-primary-hover);
}

/* 확인 단계: "삭제하고 나가기" (destructive, 약한 텍스트 링크) */
.rl-btn-discard-text {
    margin-top: 12px;
    font-size: 13px;
    color: #ef4444;
}
.rl-btn-discard-text:hover {
    color: #dc2626;
}

/* 포커스 링 통일 (포커스 트랩 시 깔끔하게) */
.guest-signup-modal a:focus-visible {
    outline: 2px solid var(--rl-primary);
    outline-offset: 2px;
    border-radius: var(--rl-btn-radius);
}

/* ── Bootstrap confirmModal / examConfirmModal 오버라이드 (.rl-confirm) ── */
.rl-confirm .modal-dialog {
    max-width: 420px;
}

.rl-confirm .modal-content {
    border: none;
    border-radius: var(--rl-modal-radius);
    overflow: hidden;
    box-shadow: var(--rl-modal-shadow);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--rl-gray-800);
}

.rl-confirm .modal-content button,
.rl-confirm .modal-content a,
.rl-confirm .modal-content input,
.rl-confirm .modal-content select,
.rl-confirm .modal-content textarea {
    font-family: inherit;
}

.rl-confirm .modal-header {
    border-bottom: 1px solid var(--rl-gray-100);
    padding: 20px 24px 16px;
}

.rl-confirm .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--rl-gray-900);
}

.rl-confirm .close {
    font-size: 22px;
    opacity: 0.4;
    transition: opacity 0.15s ease;
    padding: 0;
    margin: -4px -4px -4px auto;
}
.rl-confirm .close:hover {
    opacity: 0.7;
}

.rl-confirm .modal-body {
    padding: 24px 24px 16px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--rl-gray-800);
    word-break: keep-all;
}

.rl-confirm .modal-footer {
    border-top: 1px solid var(--rl-gray-100);
    padding: 16px 24px 20px;
}

.rl-confirm .modal-footer .btn {
    border-radius: var(--rl-btn-radius) !important;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.rl-confirm .modal-footer .btn-primary {
    background: var(--rl-primary);
    border-color: var(--rl-primary);
}
.rl-confirm .modal-footer .btn-primary:hover {
    background: var(--rl-primary-hover);
    border-color: var(--rl-primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.rl-confirm .modal-footer .btn-secondary,
.rl-confirm .modal-footer .btn-default {
    background: var(--rl-gray-100);
    border-color: var(--rl-gray-100);
    color: var(--rl-gray-600);
}
.rl-confirm .modal-footer .btn-secondary:hover,
.rl-confirm .modal-footer .btn-default:hover {
    background: var(--rl-gray-200);
    border-color: var(--rl-gray-200);
}

.rl-confirm .modal-footer .btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.rl-confirm .modal-footer .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* ── Backdrop 톤 통일 (.rl-backdrop 타겟만) ── */
.modal-backdrop.rl-backdrop.in {
    opacity: 0.6;
}

/* ── Sheet-modal ── */
.rl-sheet-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 768px;
    margin: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.rl-sheet-header {
    text-align: right;
    padding: 12px 12px 0;
}

.rl-btn-close {
    padding: 6px 12px;
    background: none;
    color: var(--rl-gray-500);
    border-radius: 8px;
    border: 1px solid var(--rl-gray-200);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.rl-btn-close:hover {
    background: var(--rl-gray-50);
    border-color: var(--rl-gray-400);
}

.rl-sheet-frame {
    flex: 1;
    border: none;
    padding: 10px;
}

/* ── 토스트 (.rl-toast 네임스페이스) ── */
#toast-container {
    position: fixed;
    z-index: 20000;
    pointer-events: none;
}

@media (min-width: 768px) {
    #toast-container {
        bottom: 16px;
        right: 16px;
    }
    #toast-container .rl-toast {
        width: 350px;
        margin-bottom: 16px;
    }
}

@media (max-width: 767px) {
    #toast-container {
        bottom: 16px;
        left: 16px;
        right: 16px;
    }
    #toast-container .rl-toast {
        width: auto;
        margin-bottom: 8px;
    }
}

#toast-container .rl-toast {
    display: flex;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--rl-toast-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: auto;
    font-size: 14px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

#toast-container .rl-toast.show {
    opacity: 1;
}

#toast-container .rl-toast:not(.action-toast) .toast-body {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
}

#toast-container .rl-toast:not(.action-toast) .toast-message {
    flex: 1;
    color: var(--rl-gray-800);
}

#toast-container .rl-toast:not(.action-toast) .btn-close {
    background: transparent;
    border: 0;
    font-size: 14px;
    line-height: 1;
    color: #000;
    opacity: 0.4;
    cursor: pointer;
    margin-left: 8px;
}

#toast-container .rl-toast:not(.action-toast) .btn-close:hover {
    opacity: 0.7;
}

#toast-container .rl-toast.action-toast .toast-body {
    display: flex;
    flex-direction: column;
    padding: 0;
}

#toast-container .rl-toast.action-toast .toast-header-inline {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
}

#toast-container .rl-toast.action-toast .toast-header-inline .toast-message {
    flex: 1;
    color: var(--rl-gray-800);
    line-height: 1.4;
}

#toast-container .rl-toast.action-toast .toast-header-inline .btn-close {
    background: transparent;
    border: 0;
    font-size: 14px;
    line-height: 1;
    color: #000;
    opacity: 0.4;
    cursor: pointer;
    margin: 0;
}

#toast-container .rl-toast.action-toast .toast-header-inline .btn-close:hover {
    opacity: 0.7;
}

#toast-container .rl-toast.action-toast .toast-action {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 8px !important;
    border: 1px solid var(--rl-primary);
    background-color: var(--rl-primary);
    color: #fff;
    cursor: pointer;
    width: fit-content;
    font-weight: 600;
    transition: background 0.15s ease;
}

#toast-container .rl-toast.action-toast .toast-action:hover {
    background-color: var(--rl-primary-hover);
    border-color: var(--rl-primary-hover);
}

/* ── 다크모드 ──
   .rl-modal / .rl-overlay 는 #thema_wrapper 내부에 있으므로 기존 선택자 유지.
   .rl-confirm (Bootstrap modal) 과 #toast-container 는 body 직하에 렌더링되므로
   #thema_wrapper.dark-mode 하위 선택자가 매칭되지 않음 → body.dark-mode 도 함께 사용. */
#thema_wrapper.dark-mode .rl-modal {
    background: #1e1e1e;
    color: #eee;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
#thema_wrapper.dark-mode .rl-modal-title {
    color: #f3f4f6;
}
#thema_wrapper.dark-mode .rl-modal-desc {
    color: #a1a1aa;
}

#thema_wrapper.dark-mode .rl-confirm .modal-content,
body.dark-mode .rl-confirm .modal-content {
    background: #1e1e1e;
    color: #eee;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
#thema_wrapper.dark-mode .rl-confirm .modal-body,
body.dark-mode .rl-confirm .modal-body {
    color: #ddd;
}
#thema_wrapper.dark-mode .rl-confirm .modal-header,
body.dark-mode .rl-confirm .modal-header {
    border-bottom-color: #333;
}
#thema_wrapper.dark-mode .rl-confirm .modal-footer,
body.dark-mode .rl-confirm .modal-footer {
    border-top-color: #333;
}

#thema_wrapper.dark-mode #toast-container .rl-toast,
body.dark-mode #toast-container .rl-toast {
    background-color: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
#thema_wrapper.dark-mode #toast-container .rl-toast .toast-message,
body.dark-mode #toast-container .rl-toast .toast-message {
    color: #eee;
}
#thema_wrapper.dark-mode #toast-container .rl-toast .btn-close,
body.dark-mode #toast-container .rl-toast .btn-close {
    color: #fff;
}

/* ── 반응형 ── */
@media (max-width: 480px) {
    .rl-modal {
        border-radius: 16px;
        padding: 28px 20px;
    }
    .rl-confirm .modal-content {
        border-radius: 16px;
    }
    .rl-confirm .modal-dialog {
        margin: 10px;
    }
}

/* ── 키프레임 ── */
@keyframes rlFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes rlSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
