/*
 * Hanuman PDF Editor.
 * Palette taken from the Hanuman mark: red ground, navy line, green accent.
 * Every rule is scoped under .hnmpdf so nothing leaks into the theme.
 */

@font-face {
	font-family: "HNMPDF Sarabun";
	src: url("../fonts/Sarabun-Regular.ttf") format("truetype");
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: "HNMPDF Sarabun";
	src: url("../fonts/Sarabun-Bold.ttf") format("truetype");
	font-weight: 700;
	font-display: swap;
}

@font-face {
	font-family: "HNMPDF Prompt";
	src: url("../fonts/Prompt-Regular.ttf") format("truetype");
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: "HNMPDF Prompt";
	src: url("../fonts/Prompt-Bold.ttf") format("truetype");
	font-weight: 700;
	font-display: swap;
}

.hnmpdf {
	--hnmpdf-accent: #04826d;
	--hnmpdf-navy: #012f54;
	--hnmpdf-red: #a63934;
	--hnmpdf-mist: #f3f6f6;
	--hnmpdf-muted: #3d5568;
	--hnmpdf-line: #9fb1bd;
	--hnmpdf-soft: #eaf4f1;
	--hnmpdf-shadow: 0 10px 30px rgba(1, 47, 84, 0.14);
	--hnmpdf-head: "HNMPDF Prompt", "Prompt", sans-serif;
	box-sizing: border-box;
	max-width: 1100px;
	margin: 0 auto 2em;
	padding: 0 0 20px;
	border-radius: 24px;
	background: var(--hnmpdf-mist);
	color: var(--hnmpdf-navy);
	font-family: "HNMPDF Sarabun", "Sarabun", sans-serif;
	font-size: 17px;
	line-height: 1.6;
	text-align: left;
}

.hnmpdf *,
.hnmpdf *::before,
.hnmpdf *::after {
	box-sizing: border-box;
}

.hnmpdf [hidden] {
	display: none !important;
}

.hnmpdf svg {
	flex: none;
}

/* Hero: the Hanuman picture sits on its own red ground. */

.hnmpdf .hnmpdf-hero {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	padding: 48px 46% 120px 40px;
	border-radius: 24px 24px 0 0;
	background: var(--hnmpdf-red) url("../img/hanuman.jpg") no-repeat right -20px center / auto 125%;
	color: #fff;
}

.hnmpdf .hnmpdf-hero-tool {
	padding-top: 28px;
	padding-bottom: 84px;
	background-size: auto 190%;
	background-position: right 3% center;
}

.hnmpdf .hnmpdf-hero-slim {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px 74px;
	background-size: auto 330%;
	background-position: right 30% top 24%;
}

.hnmpdf .hnmpdf-hero-slim .hnmpdf-brand {
	padding: 6px 14px 6px 6px;
	border-radius: 14px;
	background: var(--hnmpdf-navy);
}

.hnmpdf .hnmpdf-brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-family: var(--hnmpdf-head);
	font-weight: 700;
	font-size: 18px;
}

.hnmpdf .hnmpdf-brand img {
	width: 40px;
	height: 40px;
	margin: 0;
	border-radius: 11px;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.hnmpdf .hnmpdf-badge {
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--hnmpdf-navy);
	font-family: var(--hnmpdf-head);
	font-size: 14px;
}

.hnmpdf .hnmpdf-title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: var(--hnmpdf-head);
	font-weight: 700;
	font-size: clamp(26px, 4.2vw, 44px);
	line-height: 1.25;
}

.hnmpdf .hnmpdf-hero-tool .hnmpdf-title {
	font-size: clamp(24px, 3.4vw, 36px);
}

.hnmpdf .hnmpdf-desc {
	margin: 0;
	color: inherit;
	font-size: 18px;
}

.hnmpdf .hnmpdf-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 10px;
	background: var(--hnmpdf-navy);
	color: #fff;
	font-family: var(--hnmpdf-head);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.3;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
}

