/**
 * Frontend styles for Custom Popup Modal, Inline Shortcode Form, and Standalone Shareable Landing Page.
 */
.apm-pf-modal[hidden] {
	display: none !important;
}

.apm-pf-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
}

.apm-pf-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.68);
	backdrop-filter: blur(4px);
	animation: apmPfFadeIn 0.25s ease;
}

.apm-pf-modal__dialog {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 780px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	border-radius: 18px;
	box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
	animation: apmPfPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.apm-pf-modal--size-sm .apm-pf-modal__dialog {
	max-width: 520px;
}

.apm-pf-modal--size-md .apm-pf-modal__dialog {
	max-width: 780px;
}

.apm-pf-modal--size-lg .apm-pf-modal__dialog {
	max-width: 920px;
}

.apm-pf-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 10;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: rgba(15, 23, 42, 0.65);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}

.apm-pf-modal__close:hover {
	background: #0f172a;
	transform: scale(1.06);
}

/* Card Component */
.apm-pf-card {
	--apm-pf-accent: #0054a5;
	background: #ffffff;
	border-radius: 18px;
	overflow: hidden;
	border: 1px solid rgba(226, 232, 240, 0.9);
	font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #1e293b;
}

.apm-pf-card--mode-shortcode {
	box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
	margin: 24px 0;
}

/* Split Layout (Left Image + Right Form) */
.apm-pf-card--layout-split {
	display: grid;
	grid-template-columns: 44% 56%;
	min-height: 440px;
}

.apm-pf-card--layout-split .apm-pf-card__media {
	position: relative;
	background: #f8fafc;
	min-height: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.apm-pf-card--layout-split .apm-pf-card__media a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.apm-pf-card--layout-split .apm-pf-card__media img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.apm-pf-card--fit-cover_crop .apm-pf-card__media {
	padding: 0;
}

.apm-pf-card--fit-cover_crop .apm-pf-card__media img {
	object-fit: cover !important;
	border-radius: 0 !important;
}

.apm-pf-card--fit-contain .apm-pf-card__media {
	padding: 16px;
	box-sizing: border-box;
	background: #f8fafc;
}

.apm-pf-card--fit-contain .apm-pf-card__media img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain !important;
}

/* Top Image Layout */
.apm-pf-card--layout-top_image .apm-pf-card__media {
	background: #f8fafc;
	max-height: 340px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.apm-pf-card--layout-top_image .apm-pf-card__media img {
	width: 100%;
	max-height: 340px;
	object-fit: cover;
	display: block;
}

.apm-pf-card--layout-top_image.apm-pf-card--fit-contain .apm-pf-card__media {
	max-height: none;
	padding: 16px 16px 0;
}

.apm-pf-card--layout-top_image.apm-pf-card--fit-contain .apm-pf-card__media img {
	width: auto;
	max-width: 100%;
	max-height: 360px;
	height: auto;
	object-fit: contain !important;
	border-radius: 10px;
}

/* Image Only Layout */
.apm-pf-card__image-only img {
	width: 100%;
	height: auto;
	display: block;
}

/* Content & Form Area */
.apm-pf-card__content {
	padding: 28px 30px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.apm-pf-card__eyebrow {
	display: inline-block;
	align-self: flex-start;
	padding: 4px 12px;
	border-radius: 99px;
	background: color-mix(in srgb, var(--apm-pf-accent) 12%, #ffffff);
	color: var(--apm-pf-accent);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 10px;
}

.apm-pf-card__title {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 700;
	color: #0f172a;
}

.apm-pf-card__desc {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.55;
	color: #475569;
}

.apm-pf-form__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.apm-pf-field--full {
	grid-column: 1 / -1;
}

.apm-pf-field--half {
	grid-column: span 1;
}

.apm-pf-field__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 5px;
}

.apm-pf-field__req {
	color: #e11d48;
	margin-left: 2px;
}

.apm-pf-field input[type="text"],
.apm-pf-field input[type="tel"],
.apm-pf-field input[type="email"],
.apm-pf-field input[type="date"],
.apm-pf-field select,
.apm-pf-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 13px;
	font-size: 14px;
	font-family: inherit;
	color: #0f172a;
	background: #f8fafc;
	border: 1.5px solid #cbd5e1;
	border-radius: 10px;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.apm-pf-field input:focus,
.apm-pf-field select:focus,
.apm-pf-field textarea:focus {
	outline: none;
	background: #fff;
	border-color: var(--apm-pf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--apm-pf-accent) 16%, transparent);
}

.apm-pf-field__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	padding: 4px 0;
}

.apm-pf-choice {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	color: #334155;
	cursor: pointer;
}

/* File / CV Upload Field */
.apm-pf-file-upload {
	position: relative;
}

.apm-pf-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.apm-pf-file-drop {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: #f8fafc;
	border: 1.5px dashed #94a3b8;
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.apm-pf-file-drop:hover,
.apm-pf-file-input:focus + .apm-pf-file-drop {
	background: #f0f6fc;
	border-color: var(--apm-pf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--apm-pf-accent) 14%, transparent);
}

