/*
 * Inside Media Paywall — public styles
 *
 * Design tokens (colours) are injected as CSS variables at runtime from the
 * Design settings; defaults are declared here as a fallback.
 */

:root {
	--imp-primary: #111111;
	--imp-accent: #cc0000;
	--imp-accent-hover: #a30000;
	--imp-bg: #ffffff;
	--imp-card-border: #e5e5e5;
	--imp-text: #333333;
	--imp-muted: #666666;
	--imp-radius: 8px;
	--imp-shadow: 0 2px 8px rgba( 0, 0, 0, 0.08 );
	--imp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
		Ubuntu, Cantarell, sans-serif;
}

/* Shared building blocks used across components. */
.imp-component {
	font-family: var( --imp-font );
	color: var( --imp-text );
}

/* background/color are forced so the accent CTA survives aggressive theme
 * button styling (e.g. Twenty Twenty-One's button selector at (0,0,3,1)). */
.imp-btn {
	display: inline-block;
	background: var( --imp-accent ) !important;
	color: #fff !important;
	border: none;
	border-radius: var( --imp-radius );
	padding: 12px 20px;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background 0.15s ease;
}

.imp-btn:hover,
.imp-btn:focus {
	background: var( --imp-accent-hover ) !important;
	color: #fff !important;
}

.imp-placeholder {
	font-family: var( --imp-font );
}

/* ---------------------------------------------------------------------------
 * Paywall overlay (PRD §4.2)
 * ------------------------------------------------------------------------- */

.imp-gated-content {
	position: relative;
}

.imp-paywall {
	position: relative;
	margin: 0 auto 2rem;
	max-width: 640px;
	font-family: var( --imp-font );
	color: var( --imp-text );
	animation: imp-fade-in 0.25s ease both;
}

/* Gradient fade pulled up over the end of the truncated content. */
.imp-paywall__fade {
	height: 140px;
	margin-top: -160px;
	margin-bottom: 8px;
	pointer-events: none;
	background: linear-gradient(
		to bottom,
		rgba( 255, 255, 255, 0 ) 0%,
		var( --imp-bg ) 85%
	);
}

.imp-paywall__card {
	background: var( --imp-bg );
	border: 1px solid var( --imp-card-border );
	border-radius: var( --imp-radius );
	box-shadow: var( --imp-shadow );
	padding: 2rem 1.75rem;
	text-align: center;
}

.imp-paywall__lock {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba( 204, 0, 0, 0.08 );
	color: var( --imp-accent );
	margin-bottom: 1rem;
}

.imp-paywall__headline {
	margin: 0 0 0.5rem;
	font-size: 1.6rem;
	line-height: 1.25;
	font-weight: 800;
	color: var( --imp-primary );
}

.imp-paywall__body {
	margin: 0 auto 1.25rem;
	max-width: 460px;
	color: var( --imp-muted );
	font-size: 1rem;
	line-height: 1.5;
}

.imp-paywall__cta {
	min-width: 240px;
	font-size: 1.05rem;
	padding: 14px 24px;
}

.imp-paywall__signin {
	margin: 1rem 0 0;
	font-size: 0.95rem;
}

.imp-paywall__signin a {
	color: var( --imp-accent );
	text-decoration: underline;
}

.imp-paywall__support {
	margin: 0.75rem 0 0;
	font-size: 0.85rem;
	color: var( --imp-muted );
}

