/*
 * ============================================================
 * 결과 하단 3개 작업 버튼 + 공통 모달
 * ------------------------------------------------------------
 * - 카톡 전송: 알리고 카카오 알림톡 API 발송
 * - 결과 복사: 현재 가채점 결과 클립보드 복사
 * - 회원가입: 내신닷컴 회원가입 화면 표시
 *
 * 임시저장 버튼과 임시저장 전용 스타일은 제거했습니다.
 * PC와 모바일 모두 버튼 3개가 같은 비율로 보이도록 구성합니다.
 * ============================================================
 */

.result-action-bar {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	width: min(880px, calc(100% - 24px));
	margin: 0 auto 18px;
}

.result-action-bar .action-btn {
	min-width: 0;
	height: 52px;
	padding: 0 10px;
	border: 1px solid #2f6fdb;
	/* border: 1px solid #dce4ef; */
	border-radius: 16px;
	background: #ffffff;
	/* background: #f4f7fb; */
	color: #4f6075;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -0.45px;
	white-space: nowrap;
	cursor: pointer;
	transition:
		transform .15s ease,
		box-shadow .15s ease,
		background-color .15s ease,
		border-color .15s ease;
}

.result-action-bar .action-btn:hover {
	border-color: #cbd8e6;
	background: #ebf1f8;
}

.result-action-bar .action-btn:active {
	transform: scale(.97);
}

/*
 * 화면에는 "카톡 전송"이라고 표시하지만 실제 기능은 알리고 알림톡입니다.
 * 카카오 대표 색상은 유지하여 사용자가 전송 기능을 쉽게 찾게 합니다.
 */
.result-action-bar .action-btn.kakao {
	border-color: #fee500;
	background: #fee500;
	color: #191919;
}

.result-action-bar .action-btn.kakao:hover {
	background: #f5dc00;
}

.result-action-bar .action-btn.join {
	border-color: #2f6fdb;
	background: #2f6fdb;
	color: #fff;
	box-shadow: 0 7px 16px rgba(47, 111, 219, .20);
}

.result-action-bar .action-btn.join:hover {
	background: #245fca;
}

/* 공통 모달 배경 */
.result-action-modal[hidden] {
	display: none !important;
}

.result-action-modal {
	position: fixed;
	inset: 0;
	z-index: 2147482500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding:
		max(18px, env(safe-area-inset-top))
		18px
		max(18px, env(safe-area-inset-bottom));
	background: rgba(15, 23, 42, .48);
	-webkit-backdrop-filter: blur(12px) saturate(115%);
	backdrop-filter: blur(12px) saturate(115%);
	animation: resultActionFade .16s ease-out both;
}

body.result-action-modal-open {
	overflow: hidden;
	touch-action: none;
}

.result-action-dialog {
	width: min(520px, 100%);
	max-height: min(86vh, 780px);
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(255, 255, 255, .72);
	border-radius: 24px;
	background: rgba(255, 255, 255, .97);
	box-shadow: 0 28px 80px rgba(15, 23, 42, .38);
	overflow: hidden;
	color: #18365a;
	animation: resultActionUp .20s cubic-bezier(.2, .8, .2, 1) both;
}

/* 회원가입 iframe을 표시할 때만 넓은 모달을 사용합니다. */
.result-action-dialog.is-wide {
	width: min(900px, 100%);
}

.result-action-modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 22px 16px;
	border-bottom: 1px solid #e5edf4;
}

.result-action-modal-head-copy {
	min-width: 0;
}

.result-action-eyebrow {
	display: block;
	margin-bottom: 5px;
	font-size: 11px;
	font-weight: 900;
	letter-spacing: .08em;
	color: #6b7d91;
}

.result-action-modal-title {
	margin: 0;
	font-size: 21px;
	line-height: 1.25;
	letter-spacing: -.045em;
	color: #18365a;
}

.result-action-modal-close {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 999px;
	background: #f1f5f9;
	color: #334155;
	font-size: 24px;
	line-height: 1;
	font-weight: 700;
	cursor: pointer;
}

.result-action-modal-body {
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 20px 22px;
}

.result-action-modal-foot {
	display: flex;
	gap: 10px;
	padding: 14px 22px 20px;
	border-top: 1px solid #e5edf4;
	background: rgba(248, 250, 252, .92);
}

