/**
 * Staff tools panel (public) + light admin Exceptions extras.
 */

/* ---- Public form link ---- */
.iglou-qual {
	position: relative;
}

.iglou-qual-staff-link {
	position: absolute;
	top: 0.35rem;
	right: 0.5rem;
	z-index: 2;
	font-size: 0.75em;
	line-height: 1.2;
	opacity: 0.55;
	text-decoration: none;
}

.iglou-qual-staff-link:hover,
.iglou-qual-staff-link:focus {
	opacity: 1;
	text-decoration: underline;
}

/* ---- Overlay panel ---- */
.iglou-emp-panel {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.iglou-emp-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.iglou-emp-dialog {
	position: relative;
	z-index: 1;
	max-width: 720px;
	max-height: min(90vh, 800px);
	margin: 4vh auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: #1e1e1e;
	font-size: 14px;
}

.iglou-emp-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #dcdcde;
	background: #f6f7f7;
}

.iglou-emp-x {
	border: 0;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #50575e;
}

.iglou-emp-body {
	padding: 1rem;
	overflow: auto;
	flex: 1;
}

.iglou-emp-status {
	margin: 0;
	padding: 0.5rem 1rem;
	background: #edfaef;
	border-bottom: 1px solid #b8e6bf;
	color: #1e4620;
}

.iglou-emp-status-error {
	background: #fcf0f1;
	border-bottom-color: #f1aeb5;
	color: #8a1f1b;
}

.iglou-emp-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	align-items: center;
}

.iglou-emp-search {
	flex: 1 1 12rem;
	min-width: 8rem;
	padding: 0.4rem 0.5rem;
	border: 1px solid #8c8f94;
	border-radius: 4px;
}

.iglou-emp-table-wrap {
	overflow: auto;
	max-height: 50vh;
}

.iglou-emp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.iglou-emp-table th,
.iglou-emp-table td {
	border-bottom: 1px solid #e0e0e0;
	padding: 0.4rem 0.35rem;
	text-align: left;
	vertical-align: top;
}

.iglou-emp-table th {
	font-weight: 600;
	background: #f6f7f7;
	position: sticky;
	top: 0;
}

.iglou-emp-form label,
.iglou-emp-login label {
	display: block;
	margin-bottom: 0.65rem;
	font-weight: 600;
	font-size: 12px;
}

.iglou-emp-form input[type="text"],
.iglou-emp-form input[type="password"],
.iglou-emp-form input[type="search"],
.iglou-emp-form input:not([type]),
.iglou-emp-form select,
.iglou-emp-form textarea,
.iglou-emp-login input:not([type="checkbox"]) {
	display: block;
	width: 100%;
	margin-top: 0.25rem;
	padding: 0.4rem 0.5rem;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-weight: 400;
	box-sizing: border-box;
}

.iglou-emp-check {
	font-weight: 400 !important;
}

.iglou-emp-tags {
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 0.5rem 0.75rem;
	margin: 0 0 0.75rem;
}

.iglou-emp-tag {
	display: inline-block !important;
	margin-right: 0.75rem;
	font-weight: 400 !important;
}

.iglou-emp-help {
	display: block;
	font-weight: 400;
	font-size: 12px;
	color: #646970;
	margin-top: 0.25rem;
}

.iglou-emp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.iglou-emp-btn {
	appearance: none;
	border: 1px solid #8c8f94;
	background: #f6f7f7;
	border-radius: 4px;
	padding: 0.4rem 0.75rem;
	cursor: pointer;
	font-size: 13px;
}

.iglou-emp-btn:hover {
	background: #fff;
}

/* Honor [hidden] even if the site theme forces a display on buttons — a verified-clean
 * address must never show the Verify button. */
.iglou-emp-btn[hidden] {
	display: none !important;
}

.iglou-emp-btn-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.iglou-emp-btn-primary:hover {
	background: #135e96;
	color: #fff;
}

.iglou-emp-btn-link {
	border: 0;
	background: transparent;
	color: #2271b1;
	text-decoration: underline;
	padding-left: 0.25rem;
	padding-right: 0.25rem;
}

.iglou-emp-btn-danger {
	background: #b32d2e;
	border-color: #b32d2e;
	color: #fff;
	margin-top: 0.5rem;
}

.iglou-emp-delete {
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid #dcdcde;
}

