@charset "utf-8";

/*
 * 신청 화면 액션 버튼 (APC / Appel 공통)
 *
 * 연관 파일
 *   AplyButton.java       버튼 목록·순서·조건·스타일 클래스
 *   actionButtons.tag     렌더링 (.btn_label, data-tooltip, disabled)
 *   ApcDetailPage.js      .fixed / .at-bottom 스크롤 토글
 *   AppelDetailPage.js    동일
 *
 * 클래스 계약
 *   .fixed          스크롤 시 우하단 고정 (버튼은 접지 않고 그대로 노출)
 *   .at-bottom      페이지 최하단 도달 — 현재 스타일 없음, 훅만 유지
 *   .btn_label      버튼 텍스트. 좁은 화면 고정 상태에서 숨겨 아이콘만 남긴다
 *   .action_reason  차단 사유 — 항상 노출 (ActionBar.notice)
 *   [data-tooltip]  부가 안내 — hover 시에만 (ButtonView.tooltip)
 *
 * ※ common.css 뒤에 @import 할 것 (--color-* 변수 의존)
 */

/* ── 기본 배치 ──────────────────────────────────────── */
.action_btn {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

.action_inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

/* 아이콘과 라벨 사이 간격을 gap 으로 준다.
   라벨을 숨겼을 때 여백이 남지 않아 아이콘이 중앙에 온다 */
.action_inner .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── 스크롤 고정 상태 ───────────────────────────────── */
/* 버튼을 접지 않고 그대로 띄운다 */
.action_btn.fixed {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    margin-top: 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .95);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
}

/* ── 차단 사유 ──────────────────────────────────────── */
/* flex-basis:100% 로 버튼 줄 아래에 따로 떨어진다 */
.action_reason {
    flex-basis: 100%;
    margin: 0;
    text-align: right;
    font-size: 13px;
    color: #c0392b;
    line-height: 1.4;
}

/* ── 이동 버튼(<a>) ─────────────────────────────────── */
/* common.css 의 a:link{color:#555} 가 .btn-* 의 color 를 덮어쓴다.
   .btn-* 는 background 에만 !important 가 붙어 있어 글자색이 회색이 됨 */
.action_inner a.btn,
.action_inner a.btn:link,
.action_inner a.btn:visited,
.action_inner a.btn:hover,
.action_inner a.btn:focus {
    text-decoration: none;
    color: #fff;
}

/* ── hover / 포커스 하이라이트 ──────────────────────── */
/* .btn-* 의 background 가 !important 라 색 교체가 불가능 → filter 사용.
   버튼 색상 5종에 규칙 하나로 적용된다 */
.action_inner .btn {
    transition: filter .2s ease, box-shadow .2s ease, transform .2s ease;
}