@keyframes imp-fade-in {
	from { opacity: 0; transform: translateY( 6px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

@media ( max-width: 768px ) {
	.imp-paywall__card { padding: 1.5rem 1.25rem; }
	.imp-paywall__headline { font-size: 1.35rem; }
	.imp-paywall__cta { width: 100%; min-width: 0; }
}

/* ---------------------------------------------------------------------------
 * Pricing page (PRD §4.1)
 * ------------------------------------------------------------------------- */

/* Focused canvas (matches the checkout); hides the redundant theme page title. */
body.imp-purchase { background: #f4f5f7; }
body.imp-purchase .entry-header { display: none; }
body.imp-purchase .entry-content > .imp-pricing,
body.imp-purchase .entry-content { max-width: none; }

.imp-pricing {
	max-width: 1024px;
	margin: 0 auto;
	padding: 1rem;
	text-align: center;
}

.imp-pricing__head { margin-bottom: 1.5rem; }
.imp-pricing__logo img { max-height: 64px; width: auto; margin: 0 auto; }
.imp-pricing__sitename { font-size: 1.6rem; font-weight: 800; color: var( --imp-primary ); }
.imp-pricing__trust {
	margin: 0.75rem 0 0;
	font-size: 1.05rem;
	font-weight: 600;
	color: var( --imp-primary );
}

.imp-pricing__active {
	background: #f3faf3;
	border: 1px solid #cfe8cf;
	border-radius: var( --imp-radius );
	padding: 1rem 1.25rem;
	margin: 0 auto 1.5rem;
	max-width: 520px;
}
.imp-pricing__active p { margin: 0 0 0.5rem; font-weight: 600; }

/* Term toggle (segmented control) */
.imp-term-toggle {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	background: #f2f2f2;
	border-radius: 999px;
	padding: 4px;
	margin: 0 auto 2rem;
}
/* !important beats the theme's <button> styling (e.g. Twenty Twenty-One). */
.imp-term-toggle__btn {
	border: none !important;
	background: transparent !important;
	color: var( --imp-text ) !important;
	box-shadow: none !important;
	min-width: 0;
	margin: 0;
	padding: 9px 18px;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.imp-term-toggle__btn.is-active {
	background: #fff !important;
	color: var( --imp-primary ) !important;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.16 );
}

/* Plans grid */
.imp-plans {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 280px, 1fr ) );
	gap: 1.25rem;
	align-items: stretch;
}

.imp-plan {
	position: relative;
	background: var( --imp-bg );
	border: 1px solid var( --imp-card-border );
	border-radius: var( --imp-radius );
	box-shadow: var( --imp-shadow );
	padding: 2rem 1.5rem 1.5rem;
	text-align: left;
	display: flex;
	flex-direction: column;
}

.imp-plan__badge {
	position: absolute;
	top: -12px;
	left: 1.5rem;
	background: var( --imp-accent );
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 5px 12px;
	border-radius: 4px;
}
.imp-plan__name { margin: 0 0 0.25rem; font-size: 1.4rem; font-weight: 800; color: var( --imp-primary ); }
.imp-plan__desc { margin: 0 0 1rem; color: var( --imp-muted ); font-size: 0.95rem; }

.imp-plan__features { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.imp-plan__features li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; font-size: 0.95rem; }
.imp-check { color: var( --imp-accent ); flex: 0 0 auto; margin-top: 2px; }

.imp-plan__terms { margin-top: auto; }
.imp-plan__term { display: none; }
.imp-plan__term.is-active { display: block; }

.imp-plan__price { display: flex; align-items: baseline; gap: 4px; }
.imp-plan__amount { font-size: 2.4rem; font-weight: 800; color: var( --imp-primary ); line-height: 1; }
.imp-plan__per { color: var( --imp-muted ); font-size: 1rem; }
.imp-plan__billing { color: var( --imp-muted ); font-size: 0.85rem; margin: 4px 0 0; }
.imp-plan__save {
	display: inline-block;
	margin: 8px 0;
	background: rgba( 204, 0, 0, 0.1 );
	color: var( --imp-accent );
	font-weight: 700;
	font-size: 0.78rem;
	padding: 3px 8px;
	border-radius: 4px;
}
.imp-plan__cta { display: block; width: 100%; margin-top: 12px; box-sizing: border-box; }
.imp-plan__cta.is-disabled { background: #ccc; cursor: not-allowed; }
.imp-plan__trialnote { margin: 8px 0 0; font-size: 0.8rem; color: var( --imp-muted ); text-align: center; }

/* Footer */
.imp-pricing__foot { margin-top: 2rem; color: var( --imp-muted ); }
.imp-pricing__icons { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 0 0 0.75rem; }
/* Constrain badge height (theme img{height:auto} overrides the height attr). */
.imp-pricing__icons img { height: 26px !important; width: auto !important; }
.imp-pricing__disclaimer { margin: 0 0 0.5rem; font-size: 0.9rem; }
.imp-pricing__legal { font-size: 0.85rem; }
.imp-pricing__legal a { color: var( --imp-muted ); text-decoration: underline; }

@media ( max-width: 768px ) {
	.imp-plans { grid-template-columns: 1fr; }
	.imp-term-toggle { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------------------
 * Streamlined checkout + Welcome (PRD §4.4)
 * ------------------------------------------------------------------------- */

/* Focused, neutral canvas for the whole purchase flow. */
body.imp-checkout { background: #f4f5f7; }

/* Tighten the theme's content-area top spacing on the focused purchase pages
 * (the theme page title is hidden, so its surrounding spacing is dead space). */
body.imp-checkout .site-main,
body.imp-thankyou .site-main,
body.imp-purchase .site-main { padding-top: 1rem; }
body.imp-checkout .entry-content,
body.imp-thankyou .entry-content,
body.imp-purchase .entry-content { margin-top: 0; }
body.imp-checkout .woocommerce { max-width: 1040px !important; width: 100%; margin-left: auto; margin-right: auto; }

.imp-checkout-head { text-align: center; margin: 0.5rem 0 2.25rem; }
.imp-checkout-head h2 {
	margin: 0 0 0.4rem;
	color: var( --imp-primary );
	font-weight: 800;
	font-size: clamp( 1.6rem, 3vw, 2.1rem );
	letter-spacing: -0.01em;
}
.imp-checkout-head p { margin: 0; color: var( --imp-muted ); font-size: 1.05rem; }

/* Two columns: billing details (left) + sticky order summary (right). */
body.imp-checkout form.checkout.woocommerce-checkout {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 384px;
	grid-template-areas: "head head" "details summaryhead" "details summary";
	/* Fixed heading-row height so the tall billing card (which spans both rows)
	 * can't stretch it and push the summary card down. A content-sized track
	 * (max-content) still absorbs part of the spanning item, so use a fixed rem. */
	grid-template-rows: auto 2.25rem 1fr;
	gap: 0.75rem 2rem;
	align-items: start;
}
body.imp-checkout form.checkout .imp-checkout-head { grid-area: head; }
body.imp-checkout #customer_details { grid-area: details; }
body.imp-checkout #order_review_heading { grid-area: summaryhead; margin: 0 0 0.25rem; font-size: 1.1rem; color: var( --imp-primary ); font-weight: 700; }
/* width:100%/float:none override WooCommerce's default #order_review{width:48%;
 * float:right}, which otherwise halves the card inside its grid track. */
body.imp-checkout #order_review { grid-area: summary; width: 100%; float: none; position: sticky; top: 24px; }

/* Drop the theme's page title — "Complete your subscription" is the heading. */
body.imp-checkout .entry-header { display: none; }

/* Billing fills its column (WooCommerce's 2-col billing+shipping set collapses
 * to one for virtual subscriptions). */
body.imp-checkout #customer_details,
body.imp-checkout #customer_details .col2-set,
body.imp-checkout #customer_details .col-1 { width: 100%; max-width: 100%; float: none; }
body.imp-checkout #customer_details .col-2 { display: none; }
body.imp-checkout .form-row-first { width: 48%; float: left; clear: left; }
body.imp-checkout .form-row-last { width: 48%; float: right; }
body.imp-checkout .form-row-wide, body.imp-checkout .form-row.notes { clear: both; width: 100%; }

/* Card surfaces. */
body.imp-checkout .woocommerce-billing-fields,
body.imp-checkout .woocommerce-account-fields,
body.imp-checkout #order_review {
	background: #fff;
	border: 1px solid var( --imp-card-border );
	border-radius: 16px;
	padding: 1.75rem;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 ), 0 10px 30px rgba( 0, 0, 0, 0.05 );
}
body.imp-checkout .woocommerce-account-fields { margin-bottom: 1.25rem; }
body.imp-checkout .woocommerce-billing-fields > h3,
body.imp-checkout #customer_details h3 { margin: 0 0 1.1rem; font-size: 1.15rem; color: var( --imp-primary ); font-weight: 700; }

/* Form fields. */
body.imp-checkout .form-row { margin: 0 0 1rem; padding: 0; }
body.imp-checkout .form-row label { display: block; font-size: 0.9rem; font-weight: 600; color: var( --imp-primary ); margin-bottom: 5px; }
body.imp-checkout .form-row .required { color: var( --imp-accent ); border: 0; }
body.imp-checkout .form-row input.input-text,
body.imp-checkout .form-row textarea,
body.imp-checkout .form-row select {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 15px;
	border: 1px solid #c9ccd1;
	border-radius: 10px;
	font-size: 1rem;
	background: #fff;
	color: var( --imp-text );
	line-height: 1.3;
}
body.imp-checkout .form-row input.input-text:focus,
body.imp-checkout .form-row textarea:focus,
body.imp-checkout .form-row select:focus {
	outline: none;
	border-color: var( --imp-primary );
	box-shadow: 0 0 0 3px rgba( 17, 17, 17, 0.08 );
}
/* select2 (country / province) to match the inputs — flex-centred so the
 * selected text is vertically centred regardless of select2's own metrics. */
body.imp-checkout .select2-container { width: 100% !important; }
body.imp-checkout .select2-container--default .select2-selection--single {
	height: 46px;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	border: 1px solid #c9ccd1;
	border-radius: 10px;
	background: #fff;
}
body.imp-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
	flex: 1;
	line-height: normal;
	padding: 0 28px 0 15px;
	color: var( --imp-text );
}
body.imp-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 100%;
	top: 0;
	right: 8px;
}

/* Order summary table. */
body.imp-checkout #order_review table.shop_table { border: 0; margin: 0; width: 100%; table-layout: fixed; }
body.imp-checkout #order_review table.shop_table th,
body.imp-checkout #order_review table.shop_table td {
	border: 0;
	border-bottom: 1px solid #eef0f2;
	padding: 12px 0;
	font-size: 0.95rem;
	overflow-wrap: anywhere;
	vertical-align: top;
}
/* Align by column position (rows mix th/td), not by cell type. */
body.imp-checkout #order_review table.shop_table th:first-child,
body.imp-checkout #order_review table.shop_table td:first-child { width: 62%; text-align: left; }
body.imp-checkout #order_review table.shop_table th:last-child,
body.imp-checkout #order_review table.shop_table td:last-child { width: 38%; text-align: right; }
body.imp-checkout #order_review table.shop_table th { font-weight: 600; color: var( --imp-primary ); }
body.imp-checkout #order_review .product-name { font-weight: 500; color: var( --imp-text ); }
body.imp-checkout #order_review .order-total th,
body.imp-checkout #order_review .order-total td { border-bottom: 0; padding-top: 16px; font-size: 1.2rem; color: var( --imp-primary ); font-weight: 800; }

/* Free-trial: a full-width highlighted callout (rendered outside the table). */
body.imp-checkout .imp-trial-callout {
	background: #fdeceb;
	border-radius: 10px;
	padding: 12px 14px;
	margin: 14px 0;
	font-size: 0.9rem;
	line-height: 1.5;
}
body.imp-checkout .imp-trial-callout__label { font-weight: 700; color: var( --imp-primary ); }
body.imp-checkout .imp-trial-callout__text { color: var( --imp-accent ); font-weight: 600; }

/* Payment box. */
body.imp-checkout #payment { background: transparent; border-radius: 0; margin-top: 0.5rem; }
body.imp-checkout #payment ul.payment_methods { border: 0; padding: 0.5rem 0; margin: 0; }
body.imp-checkout #payment ul.payment_methods li { margin: 0 0 6px; }
body.imp-checkout #payment .payment_box { background: #f6f7f9; border-radius: 10px; }
body.imp-checkout #payment .payment_box::before { display: none; }
body.imp-checkout #payment div.form-row.place-order { padding: 1rem 0 0; margin: 0; }

/* Place-order button — red pill, full width (forced over theme button styles). */
body.imp-checkout #payment div.form-row.place-order { width: 100%; float: none; text-align: center; padding: 1rem 0 0; margin: 0; }
/* WooCommerce gives this wrapper an 80px bottom margin — collapse the gap
 * between the privacy text and the Place-order button. */
body.imp-checkout #payment .woocommerce-terms-and-conditions-wrapper { margin-bottom: 1rem; }
body.imp-checkout #place_order {
	display: block;
	width: 100%;
	background: var( --imp-accent ) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px;
	padding: 15px 20px;
	font-size: 1.05rem;
	font-weight: 700;
	box-shadow: none;
	float: none;
}
body.imp-checkout #place_order:hover { background: var( --imp-accent-hover ) !important; }