/* ---- Admin ---- */
.iglou-qual-exceptions-admin .search-box {
	float: none;
	margin: 1em 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.iglou-exc-clean-status {
	margin: 0.75rem 0;
	padding: 0.65rem 0.85rem;
	border-left: 4px solid #72aee6;
	background: #f0f6fc;
	color: #1d2327;
}

.iglou-exc-clean-status.is-ok {
	border-left-color: #00a32a;
	background: #edfaef;
}

.iglou-exc-clean-status.is-error {
	border-left-color: #d63638;
	background: #fcf0f1;
}

.iglou-exc-clean-status.is-busy {
	border-left-color: #dba617;
	background: #fcf9e8;
	font-weight: 600;
}

.iglou-emp-status.is-busy {
	background: #fcf9e8;
	border-bottom-color: #dba617;
	color: #614200;
	font-weight: 600;
}

button:disabled.iglou-emp-btn-primary,
button[disabled].button-primary {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ---- Verify address (public panel) ---- */
.iglou-emp-verify {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0.35rem 0 0.15rem;
}

.iglou-emp-btn-verify {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
	font-weight: 600;
}

.iglou-emp-btn-verify:hover {
	background: #135e96;
	color: #fff;
}

.iglou-emp-verify-msg {
	font-size: 12px;
	color: #50575e;
}

.iglou-emp-verify-msg.is-ok {
	color: #007017;
	font-weight: 600;
}

.iglou-emp-verify-msg.is-error {
	color: #b32d2e;
}

.iglou-emp-verify-msg.is-busy {
	color: #614200;
	font-weight: 600;
}

/* Spinner while verifying, mirroring the WP-admin editor (reuses @keyframes iglou-exc-spin). */
.iglou-emp-verify-msg.is-busy::before {
	content: "";
	display: inline-block;
	margin-right: 0.4em;
	vertical-align: middle;
	line-height: 1;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(97, 66, 0, 0.25);
	border-top-color: #614200;
	border-radius: 50%;
	animation: iglou-exc-spin 0.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
	.iglou-emp-verify-msg.is-busy::before {
		animation: none;
	}
}

/* Yellow "verification failed — you can still save" banner, directly above Save. */
.iglou-emp-warn {
	margin: 0.75rem 0;
	padding: 0.65rem 0.85rem;
	border-left: 4px solid #dba617;
	background: #fcf9e8;
	color: #614200;
}

/* Prominent "action needed — Save is blocked until you act" variant (unit-required case).
   Deliberately stronger than the yellow note above: red border/tint, bold, larger, and a
   leading warning mark, so it can't be missed next to the greyed-out Save button. */
.iglou-emp-warn.is-block {
	border-left-color: #b32d2e;
	background: #fcf0f1;
	color: #8a1f1f;
	font-size: 14px;
	font-weight: 700;
}

.iglou-emp-warn.is-block::before {
	content: "\26A0"; /* ⚠ */
	margin-right: 0.45em;
	font-size: 1.05em;
}

/* ---- Verify address (admin form) ---- */
.iglou-exc-verify.button {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
	font-weight: 600;
}

.iglou-exc-verify.button:hover {
	background: #135e96;
	border-color: #135e96;
	color: #fff;
}

/* wp-core's `.wp-core-ui .button { display: inline-block }` beats the UA [hidden] rule,
 * so honor it explicitly — a verified-clean address must never show the Verify button. */
.iglou-exc-verify.button[hidden] {
	display: none !important;
}

.iglou-exc-verify-msg {
	margin-left: 0.6rem;
	font-size: 13px;
	color: #50575e;
}

/* Leading marker before the message text: a spinner while verifying, then a check / cross. */
.iglou-exc-verify-msg.is-busy::before,
.iglou-exc-verify-msg.is-ok::before,
.iglou-exc-verify-msg.is-error::before {
	display: inline-block;
	margin-right: 0.4em;
	vertical-align: middle;
	line-height: 1;
}

.iglou-exc-verify-msg.is-ok {
	color: #007017;
	font-weight: 600;
}

.iglou-exc-verify-msg.is-ok::before {
	content: "\2713"; /* ✓ */
	font-weight: 700;
}

.iglou-exc-verify-msg.is-error {
	color: #b32d2e;
}

.iglou-exc-verify-msg.is-error::before {
	content: "\2717"; /* ✗ */
	font-weight: 700;
}

/* Prominent "action needed — Save is blocked until you act" (unit required). Bolder + larger
   than the plain messages, with a ⚠ marker, so it can't be missed beside the greyed Save. */
.iglou-exc-verify-msg.is-block {
	color: #8a1f1f;
	font-size: 14px;
	font-weight: 700;
}

.iglou-exc-verify-msg.is-block::before {
	content: "\26A0"; /* ⚠ */
	font-weight: 700;
}

.iglou-exc-verify-msg.is-busy {
	color: #614200;
	font-weight: 600;
}

.iglou-exc-verify-msg.is-busy::before {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid rgba(97, 66, 0, 0.25);
	border-top-color: #614200;
	border-radius: 50%;
	animation: iglou-exc-spin 0.6s linear infinite;
}

@keyframes iglou-exc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Respect reduced-motion: keep the marker visible but stop it spinning. */
@media (prefers-reduced-motion: reduce) {
	.iglou-exc-verify-msg.is-busy::before {
		animation: none;
	}
}
