/*
 * PROFILER front end. Inherits the theme's fonts and text color; neutrals are
 * mixed from currentColor so forms and PROFILES suit light and dark themes.
 * One accent color (Settings → General) drives buttons, focus and the PROFILE cover.
 */

.profiler {
	--profiler-accent: #1d4ed8;
	--profiler-on-accent: #fff;
	--profiler-line: color-mix(in srgb, currentColor 18%, transparent);
	--profiler-line-strong: color-mix(in srgb, currentColor 34%, transparent);
	--profiler-wash: color-mix(in srgb, currentColor 4%, transparent);
	--profiler-muted: color-mix(in srgb, currentColor 68%, transparent);
	--profiler-danger: #b42318;
	--profiler-success: #067647;
	--profiler-radius: 10px;
	--profiler-gap: 1.25rem;
	box-sizing: border-box;
	line-height: 1.55;
}
.profiler *,
.profiler *::before,
.profiler *::after { box-sizing: inherit; }
.profiler [hidden] { display: none !important; }

/* ---------------------------------------------------------------- Forms */

.profiler-form-wrap { max-width: 44rem; margin-inline: auto; }
.profiler-form-wrap--login { max-width: 26rem; }

.profiler-form { margin: 0; }
.profiler-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--profiler-gap) 1rem;
}
.profiler-col--full { grid-column: span 6; }
.profiler-col--half { grid-column: span 3; }
.profiler-col--third { grid-column: span 2; }
.profiler-col--two-thirds { grid-column: span 4; }
@media (max-width: 600px) {
	.profiler-grid > [class*="profiler-col--"] { grid-column: span 6; }
}

.profiler-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.profiler-field > label,
.profiler-label,
.profiler-sublabel { font-weight: 600; font-size: 0.95rem; }
.profiler-sublabel { margin-top: 0.5rem; }
.profiler-required { color: var(--profiler-danger); margin-left: 0.15em; }

.profiler input[type="text"],
.profiler input[type="email"],
.profiler input[type="url"],
.profiler input[type="tel"],
.profiler input[type="number"],
.profiler input[type="date"],
.profiler input[type="password"],
.profiler input[type="search"],
.profiler select,
.profiler textarea {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.6rem 0.8rem;
	font: inherit;
	color: inherit;
	background: var(--profiler-wash);
	border: 1px solid var(--profiler-line-strong);
	border-radius: 8px;
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.profiler textarea { min-height: 7rem; resize: vertical; }
.profiler input[readonly] { opacity: 0.7; }
.profiler input:focus,
.profiler select:focus,
.profiler textarea:focus {
	outline: none;
	border-color: var(--profiler-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--profiler-accent) 28%, transparent);
}
.profiler .has-error input,
.profiler .has-error select,
.profiler .has-error textarea,
.profiler [aria-invalid="true"] { border-color: var(--profiler-danger); }

.profiler-help { margin: 0; font-size: 0.875rem; color: var(--profiler-muted); }
.profiler-error { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--profiler-danger); }
.profiler-pending { margin: 0; font-size: 0.875rem; color: var(--profiler-accent); font-weight: 600; }

/* Choices */
.profiler-choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.profiler-choice { display: inline-flex; align-items: flex-start; gap: 0.55rem; font-weight: 400; cursor: pointer; }
.profiler-choice input { width: 1.15rem; height: 1.15rem; margin: 0.18rem 0 0; accent-color: var(--profiler-accent); flex: none; }
.profiler-choice--single { padding: 0.85rem 1rem; border: 1px solid var(--profiler-line); border-radius: 8px; background: var(--profiler-wash); }
.profiler-choice a { color: var(--profiler-accent); }