/* WooCommerce privacy-policy text: small + muted, not a wall of large type. */
body.imp-checkout .woocommerce-privacy-policy-text,
body.imp-checkout .woocommerce-privacy-policy-text p {
	font-size: 0.78rem;
	line-height: 1.5;
	color: var( --imp-muted );
	margin: 0.85rem 0 0;
}

.imp-checkout-trust {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	clear: both;
	/* padding-top (not margin-top, which was collapsing to 0) guarantees the
	 * badges sit clear of the Place-order button above. */
	margin-top: 0;
	padding-top: 1.25rem;
	color: var( --imp-muted );
	font-size: 0.82rem;
	text-align: center;
}
/* Force a consistent badge height (the height="26" attr is overridden by the
 * theme's img{height:auto}, so the SVGs were rendering at their natural 32px). */
.imp-checkout-trust img { height: 22px !important; width: auto !important; opacity: 0.9; vertical-align: middle; }
.imp-checkout-trust span { flex-basis: 100%; }

/* Hide WooCommerce cruft the streamlined single-plan flow doesn't need
 * (incl. the "added to cart / view cart" message). */
body.imp-checkout .woocommerce-form-coupon-toggle,
body.imp-checkout .woocommerce-additional-fields__field-wrapper,
body.imp-checkout .woocommerce-shipping-fields,
body.imp-checkout .woocommerce > .woocommerce-notices-wrapper .woocommerce-message { display: none; }

