/*
 * Layout and status styling for the ID.me verification control.
 *
 * Buttons intentionally carry the theme's own classes (wp-block-button__link
 * and button) so colour, radius and typography come from the active theme.
 * Only spacing and the status treatments live here. Colours use currentColor
 * or neutral values so the control sits inside any palette.
 */

.t4t-idme {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
	margin: 1rem 0;
}

.t4t-idme__button {
	display: inline-block;
	text-decoration: none;
}

.t4t-idme__notice {
	margin: 0;
	padding: 0.65rem 0.9rem;
	border-left: 4px solid currentColor;
	border-radius: 2px;
	font-size: 0.95rem;
	line-height: 1.4;
}

.t4t-idme__notice--success {
	color: #1a7f37;
	background: rgba(26, 127, 55, 0.08);
}

.t4t-idme__notice--warning {
	color: #8a6100;
	background: rgba(138, 97, 0, 0.08);
}

.t4t-idme__notice--error {
	color: #b32d2e;
	background: rgba(179, 45, 46, 0.08);
}

.t4t-idme__sandbox {
	margin: 0;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0.7;
}

/* Embedded Jotform. Height is managed by assets/t4t-idme-jotform.js. */
.t4t-idme__jotform {
	display: block;
	width: 100%;
	max-width: 100%;
	border: none;
	margin: 1rem 0;
}

/* ---------------------------------------------------------------------------
 * ID.me button.
 *
 * The button is ID.me's own SVG, shipped unmodified in assets/idme/. Nothing
 * here draws a button, sets a brand colour or styles any text: doing so is what
 * made the earlier version both ugly and non-compliant.
 *
 * The two image URLs arrive as custom properties set inline by PHP, which is
 * how the hover swap works without JavaScript and without this file needing to
 * know where the plugin is installed. Width and height arrive the same way, so
 * the button holds its space before the SVG loads.
 * ------------------------------------------------------------------------ */

.t4t-idme__btn {
	display: inline-block;
	background-image: var(--t4t-idme-default);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	border: none;
	padding: 0;
	max-width: 100%;
	text-decoration: none;
}

.t4t-idme__btn:hover,
.t4t-idme__btn:focus {
	background-image: var(--t4t-idme-hover);
	text-decoration: none;
}

/* ID.me's artwork has no focus state of its own, and a keyboard user needs
   one. Drawn outside the button so it never covers the wordmark. */
.t4t-idme__btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
	border-radius: 4px;
}

/* The Verified badge is largely white space and vanishes on a light page.
   The border goes outside the artwork and the box grows to fit, so ID.me's
   clear space is preserved rather than eaten into. */
.t4t-idme__btn--bordered {
	box-sizing: content-box;
	padding: 6px 10px;
	border: 1px solid rgba(3, 35, 24, 0.25);
	border-radius: 6px;
}

/* An operator's own uploaded asset, used instead of the bundled set. */
.t4t-idme__btn-custom,
.t4t-idme__btn-custom:hover,
.t4t-idme__btn-custom:focus {
	display: inline-block;
	border: none;
	background: none;
	padding: 0;
	line-height: 0;
	text-decoration: none;
}

.t4t-idme__btn-custom img {
	display: block;
	width: auto;
	max-width: 100%;
	height: 44px;
}

/* The label is in the artwork, so the text copy is for assistive tech only.
   Themes usually define this, but the button must not depend on that. */
.t4t-idme .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------
 * Conditional blocks.
 *
 * Both branches are in the markup, so the page is identical for every visitor
 * and caches safely. Neither shows until assets/t4t-idme-state.js has put the
 * state class on <body>, which fails closed: with no JavaScript, or a failed
 * state request, no claim is made either way.
 * ------------------------------------------------------------------------ */

.t4t-idme-only {
	display: none;
}

.t4t-idme-verified     .t4t-idme-only--verified,
.t4t-idme-not-verified .t4t-idme-only--unverified {
	display: inline;
}