/* Password */
.profiler-password { position: relative; }
.profiler-password input { padding-right: 4.5rem; }
.profiler .profiler-password__toggle:not(#profiler-x) {
	position: absolute; inset-block: 0.35rem; right: 0.35rem;
	padding: 0 0.75rem; font: inherit; font-size: 0.85rem; font-weight: 600;
	color: inherit; background: transparent; border: 0; border-radius: 6px; cursor: pointer;
}
.profiler .profiler-password__toggle:not(#profiler-x):hover { background: var(--profiler-wash); color: inherit; }
.profiler-strength { margin: 0.25rem 0 0; font-size: 0.85rem; font-weight: 600; min-height: 1.3em; }
.profiler-strength[data-level]::before {
	content: ""; display: block; height: 4px; margin-bottom: 0.35rem; border-radius: 2px;
	background: linear-gradient(90deg, currentColor var(--profiler-strength, 0%), var(--profiler-line) 0);
}
.profiler-strength[data-level="0"], .profiler-strength[data-level="1"], .profiler-strength[data-level="5"] { color: var(--profiler-danger); --profiler-strength: 20%; }
.profiler-strength[data-level="2"] { color: #b54708; --profiler-strength: 45%; }
.profiler-strength[data-level="3"] { color: var(--profiler-success); --profiler-strength: 75%; }
.profiler-strength[data-level="4"] { color: var(--profiler-success); --profiler-strength: 100%; }

/* Uploads */
.profiler-upload { display: flex; flex-direction: column; gap: 0.6rem; }
.profiler-upload__current { display: flex; align-items: center; gap: 1rem; }
.profiler-upload__preview { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; }
.profiler-upload input[type="file"] { font: inherit; font-size: 0.9rem; max-width: 100%; }
.profiler-upload input[type="file"]::file-selector-button {
	margin-right: 0.75rem; padding: 0.5rem 0.9rem; font: inherit; font-weight: 600;
	color: inherit; background: var(--profiler-wash); border: 1px solid var(--profiler-line-strong); border-radius: 8px; cursor: pointer;
}

/* Repeater */
.profiler-repeater__rows { display: flex; flex-direction: column; gap: 0.75rem; }
.profiler-repeater__row {
	position: relative; padding: 1rem 1rem 0.5rem;
	border-left: 3px solid color-mix(in srgb, var(--profiler-accent) 55%, transparent);
	background: var(--profiler-wash); border-radius: 0 8px 8px 0;
}
.profiler-repeater__row .profiler-grid { gap: 0.75rem; }
.profiler-repeater__remove { margin-top: 0.25rem; }
.profiler-repeater__add { margin-top: 0.75rem; align-self: flex-start; }

/* Visibility selector */
.profiler-visibility { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--profiler-muted); }
.profiler-visibility select { width: auto; min-height: 2rem; padding: 0.2rem 0.5rem; font-size: 0.85rem; }

/* Headings / text blocks inside forms */
.profiler-field--heading h3 { margin: 0.5rem 0 0; font-size: 1.15rem; }
.profiler-field--html > :first-child { margin-top: 0; }
.profiler-field--html > :last-child { margin-bottom: 0; }

/* Steps */
.profiler-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.profiler-step + .profiler-step { margin-top: 2rem; }
.profiler-step__title { padding: 0; margin: 0 0 1rem; font-size: 1.25rem; font-weight: 700; }
.profiler-form--steps.is-enhanced .profiler-step + .profiler-step { margin-top: 0; }
.profiler-form--steps.is-enhanced .profiler-step[hidden] { display: none; }

.profiler-progress {
	display: flex; gap: 0.5rem; margin: 0 0 2rem; padding: 0; list-style: none; counter-reset: none;
}
.profiler-progress__step {
	flex: 1; display: flex; align-items: center; gap: 0.6rem; padding-top: 0.75rem;
	border-top: 3px solid var(--profiler-line); color: var(--profiler-muted); font-size: 0.9rem; margin: 0;
}
.profiler-progress__num {
	display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none;
	border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: 0.85rem;
}
.profiler-progress__step.is-done,
.profiler-progress__step.is-current { border-top-color: var(--profiler-accent); color: inherit; }
.profiler-progress__step.is-current .profiler-progress__num,
.profiler-progress__step.is-done .profiler-progress__num { background: var(--profiler-accent); border-color: var(--profiler-accent); color: var(--profiler-on-accent); }
.profiler-progress__label { font-weight: 600; }
@media (max-width: 600px) {
	.profiler-progress__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.profiler-progress__step.is-current .profiler-progress__label { position: static; width: auto; height: auto; clip: auto; }
}

/* Actions and buttons */
.profiler-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-end; margin-top: 2rem; }
.profiler-form-wrap--login .profiler-actions { margin-top: 1.5rem; }
.profiler .profiler-button:not(#profiler-x) {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
	min-height: 2.75rem; padding: 0.6rem 1.25rem;
	font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none;
	color: var(--profiler-on-accent); background: var(--profiler-accent);
	border: 1px solid var(--profiler-accent); border-radius: 999px; cursor: pointer;
	transition: filter 0.15s, background 0.15s;
}
.profiler .profiler-button:not(#profiler-x):hover { filter: brightness(1.08); color: var(--profiler-on-accent); background: var(--profiler-accent); }
.profiler .profiler-button--ghost:not(#profiler-x) { color: inherit; background: transparent; border-color: var(--profiler-line-strong); }
.profiler .profiler-button--ghost:not(#profiler-x):hover { color: inherit; background: var(--profiler-wash); filter: none; }
.profiler .profiler-button--link:not(#profiler-x) {
	min-height: 0; padding: 0.2rem 0; color: var(--profiler-accent); background: none; border: 0; border-radius: 0;
	text-decoration: underline; text-underline-offset: 0.2em; font-weight: 600;
}
.profiler .profiler-button--link:not(#profiler-x):hover { color: var(--profiler-accent); background: none; filter: none; }
.profiler .profiler-button--danger:not(#profiler-x) { background: var(--profiler-danger); border-color: var(--profiler-danger); }
.profiler-button--block { width: 100%; }
.profiler-button[disabled],
.profiler-button.is-busy { opacity: 0.6; cursor: progress; }
.profiler :focus-visible { outline: 3px solid color-mix(in srgb, var(--profiler-accent) 60%, transparent); outline-offset: 2px; }

.profiler-switch { margin: 1.5rem 0 0; text-align: center; color: var(--profiler-muted); }
.profiler-switch a, .profiler-intro a, .profiler-login-row a { color: var(--profiler-accent); font-weight: 600; }
.profiler-login-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.95rem; }

/* Alerts */
.profiler-alert {
	margin: 0 0 1.5rem; padding: 0.9rem 1.1rem; border-radius: var(--profiler-radius);
	border: 1px solid var(--profiler-line); border-left: 4px solid var(--profiler-accent); background: var(--profiler-wash);
}
.profiler-alert--error { border-left-color: var(--profiler-danger); }
.profiler-alert--success { border-left-color: var(--profiler-success); }
.profiler-alert p { margin: 0 0 0.35rem; }
.profiler-alert ul { margin: 0; padding-left: 1.2rem; }
.profiler-alert a { color: inherit; }

/* Cards: logged-in box, restricted content */
.profiler-card { padding: 1.5rem; border: 1px solid var(--profiler-line); border-radius: var(--profiler-radius); }
.profiler-loggedin { text-align: center; }
.profiler-loggedin__avatar { border-radius: 50%; }
.profiler-restricted { border-style: dashed; text-align: center; }
.profiler-restricted__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 0; }

/* Danger zone, export */
.profiler-export { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--profiler-line); }
.profiler-danger { margin-top: 1rem; }
.profiler-danger summary { cursor: pointer; color: var(--profiler-danger); font-weight: 600; }
.profiler-danger .profiler-form { margin-top: 1rem; padding: 1rem; border: 1px solid color-mix(in srgb, var(--profiler-danger) 40%, transparent); border-radius: var(--profiler-radius); }
.profiler-danger .profiler-field { margin-bottom: 1rem; }

/* Honeypot: off-screen for people, visible to bots */
.profiler-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- PROFILE */

.profiler-main { padding-block: 0 4rem; }
.profiler-profile { max-width: 60rem; margin-inline: auto; }

.profiler-profile__hero { position: relative; margin-bottom: 1.5rem; }
.profiler-profile__cover {
	height: clamp(9rem, 22vw, 15rem);
	border-radius: 0 0 var(--profiler-radius) var(--profiler-radius);
	background-color: var(--profiler-accent);
	/* A woven tile: two offset diagonal grids in tints of the accent. */
	background-image:
		repeating-linear-gradient(45deg, color-mix(in srgb, #fff 14%, transparent) 0 2px, transparent 2px 22px),
		repeating-linear-gradient(-45deg, color-mix(in srgb, #000 14%, transparent) 0 2px, transparent 2px 22px),
		linear-gradient(160deg, color-mix(in srgb, var(--profiler-accent) 70%, #fff) 0%, var(--profiler-accent) 55%, color-mix(in srgb, var(--profiler-accent) 70%, #000) 100%);
}
.profiler-profile__identity {
	display: flex; align-items: flex-end; gap: 1.5rem;
	padding-inline: clamp(1rem, 4vw, 2.5rem);
}
.profiler-profile__avatar {
	width: clamp(7rem, 15vw, 10rem); height: clamp(7rem, 15vw, 10rem); flex: none;
	margin-top: calc(clamp(7rem, 15vw, 10rem) * -0.5);
	object-fit: cover; border-radius: 50%;
	border: 5px solid var(--wp--preset--color--base, #fff);
	background: var(--wp--preset--color--base, #fff);
}
.profiler-profile__names { padding: 1rem 0 0.25rem; min-width: 0; }
.profiler-profile__name {
	margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}
.profiler-profile__headline { margin: 0.4rem 0 0; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--profiler-muted); }
.profiler-profile__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0.6rem 0 0; padding: 0; list-style: none; font-size: 0.95rem; }
.profiler-profile__meta li { margin: 0; }
.profiler-profile__meta a { color: var(--profiler-accent); }
.profiler-profile__location::before {
	content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-right: 0.45em;
	border-radius: 50% 50% 50% 0; transform: rotate(-45deg) translateY(-0.1em); background: currentColor; opacity: 0.6;
}
@media (max-width: 600px) {
	.profiler-profile__identity { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

.profiler-ownerbar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
	margin: 0 clamp(1rem, 4vw, 2.5rem) 2rem; padding: 0.8rem 1rem;
	border: 1px solid var(--profiler-line); border-radius: var(--profiler-radius);
}
.profiler-ownerbar__status { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.profiler-ownerbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.profiler-inline-form { display: inline; margin: 0; }
.profiler-badge {
	display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.65rem;
	border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}
.profiler-badge::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.profiler-badge--private { background: var(--profiler-wash); border: 1px solid var(--profiler-line-strong); }
.profiler-badge--public { color: var(--profiler-success); background: color-mix(in srgb, var(--profiler-success) 12%, transparent); }

.profiler-profile__body { padding-inline: clamp(1rem, 4vw, 2.5rem); }
.profiler-profile__section { margin: 0 0 2.5rem; max-width: 42rem; }
.profiler-profile__section h2 { margin: 0 0 0.75rem; font-size: 1.2rem; }
.profiler-profile__page { font-size: 1.075rem; }
.profiler-profile__page img { max-width: 100%; height: auto; border-radius: 6px; }
.profiler-profile__empty {
	padding: 1.5rem; border: 1px dashed var(--profiler-line-strong); border-radius: var(--profiler-radius);
}
.profiler-profile__empty p { margin: 0 0 1rem; }
.profiler-profile__empty p:last-child { margin-bottom: 0; }

.profiler-profile__details { max-width: none; }
.profiler-profile__details dl {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: 1.5rem 2.5rem; margin: 0;
}
.profiler-detail { margin: 0; padding-top: 0.75rem; border-top: 1px solid var(--profiler-line); }
.profiler-detail dt { font-size: 0.9rem; font-weight: 600; color: var(--profiler-muted); margin-bottom: 0.3rem; }
.profiler-detail dd { margin: 0; }
.profiler-detail dd > :first-child { margin-top: 0; }
.profiler-detail dd > :last-child { margin-bottom: 0; }
.profiler-detail--type-repeater { grid-column: 1 / -1; }
.profiler-detail a { color: var(--profiler-accent); }

.profiler-repeater-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.profiler-repeater-view__item { padding: 1rem 1.1rem; border-left: 3px solid var(--profiler-accent); background: var(--profiler-wash); border-radius: 0 8px 8px 0; }
.profiler-repeater-view__row + .profiler-repeater-view__row { margin-top: 0.35rem; }
.profiler-repeater-view__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.profiler-repeater-view__row:first-child { font-weight: 700; font-size: 1.05rem; }
.profiler-repeater-view__row p { margin: 0.25rem 0 0; }

.profiler-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.profiler-chips li { margin: 0; padding: 0.15rem 0.7rem; border: 1px solid var(--profiler-line-strong); border-radius: 999px; font-size: 0.9rem; }
.profiler-field-image { max-width: 100%; height: auto; border-radius: 8px; }

.profiler-profile__links ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.profiler-profile__links a { color: var(--profiler-accent); font-weight: 600; }

/* Share button (shared with the BuddyPress integration) */
.profiler-share-row { margin: 0 0 2rem; }

@media (prefers-reduced-motion: reduce) {
	.profiler * { transition: none !important; }
}

/* Hold our layout against common theme overrides (img, dd, h2 rules). */
.profiler .profiler-upload__preview:not(#profiler-x) { width: 72px; height: 72px; max-width: none; }
.profiler .profiler-detail dd:not(#profiler-x),
.profiler .profiler-detail dt:not(#profiler-x) { margin-left: 0; margin-right: 0; }
.profiler .profiler-profile__section h2:not(#profiler-x) { font-size: 1.2rem; font-weight: 700; letter-spacing: 0; margin: 0 0 0.75rem; }
.profiler .profiler-profile__page:not(#profiler-x) { font-size: 1.075rem; }
.profiler .profiler-profile__page h2:not(#profiler-x) { font-size: 1.35rem; }
.profiler .profiler-profile__page p:not(#profiler-x) { font-size: inherit; }
.profiler .profiler-repeater-view__item:not(#profiler-x) { font-size: 1rem; }
.profiler .profiler-repeater-view__row:first-child:not(#profiler-x) { font-size: 1.05rem; }
.profiler .profiler-profile__avatar:not(#profiler-x) { max-width: none; }
.profiler .profiler-share:not(#profiler-x) { white-space: normal; text-align: left; }
.profiler .profiler-share svg { flex: none; }