/* Clean, branded styling for real notices (validation errors / info). */
body.imp-checkout .woocommerce-error,
body.imp-checkout .woocommerce-info {
	max-width: 1040px;
	margin: 0 auto 1.5rem;
	padding: 14px 18px;
	border-radius: 12px;
	list-style: none;
	font-size: 0.95rem;
}
body.imp-checkout .woocommerce-error { background: #fdeceb; border: 1px solid #f5c2c0; color: #a4302c; }
body.imp-checkout .woocommerce-info { background: #eef4ff; border: 1px solid #cfe0ff; color: #1c4ca8; }
body.imp-checkout .woocommerce-error::before,
body.imp-checkout .woocommerce-info::before { display: none; }
/* WooCommerce focuses notices (tabindex=-1); kill the theme's blue focus ring. */
body.imp-checkout .woocommerce-error:focus,
body.imp-checkout .woocommerce-info:focus,
body.imp-checkout .woocommerce-message:focus { outline: none; box-shadow: none; }
body.imp-checkout .woocommerce-error .button,
body.imp-checkout .woocommerce-info .button {
	float: none;
	background: transparent !important;
	color: var( --imp-primary ) !important;
	border: 1px solid currentColor !important;
	box-shadow: none !important;
	border-radius: 999px;
}

@media ( max-width: 920px ) {
	body.imp-checkout form.checkout.woocommerce-checkout {
		grid-template-columns: 1fr;
		grid-template-areas: "head" "details" "summaryhead" "summary";
		grid-template-rows: none;
		gap: 1rem;
		max-width: 560px;
		margin: 0 auto;
	}
	body.imp-checkout #order_review { position: static; }
	body.imp-checkout .imp-checkout-head { margin: 0 0 0.25rem; }
	body.imp-checkout .imp-checkout-head h2 { font-size: 1.5rem; }
	body.imp-checkout .woocommerce-billing-fields,
	body.imp-checkout .woocommerce-account-fields,
	body.imp-checkout #order_review { padding: 1.25rem; border-radius: 14px; }
}

/* Welcome / order-received confirmation. */
.imp-welcome {
	max-width: 540px;
	margin: 2rem auto;
	padding: 3rem 2.5rem;
	text-align: center;
	background: #fff;
	border: 1px solid var( --imp-card-border );
	border-radius: 20px;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 ), 0 16px 40px rgba( 0, 0, 0, 0.06 );
}
.imp-welcome__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	margin-bottom: 1.25rem;
	color: #15924a;
	background: #e7f6ec;
	border-radius: 50%;
}
.imp-welcome__title { margin: 0 0 0.4rem; color: var( --imp-primary ); font-weight: 800; font-size: 1.8rem; }
.imp-welcome__sub { margin: 0 0 1.75rem; color: var( --imp-muted ); font-size: 1.05rem; }
.imp-welcome__details {
	list-style: none;
	margin: 0 auto 1.75rem;
	padding: 1.1rem 1.25rem;
	max-width: 380px;
	text-align: left;
	background: #f6f7f9;
	border-radius: 12px;
}
.imp-welcome__details li { margin: 6px 0; color: var( --imp-text ); }
.imp-welcome__cta { min-width: 220px; border-radius: 999px; }

