/*! Copyright (C) 2026 새롬소프트 Co.Ltd. All Rights Reserved. */
/* =====================================================
   공통 확인/알림 모달 — modal.js 와 함께 사용

   ★ 이 파일은 consent-core 에 있다 — 원내(7060)와 원외(7070)가 함께 쓴다.
     두 앱 모두 core 를 의존하므로 같은 주소(/lifeconsent/css/modal.css)로 서빙된다.
     모듈마다 복사본을 두면 한쪽만 고쳐져 두 화면의 대화상자가 갈라진다.
   옛 서식작성 화면(공통 common.css) 의 모달과 "동일한" 외형이 되도록,
   common.css/variables.css 의 값을 그대로 px 로 옮겨 자립화했다(1rem=10px 기준).

   ⚠️ 일부 페이지가 자체적으로 .modal / .btn 클래스를 정의하므로,
      대화상자 규칙은 모두 .modal-backdrop 하위로 스코프하여
      페이지 자체 스타일(.modal{display:none;position:fixed})에 가려지지 않게 한다.
===================================================== */

body.is-locked { overflow: hidden; }

.modal-backdrop {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, .55);          /* --color-overlay */
	z-index: 3000;                            /* --z-modal(300) 이상 */
	display: none; align-items: center; justify-content: center;
	padding: 24px;                            /* --gap-lg */
	font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif;
}
/* 애니메이션 없이 바로 뜨고 바로 숨는다(2026-11-17 사용자 지적). 화면 전체를 덮는 바탕의 투명도와 창의 확대를
   함께 움직이면 무거운 화면(서식작성)에서 창이 버벅이며 올라왔다 — 작성 화면의 흰 틀(popup.css)도 같은 까닭으로 애니메이션이 없다.
   원외 휴대폰도 이 파일을 쓴다(성능이 낮은 기기일수록 더 버벅인다). */
.modal-backdrop.is-active { display: flex; }

/* 대화상자 — 페이지 자체 .modal(display:none/position:fixed/dark bg/padding) 무력화 */
.modal-backdrop .modal {
	position: static; inset: auto;
	display: block;
	padding: 0;                              /* 페이지 .modal padding 새어듦 차단 (헤더 여백 방지) */
	margin: 0;
	background: #fff;
	border-radius: 24px;                     /* --radius-xl */
	width: 100%; max-width: 360px;           /* 36rem */
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .20);  /* 0 2rem 6rem --color-shadow-lg */
	overflow: hidden;
}

