/*
 * PanicParts A11y Toolkit — Statement bubble + modal
 *
 * Accessibility notes baked into this stylesheet:
 *  - Bubble is a real <button>; :focus-visible gets the same amber ring
 *    as the rest of the toolkit.
 *  - Color #2271b1 on white = 4.6:1 (passes AA for text; the icon is
 *    graphical so only needs 3:1 anyway).
 *  - All transitions are disabled under prefers-reduced-motion.
 *  - Modal max-height + internal scroll so it never exceeds the viewport.
 *  - Touch targets are >= 44x44 CSS px.
 */

/* ---------- Bubble ---------- */

.pp-a11y-bubble {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 99990;
	width: 52px;
	height: 52px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #2271b1;
	color: #fff;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.pp-a11y-bubble.pp-a11y-pos-right {
	right: 16px;
}

.pp-a11y-bubble.pp-a11y-pos-left {
	left: 16px;
}

.pp-a11y-bubble:hover {
	background: #135e96;
}

.pp-a11y-bubble:focus-visible {
	outline: 3px solid #ffbf00;
	outline-offset: 3px;
	box-shadow: 0 0 0 5px rgba(255, 191, 0, 0.35);
}

.pp-a11y-bubble .pp-a11y-icon {
	display: block;
}

/* ---------- Modal overlay ---------- */

.pp-a11y-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 99991;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.6);
}

.pp-a11y-modal-overlay[hidden] {
	display: none;
}

/* ---------- Modal dialog ---------- */

.pp-a11y-modal {
	position: relative;
	background: #fff;
	color: #1e1e1e;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	border-radius: 8px;
	padding: 28px 28px 32px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	-webkit-overflow-scrolling: touch;
}

.pp-a11y-modal-title {
	margin: 0 40px 16px 0;
	font-size: 1.5rem;
	line-height: 1.3;
	color: #1e1e1e;
}

.pp-a11y-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	line-height: 1;
	background: transparent;
	color: #1e1e1e;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
}

.pp-a11y-modal-close:hover {
	background: #f0f0f1;
}

.pp-a11y-modal-close:focus-visible {
	outline: 3px solid #ffbf00;
	outline-offset: 1px;
	border-color: #1e1e1e;
}

/* ---------- Statement body ---------- */

.pp-a11y-statement-body {
	font-size: 0.975rem;
	line-height: 1.6;
}

.pp-a11y-statement-body p {
	margin: 0 0 1em;
}

.pp-a11y-last-reviewed {
	font-size: 0.85rem;
	color: #50575e;
	font-style: italic;
}

.pp-a11y-divider {
	margin: 22px 0;
	border: 0;
	border-top: 1px solid #dcdcde;
}

/* ---------- Report form ---------- */

.pp-a11y-form-heading {
	margin: 0 0 14px;
	font-size: 1.15rem;
	color: #1e1e1e;
}

.pp-a11y-field {
	margin-bottom: 16px;
}

.pp-a11y-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
	font-size: 0.925rem;
}

.pp-a11y-required {
	color: #b32d2e;
}

.pp-a11y-field input[type="text"],
.pp-a11y-field input[type="email"],
.pp-a11y-field textarea {
	width: 100%;
	padding: 9px 11px;
	font-size: 1rem;
	font-family: inherit;
	color: #1e1e1e;
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	box-sizing: border-box;
}

.pp-a11y-field textarea {
	resize: vertical;
	min-height: 96px;
}

.pp-a11y-field input:focus-visible,
.pp-a11y-field textarea:focus-visible {
	outline: 3px solid #ffbf00;
	outline-offset: 0;
	border-color: #2271b1;
}

.pp-a11y-field input[aria-invalid="true"],
.pp-a11y-field textarea[aria-invalid="true"] {
	border-color: #b32d2e;
	box-shadow: 0 0 0 1px #b32d2e;
}

.pp-a11y-field-hint {
	display: block;
	font-size: 0.825rem;
	color: #50575e;
	margin-top: 4px;
}

.pp-a11y-field-error {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: #b32d2e;
	margin-top: 4px;
	min-height: 1px;
}

/* Honeypot — hidden from sighted users AND assistive tech, but not
   display:none (some bots skip display:none fields). */
.pp-a11y-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.pp-a11y-form-actions {
	margin-top: 4px;
}

.pp-a11y-submit {
	background: #2271b1;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	padding: 11px 22px;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	min-height: 44px;
}

.pp-a11y-submit:hover {
	background: #135e96;
}

.pp-a11y-submit:focus-visible {
	outline: 3px solid #ffbf00;
	outline-offset: 2px;
}

.pp-a11y-submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.pp-a11y-form-status {
	margin-top: 14px;
	font-size: 0.95rem;
	line-height: 1.5;
}

.pp-a11y-form-status.is-success {
	color: #00692a;
	font-weight: 600;
}

.pp-a11y-form-status.is-error {
	color: #b32d2e;
	font-weight: 600;
}

.pp-a11y-form-status:focus-visible {
	outline: 2px dotted #2271b1;
	outline-offset: 2px;
}

/* ---------- Body scroll lock while modal open ---------- */

body.pp-a11y-modal-open {
	overflow: hidden;
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
	.pp-a11y-modal {
		padding: 22px 18px 26px;
	}

	.pp-a11y-bubble {
		width: 48px;
		height: 48px;
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.pp-a11y-bubble {
		transition: none;
	}
}