/* Order-received / thank-you page (managed subscription). */
body.imp-thankyou .woocommerce { max-width: 620px !important; }
body.imp-thankyou .woocommerce-order > .woocommerce-notice,
body.imp-thankyou .woocommerce-order > .woocommerce-order-overview,
body.imp-thankyou .woocommerce-order > p { display: none; }
body.imp-thankyou .woocommerce-order-details,
body.imp-thankyou .woocommerce-customer-details {
	background: #fff;
	border: 1px solid var( --imp-card-border );
	border-radius: 16px;
	padding: 1.5rem 1.75rem;
	margin: 1.5rem auto 0;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 ), 0 10px 30px rgba( 0, 0, 0, 0.05 );
}
body.imp-thankyou .woocommerce-order-details h2,
body.imp-thankyou .woocommerce-customer-details h2 { font-size: 1.1rem; color: var( --imp-primary ); font-weight: 700; margin: 0 0 1rem; }
body.imp-thankyou .woocommerce-table--order-details { width: 100%; border: 0; margin: 0; }
body.imp-thankyou .woocommerce-table--order-details th,
body.imp-thankyou .woocommerce-table--order-details td { border: 0; border-bottom: 1px solid #eef0f2; padding: 10px 0; }
body.imp-thankyou .woocommerce-table--order-details tfoot tr:last-child th,
body.imp-thankyou .woocommerce-table--order-details tfoot tr:last-child td { border-bottom: 0; color: var( --imp-primary ); font-weight: 800; font-size: 1.05rem; }
body.imp-thankyou address { font-style: normal; line-height: 1.7; color: var( --imp-text ); }

/* ---------------------------------------------------------------------------
 * Auth (sign in / sign up / forgot) — PRD §4.3
 * ------------------------------------------------------------------------- */

.imp-auth[hidden] { display: none; }

/* Modal context */
.imp-auth--modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.imp-auth__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 17, 17, 17, 0.6 );
}

