/* TruAnon owner panel — self-contained overlay, no framework. */

/* The owner's hero card on profile screens. */
.truanon-hero {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 18px;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 10px;
	padding: 16px 20px;
	margin: 18px 0;
	max-width: 52em;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.truanon-hero-text {
	flex: 1 1 20em;
}

.truanon-hero-text h3 {
	margin: 0 0 4px;
	font-size: 15px;
	line-height: 1.3;
}

.truanon-hero-text p {
	margin: 0;
	opacity: 0.8;
}

/* Minimal button dressing so the hero also reads right on the front end,
   where wp-admin's .button styles don't exist. */
.truanon-hero .truanon-manage {
	cursor: pointer;
	white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
	.truanon-hero {
		background: #1d2327;
		border-color: #3c434a;
		color: #e2e4e7;
	}
}

/* Owner's switch bar: a wide control only the profile owner sees. A single
   rounded box — the plain-language status (and, once anchored, the member's
   public TruAnon link) on the left, and the action button as a segment on the
   right. Explicit font sizing/weight because it renders inside the profile
   heading. Clicking the button opens the shared overlay. */
.truanon-owner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em 0.9em;
	margin: 0.85em 0;
	padding: 0.5em 0.55em 0.5em 0.95em;
	background: rgba(128, 134, 143, 0.1);
	border: 1px solid rgba(128, 134, 143, 0.28);
	border-radius: 12px;
	font-size: 0.9rem;
	font-weight: 400;
	line-height: 1.3;
	text-align: left;
	vertical-align: middle;
}

/* Left column: status over link. flex:1 pushes the button to the right; min-
   width:0 lets a long link ellipsis rather than overflow the box. */
.truanon-owner-text {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	flex: 1 1 12em;
	min-width: 0;
}

.truanon-owner-status {
	opacity: 0.85;
}

.truanon-owner-link {
	color: var(--truanon-genuine);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.truanon-owner-link:hover,
.truanon-owner-link:focus {
	text-decoration: underline;
}

/* The action button — a solid segment of the bar, not a floating pill. */
.truanon-switch {
	flex: none;
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	background: var(--truanon-genuine);
	color: #fff;
	border: 0;
	border-radius: 9px;
	padding: 0.5em 1.15em;
	font-size: 0.9rem;
	line-height: 1.1;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}

.truanon-switch:hover,
.truanon-switch:focus {
	filter: brightness(1.1);
	color: #fff;
}

/* Anchored reads as confirmed: the action goes green. */
.truanon-owner.is-anchored .truanon-switch {
	background: var(--truanon-reliable);
}

@media (prefers-color-scheme: dark) {
	.truanon-owner {
		background: rgba(226, 228, 231, 0.08);
		border-color: rgba(226, 228, 231, 0.18);
	}
}

.truanon-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(10, 12, 16, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.truanon-box {
	background: #fff;
	color: #1e1e1e;
	border-radius: 12px;
	width: 480px;
	max-width: 100%;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.truanon-box-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid rgba(128, 134, 143, 0.25);
}

.truanon-box-head h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

.truanon-box-close {
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 4px 8px;
	color: inherit;
	opacity: 0.65;
}

.truanon-box-close:hover {
	opacity: 1;
}

.truanon-box-body {
	padding: 18px;
	overflow-y: auto;
}

.truanon-box-body p {
	margin: 0 0 1em;
}

/* Verify iframe fills the box. */
.truanon-box.truanon-box-iframe .truanon-box-body {
	padding: 0;
	height: min(840px, 80vh);
}

.truanon-box iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Pitch state. */
.truanon-pitch h4 {
	margin: 0 0 0.5em;
}

.truanon-verify-btn {
	display: block;
	width: 100%;
	padding: 12px;
	margin: 14px 0 10px;
	border: 0;
	border-radius: 999px;
	background: var(--truanon-reliable);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.truanon-verify-btn:hover {
	filter: brightness(1.08);
}

/* Switches state. */
.truanon-switch-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 7px 0;
}

/* Divider + breathing room between logical groups only — the three "display"
   toggles are one set and get no line between them. */
.truanon-switch-group + .truanon-switch-group {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(128, 134, 143, 0.25);
}

/* A dependent toggle is moot while "Use verified identity" is off. */
.truanon-switch-row.truanon-disabled {
	opacity: 0.45;
}

/* Native checkbox, just sized to the label so it doesn't read as dwarfed, and
   tinted on-brand. Still a plain functional input. */
.truanon-switch-row input[type="checkbox"] {
	flex: none;
	width: 1.2em;
	height: 1.2em;
	margin: 0.12em 0 0;
	accent-color: var(--truanon-reliable);
	cursor: pointer;
}

.truanon-switch-row small {
	display: block;
	opacity: 0.7;
}

.truanon-panel-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 14px;
}

.truanon-save-btn {
	padding: 8px 20px;
	border: 0;
	border-radius: 999px;
	background: #2f6ef2;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.truanon-status {
	font-size: 13px;
	opacity: 0.75;
}

.truanon-error {
	color: #b32d2e;
}

@media (prefers-color-scheme: dark) {
	.truanon-box {
		background: #1d2327;
		color: #e2e4e7;
	}
}