.hnmpdf .hnmpdf-back:hover,
.hnmpdf .hnmpdf-back:focus {
	background: var(--hnmpdf-accent);
	color: #fff;
	text-decoration: none;
}

.hnmpdf .hnmpdf-back svg {
	width: 18px;
	height: 18px;
}

/* Hub cards overlap the bottom of the hero. */

.hnmpdf .hnmpdf-hub {
	position: relative;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin: -84px 0 0;
	padding: 0 20px;
	list-style: none;
}

.hnmpdf .hnmpdf-hub li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hnmpdf .hnmpdf-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 20px;
	border: 0;
	border-radius: 18px;
	background: #fff;
	color: var(--hnmpdf-navy);
	font: inherit;
	line-height: 1.5;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	white-space: normal;
	cursor: pointer;
	box-shadow: var(--hnmpdf-shadow);
	transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.hnmpdf .hnmpdf-card:hover,
.hnmpdf .hnmpdf-card:focus-visible {
	background: #fff;
	color: var(--hnmpdf-navy);
	text-decoration: none;
	transform: translateY(-3px);
	box-shadow: 0 16px 36px rgba(1, 47, 84, 0.22);
}

.hnmpdf .hnmpdf-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 14px;
	background: var(--hnmpdf-navy);
	color: #fff;
	font-style: normal;
}

.hnmpdf .hnmpdf-card strong {
	display: block;
	color: inherit;
	font-family: var(--hnmpdf-head);
	font-weight: 700;
	font-size: 18px;
}

.hnmpdf .hnmpdf-card span {
	display: block;
	color: var(--hnmpdf-muted);
	font-size: 15.5px;
	font-weight: 400;
}

/* The Thai watermark tool is the one filled card. */

.hnmpdf .hnmpdf-card-watermark,
.hnmpdf .hnmpdf-card-watermark:hover,
.hnmpdf .hnmpdf-card-watermark:focus-visible {
	background: var(--hnmpdf-accent);
	color: #fff;
}

.hnmpdf .hnmpdf-card-watermark span {
	color: #fff;
}

.hnmpdf .hnmpdf-card-watermark .hnmpdf-card-icon {
	background: #fff;
	color: var(--hnmpdf-accent);
}

/* Tool panel */

.hnmpdf .hnmpdf-mount {
	padding: 0 20px;
}

.hnmpdf .hnmpdf-mount:empty {
	display: none;
}

.hnmpdf .hnmpdf-tool {
	position: relative;
	margin-top: -56px;
	padding: 22px;
	border-radius: 18px;
	background: #fff;
	box-shadow: var(--hnmpdf-shadow);
}

/* A tool opened inside the hub has no hero above it. */

.hnmpdf .hnmpdf-mount .hnmpdf-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin: -84px 0 16px;
	padding: 20px 22px 70px;
	border-radius: 18px;
	background: var(--hnmpdf-navy);
	color: #fff;
	position: relative;
}

.hnmpdf .hnmpdf-mount .hnmpdf-head .hnmpdf-title {
	font-size: 26px;
}

.hnmpdf .hnmpdf-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin: 0 0 18px;
	padding: 0 0 16px;
	border-bottom: 1px solid #dce5e8;
	list-style: none;
	font-family: var(--hnmpdf-head);
	font-size: 15px;
}

.hnmpdf .hnmpdf-steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	color: var(--hnmpdf-muted);
	list-style: none;
}

.hnmpdf .hnmpdf-steps i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 2px solid var(--hnmpdf-line);
	border-radius: 50%;
	font-style: normal;
	font-size: 14px;
}

.hnmpdf .hnmpdf-steps .hnmpdf-step-now {
	color: var(--hnmpdf-navy);
	font-weight: 700;
}

