/**
 * Personalised card preview modal + button (scoped).
 *
 * Button colours/typography come from WPForms (.wpforms-page-button) and the
 * theme so the control matches Next / Submit. Do not hardcode brand colours here.
 */

.c27gc-preview-field {
	margin: 16px 0 8px !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

.c27gc-preview-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	cursor: pointer;
	/* Intentionally no background / color / border — inherit .wpforms-page-button. */
}

.c27gc-preview-hint {
	margin: 8px 0 0 !important;
	font-size: 13px;
	line-height: 1.4;
	color: #50575e;
}

.c27gc-preview-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.c27gc-preview-modal[hidden] {
	display: none !important;
}

.c27gc-preview-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 22, 0.55);
}

.c27gc-preview-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(960px, 100%);
	max-height: min(92vh, 100%);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	overflow: hidden;
}

.c27gc-preview-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 8px;
	border-bottom: 1px solid #dcdcde;
}

.c27gc-preview-modal__header h2 {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.3;
}

.c27gc-preview-modal__close {
	min-width: 44px;
	min-height: 44px;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #1d2327;
}

.c27gc-preview-modal__note {
	margin: 0;
	padding: 8px 16px;
	font-size: 13px;
	color: #8a2424;
	background: #fcf0f1;
}

.c27gc-preview-modal__body {
	position: relative;
	flex: 1 1 auto;
	min-height: 200px;
	padding: 12px 16px 16px;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.c27gc-preview-modal__loading,
.c27gc-preview-modal__error {
	padding: 24px 12px;
	text-align: center;
	font-size: 15px;
	line-height: 1.45;
}

.c27gc-preview-modal__error {
	color: #8a2424;
}

.c27gc-preview-modal__frame-wrap {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	width: 100%;
}

.c27gc-preview-modal__image {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	max-height: min(70vh, 820px);
	object-fit: contain;
	border: 1px solid #dcdcde;
	background: #f0f0f1;
}

@media (max-width: 600px) {
	.c27gc-preview-modal {
		padding: 0;
		align-items: stretch;
	}

	.c27gc-preview-modal__dialog {
		width: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.c27gc-preview-modal__image {
		max-height: 65vh;
	}
}