.imp-auth__dialog {
	position: relative;
	background: var( --imp-bg );
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
	width: 100%;
	max-width: 460px;
	font-family: var( --imp-font );
	color: var( --imp-text );
	max-height: 92vh;
	overflow-y: auto;
	overflow-x: hidden;
}
.imp-auth--modal .imp-auth__dialog { animation: imp-fade-in 0.2s ease both; }
.imp-auth--inline .imp-auth__dialog {
	margin: 0 auto;
	border: 1px solid var( --imp-card-border );
	box-shadow: var( --imp-shadow );
}

.imp-auth__body { padding: 2.5rem 2.25rem 1.5rem; }

/* Overlay controls must beat arbitrary theme button styling (e.g. Twenty
 * Twenty-One styles every <button> at specificity (0,0,3,1)), so the few
 * appearance properties that themes hijack are forced. */
.imp-auth .imp-auth__close {
	position: absolute;
	top: 14px;
	right: 16px;
	border: none;
	background: transparent !important;
	box-shadow: none !important;
	min-width: 0;
	padding: 0;
	font-size: 26px;
	line-height: 1;
	color: var( --imp-primary ) !important;
	cursor: pointer;
	z-index: 1;
}
.imp-auth__logo { text-align: center; margin-bottom: 1.25rem; }
.imp-auth__logo img,
.imp-auth__logo-img { max-height: 44px; width: auto; display: inline-block; }