.hnmpdf .hnmpdf-steps .hnmpdf-step-now i {
	border-color: var(--hnmpdf-navy);
	background: var(--hnmpdf-navy);
	color: #fff;
}

.hnmpdf .hnmpdf-steps .hnmpdf-step-done {
	color: var(--hnmpdf-accent);
}

.hnmpdf .hnmpdf-steps .hnmpdf-step-done i {
	border-color: var(--hnmpdf-accent);
	background: var(--hnmpdf-accent);
	color: #fff;
}

/* Drop zone */

.hnmpdf .hnmpdf-drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 170px;
	padding: 24px 16px;
	border: 2px dashed var(--hnmpdf-accent);
	border-radius: 16px;
	background: var(--hnmpdf-soft);
	text-align: center;
	cursor: pointer;
	transition: background 0.15s ease-out;
}

.hnmpdf .hnmpdf-drop strong {
	color: var(--hnmpdf-navy);
	font-family: var(--hnmpdf-head);
	font-size: 19px;
}

.hnmpdf .hnmpdf-drop span {
	color: var(--hnmpdf-muted);
	font-size: 15px;
}

.hnmpdf .hnmpdf-drop:hover,
.hnmpdf .hnmpdf-drop-over {
	background: #d6ece6;
}

.hnmpdf .hnmpdf-drop:focus-visible {
	outline: 3px solid var(--hnmpdf-navy);
	outline-offset: 2px;
}

.hnmpdf .hnmpdf-drop-compact {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 4px 12px;
	min-height: 52px;
	padding: 10px 16px;
}

.hnmpdf .hnmpdf-drop-compact strong {
	font-size: 16px;
}

.hnmpdf .hnmpdf-file {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Controls */

.hnmpdf .hnmpdf-body {
	margin-top: 16px;
}

.hnmpdf .hnmpdf-fileinfo {
	margin-bottom: 14px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--hnmpdf-soft);
	font-weight: 700;
	overflow-wrap: anywhere;
}

.hnmpdf .hnmpdf-options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 14px;
	margin: 14px 0;
}

.hnmpdf .hnmpdf-field {
	display: block;
	margin: 0;
	font-weight: 400;
}

.hnmpdf .hnmpdf-label {
	display: block;
	margin-bottom: 5px;
	color: var(--hnmpdf-navy);
	font-family: var(--hnmpdf-head);
	font-size: 14.5px;
}

.hnmpdf .hnmpdf-hint {
	display: block;
	margin: 5px 0 0;
	color: var(--hnmpdf-muted);
	font-size: 14.5px;
}

.hnmpdf .hnmpdf-input {
	display: block;
	width: 100%;
	max-width: none;
	min-height: 48px;
	margin: 0;
	padding: 8px 12px;
	border: 1.5px solid var(--hnmpdf-line);
	border-radius: 12px;
	background: #fff;
	color: var(--hnmpdf-navy);
	font: inherit;
	font-size: 17px;
	line-height: 1.4;
	box-shadow: none;
}

.hnmpdf textarea.hnmpdf-input {
	min-height: 72px;
	resize: vertical;
}

.hnmpdf input[type="color"].hnmpdf-input {
	padding: 4px;
	cursor: pointer;
}

.hnmpdf .hnmpdf-input:focus {
	border-color: var(--hnmpdf-accent);
	outline: 2px solid var(--hnmpdf-accent);
	outline-offset: 0;
}

.hnmpdf .hnmpdf-check {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 4px 0;
	font-weight: 400;
	cursor: pointer;
}

.hnmpdf .hnmpdf-check input {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--hnmpdf-accent);
}

.hnmpdf .hnmpdf-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0 4px;
}

.hnmpdf .hnmpdf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 8px 22px;
	border: 1.5px solid var(--hnmpdf-navy);
	border-radius: 12px;
	background: #fff;
	color: var(--hnmpdf-navy);
	font-family: var(--hnmpdf-head);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
	transition: background 0.15s ease-out, transform 0.1s ease-out;
}

