/* Preventis School Fields — peach card + searchable selects. */

/* ============== Card ============== */

.psf-card {
	box-sizing: border-box;
	padding: 16px;
	margin: 12px 0;
	border-radius: 16px;
	background-color: #f3f4f6;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.psf-card[hidden] {
	display: none !important;
}

.psf-card-header {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: #9ca3af;
	text-transform: uppercase;
	margin: 0 0 4px 0;
}

/* ============== Field rows ============== */

.psf-role-block {
	margin: 12px 0;
}

.psf-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.psf-label {
	font-size: 14px;
	font-weight: 600;
	color: #1a1a1a;
}

.psf-required {
	color: #d63638;
}

/* ============== Role radios — tile style ============== */

.psf-radio-group {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.psf-radio {
	flex: 1 1 calc(50% - 4px);
	min-width: 130px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 12px;
	background-color: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #1a1a1a;
	box-sizing: border-box;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	user-select: none;
}

.psf-radio:hover {
	border-color: #cbd5e1;
	background-color: #f9fafb;
}

.psf-radio input[type="radio"] {
	margin: 0;
	width: 16px;
	height: 16px;
	accent-color: #DB222A;
	cursor: pointer;
	flex: 0 0 auto;
}

.psf-radio-text {
	flex: 1 1 auto;
}

/* Selected state — applied via JS class and via :has() on modern browsers */
.psf-radio-selected,
.psf-radio:has(input[type="radio"]:checked) {
	border-color: #DB222A;
	background-color: #fef2f2;
}

@media (max-width: 480px) {
	.psf-radio-group {
		flex-direction: column;
	}
	.psf-radio {
		flex: 1 1 auto;
	}
}

/* ============== Native select fallback (hidden) ============== */

/* The searchable wrapper renders its own UI; the native <select> is kept
   in the DOM only so the form submits its value. Hide it completely.
   Safari ignored the clip-rect technique on <select>, hence display:none. */
select.psf-ss-native,
.psf-ss > select.psf-ss-native,
.psf-fields select.psf-ss-native,
.psf-fields select[data-psf-searchable] {
	display: none !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	position: absolute !important;
	left: -9999px !important;
	pointer-events: none !important;
}

/* ============== Searchable select ============== */

.psf-ss {
	position: relative;
	display: block;
	width: 100%;
}

.psf-ss-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	min-height: 46px;
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	background-color: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	text-align: left;
	line-height: 1.3;
	font-family: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.psf-ss-trigger:hover:not(:disabled) {
	border-color: #cbd5e1;
}

.psf-ss-open .psf-ss-trigger,
.psf-ss-trigger:focus {
	border-color: #DB222A;
	outline: none;
	box-shadow: none;
}

.psf-ss-trigger.psf-ss-placeholder {
	color: #9a9a9a;
	font-weight: 400;
}

.psf-ss-trigger-text {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding-right: 8px;
}

.psf-ss-chevron {
	flex: 0 0 auto;
	color: #1a1a1a;
	font-size: 12px;
	transition: transform 0.2s ease;
}

.psf-ss-open .psf-ss-chevron {
	transform: rotate(180deg);
}

.psf-ss-disabled .psf-ss-trigger {
	background-color: #e5e7eb;
	color: #9a9a9a;
	cursor: not-allowed;
	border-color: #d1d5db;
}

.psf-ss-disabled .psf-ss-chevron {
	opacity: 0.4;
}

/* Dropdown panel */

.psf-ss-panel {
	position: absolute;
	z-index: 10000;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	background-color: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 12px 28px rgba(0,0,0,0.12);
	padding: 8px;
	max-height: 320px;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.psf-ss-panel[hidden] {
	display: none;
}

/* Search input */

.psf-ss-search-wrap {
	position: relative;
	flex: 0 0 auto;
	margin-bottom: 4px;
}

.psf-ss-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #9ca3af;
	font-size: 16px;
	pointer-events: none;
}

.psf-ss-search {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px 10px 36px;
	font-size: 14px;
	color: #1a1a1a;
	background-color: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-family: inherit;
	outline: none;
}

.psf-ss-search:focus {
	border-color: #DB222A;
}

/* List */

.psf-ss-list {
	flex: 1 1 auto;
	overflow-y: auto;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	max-height: 240px;
}

.psf-ss-option {
	padding: 10px 12px;
	font-size: 15px;
	color: #1a1a1a;
	cursor: pointer;
	border-radius: 6px;
	line-height: 1.3;
}

.psf-ss-option:hover,
.psf-ss-option:focus {
	background-color: #f3f4f6;
}

.psf-ss-option-selected {
	background-color: #fef2f2;
	color: #DB222A;
	font-weight: 600;
}

.psf-ss-option[hidden] {
	display: none;
}

.psf-ss-empty {
	padding: 12px;
	font-size: 14px;
	color: #9ca3af;
	text-align: center;
	list-style: none;
}

/* ============== WooCommerce My Account ============== */

.woocommerce-EditAccountForm .psf-card {
	margin-bottom: 18px;
}

.woocommerce-EditAccountForm .psf-myaccount {
	border: none;
	padding: 0;
	margin: 16px 0;
}

.woocommerce-EditAccountForm .psf-myaccount > legend {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 8px;
}