.imp-auth__panel { display: none; }
.imp-auth__panel.is-active { display: block; }

.imp-auth__icon { text-align: center; color: var( --imp-primary ); margin-bottom: 0.4rem; }
.imp-auth__icon svg { display: inline-block; }

.imp-auth__title { margin: 0 0 1.5rem; text-align: center; color: var( --imp-primary ); font-weight: 800; font-size: 1.7rem; }

.imp-auth__field { display: block; margin-bottom: 1rem; }
.imp-auth__field > span,
.imp-auth__fieldlabel { display: block; font-size: 0.95rem; font-weight: 500; margin-bottom: 6px; color: var( --imp-primary ); }
.imp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect( 0, 0, 0, 0 ); white-space: nowrap; border: 0; }

.imp-auth__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.imp-auth__labelrow .imp-auth__fieldlabel { margin-bottom: 0; }

.imp-auth .imp-auth__field input {
	width: 100%;
	box-sizing: border-box;
	padding: 14px 20px;
	border: 1px solid #c9ccd1;
	border-radius: 999px;
	font-size: 1rem;
	background: #fff;
	color: var( --imp-text );
}
.imp-auth .imp-auth__field input:focus {
	outline: none;
	border-color: var( --imp-primary );
	box-shadow: 0 0 0 2px rgba( 17, 17, 17, 0.15 );
}
.imp-auth__pw { position: relative; display: block; }
.imp-auth .imp-auth__pw input { padding-right: 76px; }
.imp-auth .imp-auth__pwtoggle {
	position: absolute;
	top: 50%;
	right: 18px;
	transform: translateY( -50% );
	border: none;
	background: none !important;
	box-shadow: none !important;
	min-width: 0;
	padding: 0;
	color: var( --imp-muted ) !important;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}
.imp-auth__forgot { color: var( --imp-primary ); font-weight: 700; font-size: 0.9rem; text-decoration: underline; white-space: nowrap; }