.hnmpdf .hnmpdf-btn:hover,
.hnmpdf .hnmpdf-btn:focus {
	border-color: var(--hnmpdf-navy);
	background: var(--hnmpdf-soft);
	color: var(--hnmpdf-navy);
	text-decoration: none;
}

.hnmpdf .hnmpdf-btn-primary,
.hnmpdf .hnmpdf-btn-primary:hover,
.hnmpdf .hnmpdf-btn-primary:focus {
	min-height: 54px;
	padding: 8px 28px;
	border-color: var(--hnmpdf-accent);
	background: var(--hnmpdf-accent);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	box-shadow: 0 6px 16px rgba(1, 47, 84, 0.22);
}

.hnmpdf .hnmpdf-btn-primary:hover {
	filter: brightness(1.1);
}

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

.hnmpdf .hnmpdf-btn:focus-visible,
.hnmpdf .hnmpdf-icon:focus-visible,
.hnmpdf .hnmpdf-card:focus-visible,
.hnmpdf .hnmpdf-back:focus-visible {
	outline: 3px solid var(--hnmpdf-navy);
	outline-offset: 2px;
}

.hnmpdf .hnmpdf-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	filter: none;
	box-shadow: none;
}

.hnmpdf .hnmpdf-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	min-width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid var(--hnmpdf-line);
	border-radius: 10px;
	background: #fff;
	color: var(--hnmpdf-navy);
	font: inherit;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
}

.hnmpdf .hnmpdf-icon:hover,
.hnmpdf .hnmpdf-icon:focus {
	border-color: var(--hnmpdf-accent);
	background: var(--hnmpdf-soft);
	color: var(--hnmpdf-navy);
}

/* File list */

.hnmpdf .hnmpdf-list {
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	counter-reset: hnmpdf;
}

.hnmpdf .hnmpdf-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	padding: 8px 10px 8px 14px;
	border: 1px solid #dce5e8;
	border-radius: 12px;
	background: #fff;
	color: var(--hnmpdf-navy);
	list-style: none;
	counter-increment: hnmpdf;
}

.hnmpdf .hnmpdf-list li::before {
	content: counter(hnmpdf);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	min-width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--hnmpdf-navy);
	color: #fff;
	font-size: 14px;
}

.hnmpdf .hnmpdf-list-name {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
}

.hnmpdf .hnmpdf-list-size {
	color: var(--hnmpdf-muted);
	font-size: 14.5px;
	white-space: nowrap;
}

/* Page thumbnails */

.hnmpdf .hnmpdf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
	margin: 14px 0;
}

.hnmpdf .hnmpdf-thumb {
	border-radius: 14px;
	background: var(--hnmpdf-navy);
	cursor: grab;
}

.hnmpdf .hnmpdf-thumb-page {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 190px;
	padding: 12px;
	overflow: hidden;
}

.hnmpdf .hnmpdf-thumb-page canvas {
	max-width: 150px;
	max-height: 150px;
	width: auto;
	height: auto;
	border-radius: 2px;
	transition: transform 0.2s ease-out;
}

.hnmpdf .hnmpdf-thumb-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2px;
	padding: 6px;
	border-radius: 0 0 14px 14px;
	background: #fff;
	border: 1px solid #dce5e8;
	border-top: 0;
}

.hnmpdf .hnmpdf-thumb-bar .hnmpdf-icon {
	width: 36px;
	min-width: 36px;
	height: 40px;
	font-size: 15px;
}

.hnmpdf .hnmpdf-thumb-no {
	color: var(--hnmpdf-navy);
	font-family: var(--hnmpdf-head);
	font-weight: 700;
}

/* Preview */

.hnmpdf .hnmpdf-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
	gap: 20px;
	align-items: start;
}

.hnmpdf .hnmpdf-preview {
	padding: 16px;
	border-radius: 16px;
	background: var(--hnmpdf-navy);
}