.result-action-modal-foot:empty {
	display: none;
}

.result-action-field {
	display: block;
	margin-bottom: 15px;
}

.result-action-field > span {
	display: block;
	margin-bottom: 7px;
	font-size: 13px;
	font-weight: 900;
	color: #334e6f;
}

.result-action-input,
.result-action-textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ccd9e5;
	border-radius: 15px;
	background: #fff;
	color: #173657;
	font: inherit;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.result-action-input {
	height: 50px;
	padding: 0 14px;
	font-size: 16px;
	font-weight: 800;
}

.result-action-textarea {
	min-height: 230px;
	padding: 13px 14px;
	resize: vertical;
	font-size: 13px;
	line-height: 1.55;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.result-action-input:focus,
.result-action-textarea:focus {
	border-color: #4f8ee8;
	box-shadow: 0 0 0 4px rgba(79, 142, 232, .13);
}

.result-action-help,
.result-action-status {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	color: #64748b;
}

.result-action-status {
	min-height: 20px;
	margin-top: 10px;
	font-weight: 800;
}

.result-action-status.is-error {
	color: #c2410c;
}

.result-action-status.is-ok {
	color: #15803d;
}

.result-action-notice {
	padding: 14px 15px;
	border: 1px solid #d7e5f1;
	border-radius: 16px;
	background: #f8fbff;
	font-size: 13px;
	line-height: 1.55;
	color: #4d6580;
}

.result-action-notice strong,
.result-action-notice span {
	display: block;
}

.result-action-notice strong {
	margin-bottom: 4px;
	color: #18365a;
}

/* 알림톡 전송 방식 안내는 입력칸과 시각적으로 분리합니다. */
.result-action-channel-notice {
	margin-bottom: 16px;
	border-color: #f2dc52;
	background: #fffced;
	color: #665b16;
}

.result-action-btn {
	min-height: 46px;
	flex: 1 1 0;
	border: 1px solid #ccd8e5;
	border-radius: 14px;
	padding: 0 16px;
	background: #fff;
	color: #34506f;
	font-size: 14px;
	font-weight: 900;
	cursor: pointer;
}

.result-action-btn.primary {
	border-color: #2f6fdb;
	background: #2f6fdb;
	color: #fff;
}

.result-action-btn.kakao {
	border-color: #fee500;
	background: #fee500;
	color: #191919;
}

.result-action-btn:disabled {
	opacity: .55;
	cursor: wait;
}

.result-action-join-frame {
	width: 100%;
	height: min(68vh, 680px);
	margin-top: 14px;
	border: 0;
	border-radius: 16px;
	background: #fff;
}

.result-action-toast {
	position: fixed;
	left: 50%;
	bottom: calc(22px + env(safe-area-inset-bottom));
	z-index: 2147482600;
	max-width: calc(100vw - 32px);
	transform: translate(-50%, 20px);
	padding: 12px 16px;
	border-radius: 999px;
	background: rgba(15, 23, 42, .94);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	box-shadow: 0 12px 34px rgba(15, 23, 42, .28);
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
}

.result-action-toast.is-show {
	opacity: 1;
	transform: translate(-50%, 0);
}

@keyframes resultActionFade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes resultActionUp {
	from {
		opacity: 0;
		transform: translateY(14px) scale(.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 560px) {
	.result-action-bar {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 6px;
		width: calc(100% - 20px);
	}

	.result-action-bar .action-btn {
		height: 48px;
		padding: 0 5px;
		border-radius: 14px;
		font-size: 13px;
		letter-spacing: -.65px;
	}

	.result-action-modal {
		align-items: flex-end;
		padding: 12px 10px max(10px, env(safe-area-inset-bottom));
	}

	.result-action-dialog,
	.result-action-dialog.is-wide {
		width: 100%;
		max-height: 92vh;
		border-radius: 24px 24px 18px 18px;
	}

	.result-action-modal-head {
		padding: 18px 18px 14px;
	}

	.result-action-modal-body {
		padding: 17px 18px;
	}

	.result-action-modal-foot {
		padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
		flex-wrap: wrap;
	}

	.result-action-btn {
		min-width: calc(50% - 5px);
	}

	.result-action-textarea {
		min-height: 190px;
	}

	.result-action-join-frame {
		height: 66vh;
	}
}