.imp-auth__checkbox { display: flex; align-items: flex-start; gap: 8px; margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.imp-auth__submit {
	width: 100%;
	margin-top: 0.5rem;
	border-radius: 999px;
	padding: 15px 20px;
	font-size: 1.05rem;
	font-weight: 700;
}

.imp-auth__social { text-align: center; margin-top: 1.5rem; }
.imp-auth__or { color: var( --imp-primary ); font-size: 0.95rem; margin: 0 0 0.85rem; }
.imp-auth__providers { display: flex; justify-content: center; gap: 16px; }
.imp-auth__provider {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var( --imp-primary );
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}
.imp-auth__provider--google { background: #4285f4; }
.imp-auth__provider--apple { background: #000; }

.imp-auth__switch { text-align: center; font-size: 0.95rem; margin: 1.5rem 0 0; color: var( --imp-text ); }
.imp-auth__switch a { color: var( --imp-primary ); font-weight: 700; text-decoration: underline; }

.imp-auth__footer {
	padding: 16px 20px;
	background: #f0f0f0;
	text-align: center;
	font-size: 0.95rem;
	color: var( --imp-primary );
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}
.imp-auth__phone { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.imp-auth__phone a,
.imp-auth__footer > a { color: var( --imp-primary ); text-decoration: none; font-weight: 700; }

.imp-auth__error {
	background: #fdecea;
	border: 1px solid #f5c2c0;
	color: #a4302c;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 0.9rem;
	margin-bottom: 1rem;
}
.imp-auth__success {
	background: #eaf7ea;
	border: 1px solid #bfe3bf;
	color: #1a6b1a;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 0.9rem;
	margin-bottom: 1rem;
}

/* ---------------------------------------------------------------------------
 * My Account → My Subscription (PRD §4.5)
 * ------------------------------------------------------------------------- */

.imp-account__card {
	background: #fff;
	border: 1px solid var( --imp-card-border );
	border-radius: 14px;
	padding: 1.5rem 1.75rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 ), 0 8px 24px rgba( 0, 0, 0, 0.04 );
}
.imp-account__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 0.75rem;
}
.imp-account__plan { font-size: 1.2rem; font-weight: 800; color: var( --imp-primary ); }
.imp-account__status {
	font-size: 0.78rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 999px;
	background: #eee;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
.imp-status--active,
.imp-status--pending-cancel,
.imp-status--pending-cancellation { background: #e6f6e6; color: #1a7d1a; }
.imp-status--on-hold,
.imp-status--paused,
.imp-status--pending { background: #fff4e0; color: #9a6700; }
.imp-status--cancelled,
.imp-status--expired { background: #fdecea; color: #a4302c; }

.imp-account__meta { width: 100%; margin: 0 0 1rem; border-collapse: collapse; }
.imp-account__meta th { text-align: left; width: 45%; color: var( --imp-muted ); font-weight: 600; }
.imp-account__meta th,
.imp-account__meta td { border: 0; border-bottom: 1px solid #eef0f2; padding: 9px 0; }
.imp-account__meta tr:last-child th,
.imp-account__meta tr:last-child td { border-bottom: 0; }

.imp-account__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.imp-btn--ghost { background: transparent !important; color: var( --imp-accent ) !important; border: 1px solid var( --imp-accent ); }
.imp-btn--ghost:hover { background: var( --imp-accent ) !important; color: #fff !important; }

.imp-account__heading { margin: 0 0 1rem; color: var( --imp-primary ); font-weight: 700; }
.imp-account__history-card {
	background: #fff;
	border: 1px solid var( --imp-card-border );
	border-radius: 14px;
	padding: 1.5rem 1.75rem;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 ), 0 8px 24px rgba( 0, 0, 0, 0.04 );
}
.imp-account__history td:first-child { white-space: nowrap; }
@media ( max-width: 600px ) {
	.imp-account__history-card { padding: 1.25rem; }
	.imp-account__history { table-layout: auto; }
	.imp-account__history th,
	.imp-account__history td { padding: 10px 6px; font-size: 0.85rem; }
	.imp-account__history th:first-child,
	.imp-account__history td:first-child { padding-left: 0; }
	.imp-account__history th:last-child,
	.imp-account__history td:last-child { padding-right: 0; }
	/* Hide the secondary Order # column — the View link already opens the order. */
	.imp-account__history th:nth-child( 2 ),
	.imp-account__history td:nth-child( 2 ) { display: none; }
}

/* Billing history — clean rows, no boxy theme/WooCommerce table borders. */
.imp-account__history.shop_table,
.imp-account__history { width: 100%; border: 0; border-collapse: collapse; border-radius: 0; }
.imp-account__history th,
.imp-account__history td {
	border: 0;
	border-bottom: 1px solid #eef0f2;
	padding: 12px 10px;
	text-align: left;
	font-size: 0.95rem;
}
.imp-account__history thead th { color: var( --imp-primary ); font-weight: 700; background: transparent; }
.imp-account__history td:last-child,
.imp-account__history th:last-child { text-align: right; }
.imp-account__history tbody tr:last-child td { border-bottom: 0; }