.hnmpdf .hnmpdf-preview .hnmpdf-label {
	color: #fff;
}

.hnmpdf .hnmpdf-preview .hnmpdf-hint {
	color: #dce7ec;
}

.hnmpdf .hnmpdf-preview-page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
}

.hnmpdf .hnmpdf-preview-page canvas {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

/* Status and result */

.hnmpdf .hnmpdf-status {
	margin-top: 12px;
}

.hnmpdf .hnmpdf-bar {
	height: 8px;
	margin-bottom: 8px;
	border-radius: 4px;
	background: #dce5e8;
	overflow: hidden;
}

.hnmpdf .hnmpdf-bar i {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 4px;
	background: var(--hnmpdf-accent);
	transition: width 0.2s ease-out;
}

.hnmpdf .hnmpdf-msg {
	margin: 0;
	font-size: 16px;
}

.hnmpdf .hnmpdf-msg:empty {
	display: none;
}

.hnmpdf .hnmpdf-msg-error,
.hnmpdf .hnmpdf-msg-warn,
.hnmpdf .hnmpdf-msg-info {
	padding: 12px 16px;
	border-radius: 12px;
	background: #fbeceb;
	color: #7a1f1b;
}

.hnmpdf .hnmpdf-msg-warn {
	background: #fdf1dc;
	color: #6b4000;
}

.hnmpdf .hnmpdf-msg-info {
	background: var(--hnmpdf-soft);
	color: var(--hnmpdf-navy);
}

.hnmpdf .hnmpdf-result {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-top: 16px;
	padding: 18px 20px;
	border-radius: 16px;
	background: var(--hnmpdf-navy);
	color: #fff;
}

.hnmpdf .hnmpdf-result-info {
	min-width: 0;
}

.hnmpdf .hnmpdf-result-info strong {
	display: block;
	font-family: var(--hnmpdf-head);
	font-size: 18px;
	overflow-wrap: anywhere;
}

.hnmpdf .hnmpdf-result-info span {
	color: #dce7ec;
	font-size: 15.5px;
}

/* Footer strip */

.hnmpdf .hnmpdf-privacy {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 20px 20px 0;
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--hnmpdf-navy);
	color: #fff;
	font-size: 15.5px;
}

.hnmpdf .hnmpdf-privacy svg {
	width: 20px;
	height: 20px;
}

.hnmpdf .hnmpdf-credit {
	margin: 14px 20px 0;
	color: var(--hnmpdf-muted);
	font-size: 14.5px;
	text-align: center;
}

.hnmpdf .hnmpdf-credit a {
	color: var(--hnmpdf-navy);
}

@media (max-width: 720px) {
	.hnmpdf .hnmpdf-hero {
		padding: 80% 20px 110px;
		background-position: center top;
		background-size: 100% auto;
	}

	.hnmpdf .hnmpdf-hero-tool {
		padding: 20px 20px 80px;
		background-image: none;
	}

	.hnmpdf .hnmpdf-hero-slim {
		padding: 14px 12px 72px;
		background-image: none;
	}

	.hnmpdf .hnmpdf-hub,
	.hnmpdf .hnmpdf-mount {
		padding: 0 12px;
	}

	.hnmpdf .hnmpdf-hub {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.hnmpdf .hnmpdf-card {
		padding: 14px;
	}

	.hnmpdf .hnmpdf-tool {
		padding: 16px;
	}

	.hnmpdf .hnmpdf-split {
		grid-template-columns: minmax(0, 1fr);
	}

	.hnmpdf .hnmpdf-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.hnmpdf .hnmpdf-privacy {
		margin: 16px 12px 0;
	}

	.hnmpdf .hnmpdf-result .hnmpdf-btn,
	.hnmpdf .hnmpdf-actions .hnmpdf-btn-primary {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hnmpdf * {
		transition: none !important;
	}
}