.action_inner .btn:hover,
.action_inner .btn:focus-visible {
    filter: brightness(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    transform: translateY(-1px);
}

/* ── 비활성 버튼 ────────────────────────────────────── */
.action_inner button[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.action_inner button[disabled]:hover {
    filter: none;
    box-shadow: none;
    transform: none;
}

/* ── 툴팁 ───────────────────────────────────────────── */
/* 모바일에는 hover 가 없어 표시되지 않는다.
   놓쳐도 되는 정보만 담을 것 — 차단 사유는 .action_reason 으로 */
.action_inner [data-tooltip] {
    position: relative;
}

.action_inner [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;

    padding: 6px 12px;
    border-radius: 4px;
    background: var(--color-dark);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease;
    pointer-events: none;
}

/* 말풍선 꼬리 */
.action_inner [data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    border: 6px solid transparent;
    border-top-color: var(--color-dark);

    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease;
    pointer-events: none;
}

.action_inner [data-tooltip]:hover::after,
.action_inner [data-tooltip]:hover::before,
.action_inner [data-tooltip]:focus-visible::after,
.action_inner [data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

/* ── 좁은 화면: 고정 상태에서 아이콘만 ──────────────── */
/* FAB 로 접지 않는 대신 라벨을 숨겨 폭을 줄인다.
   버튼 이름은 마크업의 aria-label 로 계속 읽힌다 */
@media (max-width: 780px) {
    .action_btn.fixed {
        right: 12px;
        bottom: 12px;
        padding: 8px;
        gap: 6px;
    }

    .action_btn.fixed .btn_label {
        display: none;
    }

    .action_btn.fixed .btn {
        min-width: 44px;   /* 터치 목표 최소 크기 */
        min-height: 44px;
        padding: 0;
        justify-content: center;
        gap: 0;
    }

    .action_btn.fixed .btn i {
        margin: 0;
        font-size: 18px;
    }

    /* 떠 있는 버튼 바가 푸터 끝(주소·저작권)을 가리지 않게 그만큼 여백 */
    body:has(.action_btn.fixed) #footer {
        padding-bottom: 80px;
    }

    /* 아이콘만 남으면 사유 문구가 바 전체 폭을 결정해 버린다 */
    .action_btn.fixed .action_reason {
        max-width: 240px;
        margin-top: 4px;
    }
}

/* 검증 실패 항목 강조 */
.field-error,
.field-error input,
.field-error select { background-color: #fdecea !important; transition: background-color .3s; }
/* ── 신청 준비 요약·체크리스트 (2026-10-16) ─────────────── */
/* actionButtons.tag 의 <details class="aply_ready">. 요약을 누르면 목록이 펼쳐진다(읽기 전용).
   바가 제자리면 아래로, 스크롤로 화면 아래 고정(.fixed)이면 위로 펼친다 */
.aply_ready {
    position: relative;
    margin-right: auto;            /* 버튼 줄 왼쪽에 붙는다 */
}
.aply_ready_sum {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.aply_ready_sum::-webkit-details-marker { display: none; }
.aply_ready.is-todo .aply_ready_sum { background: #fdf3dc; border: 1px solid #e8b44c; color: #7a4d00; }
.aply_ready.is-ok   .aply_ready_sum { background: #e7f5ea; border: 1px solid #79b98a; color: #1e6b33; }
.aply_ready_dots { display: inline-flex; gap: 3px; }
.aply_ready_dots span { width: 8px; height: 8px; border-radius: 50%; }
.aply_ready_dots .ok { background: #2e8b57; }
.aply_ready_dots .no { background: #c0392b; }
.aply_ready[open] .aply_ready_chev { transform: rotate(180deg); }

.aply_ready_list {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);         /* 기본 = 아래로 */
    z-index: 1001;
    width: 420px;
    max-width: calc(100vw - 48px);
    margin: 0;
    padding: 4px 14px;
    list-style: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    text-align: left;
}
.action_btn.fixed .aply_ready_list {
    top: auto;
    bottom: calc(100% + 6px);      /* 화면 아래 고정이면 위로 */
}
.aply_ready_list li {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid #eee;
    font-size: 13px;
    line-height: 1.45;
}
.aply_ready_list li:first-child { border-top: 0; }
.aply_ready_list li > i {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.aply_ready_list li.ok > i { background: #e7f5ea; color: #1e6b33; }
.aply_ready_list li.no > i { background: #fbe9e7; color: #c0392b; }
.aply_ready_list strong { display: block; font-weight: 500; color: #222; }
.aply_ready_list span { color: #555; }
.aply_ready_list li.no span { color: #c0392b; }
/* 필수 서류·입력에서 빠진 항목 전부(2026-10-16) — 바깥 li 규칙(flex·위 줄)을 풀어 점 목록으로 */
.aply_ready_list .aply_ready_items { margin: 4px 0 0; padding-left: 16px; list-style: disc; }
.aply_ready_list .aply_ready_items li { display: list-item; padding: 1px 0; border-top: 0; font-size: 12px; color: #c0392b; }
/* 지금 설정의 신청 기준 안내(aplyCheck.js applyReady, 2026-10-16) */
.aply_ready_list li.rule { color: #555; font-size: 12px; }
.aply_ready_list li.rule > i { background: #f1f3f5; color: #555; }
.aply_ready_list li.rule span { color: #555; }
/* 항목이 많으면 목록 안에서 스크롤 */
.aply_ready_list { max-height: 60vh; overflow: auto; }

/* 좁은 화면(모바일)에서 바가 제자리일 때는 목록을 떠 있게 두지 않고 그 자리에 펼쳐
   아래 버튼을 밀어낸다(버튼을 덮지 않게). 화면 아래 고정(.fixed)일 때는 위 규칙대로 위로 뜬다 */
@media (max-width: 768px) {
    .action_btn:not(.fixed) .aply_ready {
        flex-basis: 100%;
        margin-right: 0;
    }
    .action_btn:not(.fixed) .aply_ready_list {
        position: static;
        width: auto;
        max-width: none;
        margin-top: 6px;
        box-shadow: none;
    }
}
