@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;
    }

    /* 아이콘만 남으면 사유 문구가 바 전체 폭을 결정해 버린다 */
    .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; }