/**
 * PrecisionMart WhatsApp Modal Styles.
 * Adheres strictly to design system: Gold #D4AF37, Text #252525, Cream #FAF7EF.
 * Responsive, accessible, reduced motion support.
 */

.pm-modal-locked {
	overflow: hidden !important;
}

.pm-wa-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

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

.pm-wa-modal__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.pm-wa-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 480px;
	background: #FFFFFF;
	border-radius: 12px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	z-index: 1;
	border: 1px solid #E8C96A;
	animation: pmFadeIn 0.2s ease-out;
}

@keyframes pmFadeIn {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(10px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pm-wa-modal__dialog {
		animation: none !important;
	}
}

.pm-wa-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #FAF7EF;
	border-bottom: 1px solid #F0E6D2;
}

.pm-wa-modal__brand {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #252525;
}

.pm-wa-modal__icon {
	color: #25D366;
}

.pm-wa-modal__badge {
	font-size: 13px;
	font-weight: 600;
	color: #555555;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.pm-wa-modal__close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #888888;
	cursor: pointer;
	padding: 4px;
	transition: color 0.15s;
}

.pm-wa-modal__close:hover,
.pm-wa-modal__close:focus {
	color: #252525;
}

.pm-wa-modal__body {
	padding: 24px 24px 28px;
}

.pm-wa-modal__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: #111111;
	line-height: 1.3;
}

.pm-wa-modal__description {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.5;
	color: #666666;
}

.pm-wa-modal__alert {
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.4;
	margin-bottom: 16px;
}

.pm-wa-modal__alert--error {
	background: #FEE2E2;
	color: #991B1B;
	border: 1px solid #FCA5A5;
}

.pm-wa-modal__alert--success {
	background: #DEF7EC;
	color: #03543F;
	border: 1px solid #84E1BC;
}

.pm-wa-modal__form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pm-wa-modal__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media (max-width: 480px) {
	.pm-wa-modal__row {
		grid-template-columns: 1fr;
	}
}

.pm-wa-modal__field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.pm-wa-modal__field label {
	font-size: 13px;
	font-weight: 600;
	color: #333333;
}

.pm-wa-modal__field .pm-req {
	color: #DC2626;
}

.pm-wa-modal__field input {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid #CCCCCC;
	border-radius: 6px;
	background: #FFFFFF;
	color: #111111;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.pm-wa-modal__field input:focus {
	outline: none;
	border-color: #D4AF37;
	box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.pm-wa-modal__actions {
	margin-top: 8px;
}

.pm-wa-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	border: none;
	text-decoration: none;
	box-sizing: border-box;
	transition: background-color 0.15s, opacity 0.15s;
}

.pm-wa-button--primary {
	background: #D4AF37;
	color: #111111;
}

.pm-wa-button--primary:hover {
	background: #C49F27;
}

.pm-wa-button--primary:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.pm-wa-button--whatsapp {
	background: #25D366;
	color: #FFFFFF;
}

.pm-wa-button--whatsapp:hover {
	background: #20BA5A;
}

.pm-wa-modal__fallback {
	text-align: center;
	padding: 10px 0;
}

.pm-wa-modal__fallback p {
	font-size: 14px;
	color: #16A34A;
	font-weight: 600;
	margin-bottom: 12px;
}

.pm-wa-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-top-color: #111111;
	border-radius: 50%;
	animation: pmSpin 0.6s linear infinite;
	margin-left: 8px;
}

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