/*
 * PopupReply for Contact Form 7 — modal styles.
 * All selectors are prefixed and scoped so the theme is never affected.
 */

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

.popupreply-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

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

.popupreply-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 17, 17, 17, 0.55 );
	border: 0;
	cursor: pointer;
}

.popupreply-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: calc( 100vh - 40px );
	overflow: auto;
	padding: 28px 28px 24px;
	background: #ffffff;
	color: #1d2327;
	border-top: 4px solid #2271b1;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	animation: popupreply-in 0.18s ease-out;
}

@keyframes popupreply-in {
	from { opacity: 0; transform: translateY( 8px ) scale( 0.98 ); }
	to   { opacity: 1; transform: none; }
}

@media ( prefers-reduced-motion: reduce ) {
	.popupreply-modal__dialog {
		animation: none;
	}
}

/* Sizes */
.popupreply-modal--small .popupreply-modal__dialog  { max-width: 340px; }
.popupreply-modal--medium .popupreply-modal__dialog { max-width: 460px; }
.popupreply-modal--large .popupreply-modal__dialog  { max-width: 620px; }

.popupreply-modal__header {
	margin: 0 0 10px;
	padding-right: 28px;
}

.popupreply-modal__title {
	margin: 0;
	padding: 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.popupreply-modal__message {
	margin: 0;
	font-size: 15px;
	white-space: pre-line;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

/*
 * The button rules are deliberately prefixed with `.popupreply-modal` to
 * raise their specificity to (0,2,0). Themes and CSS resets routinely style
 * buttons with attribute selectors such as `[type="button"]` (also 0,1,0):
 * a plain `.popupreply-modal__button` rule would only tie and then lose on
 * load order. The extra class keeps the modal looking correct on any theme
 * without resorting to `!important`.
 */
.popupreply-modal .popupreply-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	font-size: 22px;
	line-height: 1;
	color: #50575e;
	background: transparent;
	border: 0;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
}

.popupreply-modal .popupreply-modal__close:hover,
.popupreply-modal .popupreply-modal__close:focus {
	color: #1d2327;
	background: rgba( 0, 0, 0, 0.08 );
}

.popupreply-modal__actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 20px;
}

.popupreply-modal .popupreply-modal__button {
	-webkit-appearance: none;
	appearance: none;
	min-width: 0;
	margin: 0;
	padding: 9px 18px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	color: #ffffff;
	background: #2271b1;
	border: 0;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
}

.popupreply-modal .popupreply-modal__button:hover,
.popupreply-modal .popupreply-modal__button:focus {
	color: #ffffff;
	background: #135e96;
}

.popupreply-modal .popupreply-modal__close:focus-visible,
.popupreply-modal .popupreply-modal__button:focus-visible,
.popupreply-modal .popupreply-modal__dialog:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Status accents */
.popupreply-modal--success .popupreply-modal__dialog    { border-top-color: #1a7f37; }
.popupreply-modal--error .popupreply-modal__dialog      { border-top-color: #d63638; }
.popupreply-modal--warning .popupreply-modal__dialog    { border-top-color: #bd8600; }
.popupreply-modal--validation .popupreply-modal__dialog { border-top-color: #2271b1; }

.popupreply-modal--success .popupreply-modal__title    { color: #1a7f37; }
.popupreply-modal--error .popupreply-modal__title      { color: #d63638; }
.popupreply-modal--warning .popupreply-modal__title    { color: #94660c; }
.popupreply-modal--validation .popupreply-modal__title { color: #135e96; }

/* Style variants */
.popupreply-modal--style-rounded .popupreply-modal__dialog { border-radius: 20px; }
.popupreply-modal--style-rounded .popupreply-modal__button { border-radius: 999px; }

.popupreply-modal--style-minimal .popupreply-modal__dialog {
	border-top: 0;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.2 );
}
.popupreply-modal--style-minimal .popupreply-modal__button {
	background: #1d2327;
}

.popupreply-modal--style-system .popupreply-modal__dialog {
	font-family: inherit;
	border-radius: 4px;
}

body.popupreply-modal-open {
	overflow: hidden;
}