.apm-pf-file-upload.has-file .apm-pf-file-drop {
	background: #ecfdf5;
	border-style: solid;
	border-color: #16a34a;
}

.apm-pf-file-drop__icon {
	flex-shrink: 0;
	color: var(--apm-pf-accent);
}

.apm-pf-file-upload.has-file .apm-pf-file-drop__icon {
	color: #16a34a;
}

.apm-pf-file-drop__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	gap: 2px;
}

.apm-pf-file-drop__text {
	font-size: 13.5px;
	font-weight: 600;
	color: #0f172a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.apm-pf-file-upload.has-file .apm-pf-file-drop__text {
	color: #15803d;
}

.apm-pf-file-drop__hint {
	font-size: 12px;
	color: #64748b;
	line-height: 1.4;
}

.apm-pf-form__feedback {
	margin-top: 14px;
	padding: 11px 14px;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 600;
}

.apm-pf-form__feedback.is-success {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

.apm-pf-form__feedback.is-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.apm-pf-form__submit {
	margin-top: 16px;
	width: 100%;
	padding: 13px 20px;
	border: none;
	border-radius: 10px;
	background: var(--apm-pf-accent);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.apm-pf-form__submit:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.apm-pf-form__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.apm-pf-form__privacy {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: #64748b;
	text-align: center;
}

.apm-pf-form__privacy svg {
	display: inline-block;
	vertical-align: -2px;
	margin-right: 4px;
}

/* Post-submit Success State (replaces form cleanly) */
.apm-pf-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 28px 12px;
	animation: apmPfPopIn 0.28s ease-out;
}

.apm-pf-success[hidden] {
	display: none;
}

.apm-pf-success__icon {
	width: 64px;
	height: 64px;
	border-radius: 999px;
	background: #dcfce7;
	color: #16a34a;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
	box-shadow: 0 8px 20px rgba(22, 163, 74, 0.16);
}

.apm-pf-success__title {
	margin: 0 0 8px;
	font-size: 21px;
	line-height: 1.3;
	font-weight: 700;
	color: #0f172a;
}

.apm-pf-success__message {
	margin: 0 0 12px;
	font-size: 14.5px;
	line-height: 1.6;
	color: #334155;
	max-width: 380px;
}

.apm-pf-success__redirect {
	margin: 0 0 18px;
	font-size: 13px;
	color: #64748b;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.apm-pf-success__redirect[hidden] {
	display: none;
}

.apm-pf-success__redirect::before {
	content: "";
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid #cbd5e1;
	border-top-color: var(--apm-pf-accent);
	animation: apmPfSpin 0.8s linear infinite;
	flex-shrink: 0;
}

.apm-pf-success__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 22px;
	border-radius: 10px;
	background: var(--apm-pf-accent);
	color: #ffffff;
	font-size: 14.5px;
	font-weight: 700;
	text-decoration: none;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.apm-pf-success__btn[hidden] {
	display: none;
}

.apm-pf-success__btn:hover {
	color: #ffffff;
	filter: brightness(1.08);
	transform: translateY(-1px);
}

@keyframes apmPfSpin {
	to { transform: rotate(360deg); }
}

/* Standalone Landing Page (?apm_form=ID) */
.apm-pf-landing-body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: linear-gradient(135deg, #f0f6fc 0%, #e2e8f0 100%);
	font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.apm-pf-landing__header {
	position: sticky;
	top: 0;
	z-index: 30;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid #e2e8f0;
	padding: 12px 20px;
}

.apm-pf-landing__header-inner {
	max-width: 1060px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.apm-pf-landing__brand img {
	max-height: 44px;
	width: auto;
	display: block;
}

.apm-pf-landing__brand strong {
	font-size: 18px;
	color: #0054a5;
	text-decoration: none;
}

.apm-pf-landing__back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	border-radius: 999px;
	background: #f0f6fc;
	font-size: 13px;
	font-weight: 600;
	color: #0054a5;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease;
}

.apm-pf-landing__back:hover {
	background: #dbeafe;
	color: #004282;
}

.apm-pf-landing__main {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.apm-pf-landing__container {
	width: 100%;
	max-width: 860px;
}

.apm-pf-landing__container .apm-pf-card {
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
}

.apm-pf-landing__footer {
	text-align: center;
	padding: 16px;
	font-size: 13px;
	color: #64748b;
}

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

@keyframes apmPfPopIn {
	from { opacity: 0; transform: translateY(16px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
	.apm-pf-card--layout-split {
		grid-template-columns: 1fr;
	}
	.apm-pf-card--layout-split .apm-pf-card__media {
		min-height: 200px;
		max-height: 240px;
	}
	.apm-pf-card__content {
		padding: 20px 18px;
	}
	.apm-pf-form__grid {
		grid-template-columns: 1fr;
	}
	.apm-pf-field--half {
		grid-column: 1 / -1;
	}
}