.modal-backdrop .modal__header {
	border-radius: 24px 24px 0 0;
	display: flex; align-items: center; justify-content: center;
	padding: 12px 8px;                       /* 1.2rem --gap-sm */
	gap: 4px;                                 /* --gap-xs */
	border-bottom: 1px solid #D1D5DC;        /* --color-gray-200 */
	background: #155DFC;                      /* --color-primary */
	color: #fff;
}
.modal-backdrop .modal__icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.modal-backdrop .modal--success .modal__header { background: #27ae60; }
.modal-backdrop .modal--warning .modal__header { background: #f39c12; }
.modal-backdrop .modal--error   .modal__header { background: #e74c3c; }
.modal-backdrop .modal--info    .modal__header { background: #155DFC; }

.modal-backdrop .modal__title { margin: 0; font-size: 18px; font-weight: 400; color: inherit; }

.modal-backdrop .modal__msg {
	margin: 0; background: #fff;
	font-size: 18px; color: #555555; line-height: 1.9;   /* --font-size-md / --color-gray-600 / --line-height-loose */
	white-space: pre-line;
	/* 낱말 중간에서 끊지 않는다('중/지하면'). 공백 없는 긴 서식명이나 오류 문구는 keep-all 만 두면 창 밖으로 넘치므로 그때만 글자 단위로 끊는다 */
	word-break: keep-all; overflow-wrap: anywhere;
	padding: 48px 24px;                      /* --gap-2xl --gap-lg */
}

.modal-backdrop .modal__actions {
	background: #fff; display: flex; gap: 16px; justify-content: center;   /* --gap-md */
	padding: 0 24px 24px;                    /* 0 --gap-lg --gap-lg */
}

/* 버튼 — common.css .btn / .btn-primary / .btn-white-line 를 그대로 재현 (모달 내부로 스코프) */
.modal-backdrop .modal__actions .btn {
	flex: 1;
	display: flex; align-items: center; justify-content: center; gap: 8px;   /* --gap-sm */
	padding: 14px 32px;                      /* 1.4rem 3.2rem */
	font-size: 16px; font-weight: 400;       /* --font-size-base / --font-weight-regular */
	border-radius: 16px;                     /* --radius-lg */
	border: 0;
	transition: .3s ease;                    /* --transition-base */
	cursor: pointer;
	min-width: 0;
}
.modal-backdrop .modal__actions .btn-primary { background: #155DFC; color: #fff; }
.modal-backdrop .modal__actions .btn-primary:hover { background: #194a99; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
.modal-backdrop .modal__actions .btn-white-line { border: 1px solid #99A1AF; background: #fff; color: #555555; }
.modal-backdrop .modal__actions .btn-white-line:hover { background: #f0f0f0; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }

/* 목록에서 하나 고르기(Modal.choose, 2026-10-30) — 서식작성의 태블릿 선택. 고를 줄이 길어지므로 문구 여백을 줄인다.
   한 줄이 누르는 자리라 태블릿에서도 44px 이상이 되게 위아래 여백을 둔다. */
.modal-backdrop .modal--choose .modal__msg { padding: 28px 24px 12px; }
.modal-backdrop .modal__choices { display: flex; flex-direction: column; gap: 8px; padding: 0 24px 16px; }
.modal-backdrop .modal__choices:empty { display: none; }
.modal-backdrop .modal__choice {
	width: 100%; text-align: left;
	padding: 14px 16px;
	border: 1px solid #D1D5DC; border-radius: 12px;
	background: #f8fafc; color: #333;
	font-size: 16px; font-family: inherit;
	cursor: pointer;
}
.modal-backdrop .modal__choice:hover { background: #eef4ff; border-color: #155DFC; }

/* ============================================================================
   Toast (스낵바) — toast.js 와 짝이다. 화면마다 복사돼 있던 8벌을 여기로 합쳤다.

   ★ common.css 가 아니라 여기다 — common.css 는 formWork·login 만 물고 있어
     iframe 안의 설정·목록 화면에는 닿지 않는다.

   ★ rem 을 쓰지 않는다. 이 프로젝트는 rem 기준이 둘이다 —
     common.css 의 html{font-size:62.5%} 로 formWork·login 은 1rem=10px 이고,
     그 CSS 를 안 쓰는 화면은 16px 이다. 같은 .82rem 이 한쪽에선 8px, 다른 쪽에선
     13px 로 렌더돼 옛 8벌의 값이 갈렸던 것도 이 때문이다.
     고정 위치 오버레이는 본문 흐름을 타지 않으므로 페이지 글자 크기를 따라갈 이유가
     없다 — font-size 만 절대값으로 두고 나머지는 전부 그 값에 비례(em)시킨다.

   반응형: max-width 가 좁은 화면에서 줄바꿈시키고 화면 밖으로 밀리지 않게 한다.
   ============================================================================ */
.toast {
	position: fixed;
	left: 50%;
	bottom: 1.5em;
	transform: translateX(-50%) translateY(.6em);
	z-index: 20;
	max-width: min(90vw, 34em);
	padding: .45em .9em;
	border-radius: .6em;
	background: #0f172a;
	color: #fff;
	font-size: 13px;          /* 유일한 절대값 — 위 em 들이 여기서 파생된다 */
	line-height: 1.5;
	text-align: center;
	word-break: keep-all;
	overflow-wrap: anywhere;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: .94; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
	.toast { transition: none; transform: translateX(-50%); }
	.toast.show { transform: translateX(-50%); }
}
