/* GSM Secure Access frontend styles */
.gsa-wrap,
.gsa-wrap * {
	box-sizing: border-box;
}

.gsa-wrap {
	/* Light, neutral base that blends with ANY theme. The accent auto-adapts to
	   the site's own primary colour (set by frontend.js from theme CSS vars),
	   so buttons/links/brand match the surrounding website automatically. */
	--gsa-bg: transparent;
	--gsa-surface: #ffffff;
	--gsa-surface-muted: #f4f6fb;
	--gsa-text: #0f172a;
	--gsa-text-soft: #56617a;
	--gsa-border: #e6e9f2;
	--gsa-primary: #0f172a;
	--gsa-accent: #4f46e5;
	--gsa-accent-strong: #4338ca;
	--gsa-success: #16a34a;
	--gsa-warning: #d97706;
	--gsa-danger: #dc2626;
	/* Notice/status text tokens — dark, readable text on pale tinted boxes in
	   light mode; overridden to pale text in the dark-mode block below. */
	--gsa-ok-text: #166534;
	--gsa-error-text: #991b1b;
	--gsa-info-text: #1e40af;
	--gsa-warn-text: #92400e;
	--gsa-radius-sm: 12px;
	--gsa-radius: 18px;
	--gsa-radius-lg: 26px;
	--gsa-shadow: 0 18px 44px rgba(16, 24, 40, 0.12);
	--gsa-shadow-sm: 0 8px 22px rgba(16, 24, 40, 0.08);
	/* Depth from any single accent: a soft light sheen top-right, a gentle dark
	   vignette bottom-left, over a diagonal dark→accent→dark band. Elegant even
	   when the theme hands us one flat colour (JS also darkens accent-strong). */
	--gsa-gradient:
		radial-gradient(680px 460px at 82% -8%, rgba(255, 255, 255, 0.22), transparent 58%),
		radial-gradient(620px 520px at 0% 112%, rgba(0, 0, 0, 0.22), transparent 55%),
		linear-gradient(152deg, var(--gsa-accent-strong) 0%, var(--gsa-accent) 58%, var(--gsa-accent-strong) 100%);
	width: min(calc(100% - 24px), 1180px);
	margin: 32px auto;
	color: var(--gsa-text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Auto dark-mode: on visitors whose device prefers dark, switch the surfaces to
   a dark palette (the accent still auto-matches the theme). */
@media (prefers-color-scheme: dark) {
	.gsa-wrap {
		--gsa-surface: #131a2a;
		--gsa-surface-muted: #1b2436;
		--gsa-text: #e7eefc;
		--gsa-text-soft: rgba(231, 238, 252, 0.72);
		--gsa-border: rgba(231, 238, 252, 0.12);
		--gsa-primary: #f8fbff;
		--gsa-shadow: 0 18px 44px rgba(0, 0, 0, 0.40);
		--gsa-shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.30);
		--gsa-ok-text: #bbf7d0;
		--gsa-error-text: #fecaca;
		--gsa-info-text: #bfdbfe;
		--gsa-warn-text: #fde68a;
	}
}

.gsa-shell {
	display: grid;
	grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.12fr);
	gap: 28px;
	align-items: stretch;
}

.gsa-shell--security {
	grid-template-columns: 1fr;
}

.gsa-card {
	background: var(--gsa-surface);
	border: 1px solid var(--gsa-border);
	border-radius: var(--gsa-radius-lg);
	box-shadow: var(--gsa-shadow);
	padding: clamp(22px, 3vw, 34px);
	position: relative;
	overflow: hidden;
	animation: gsaRise .45s ease both;
}

@keyframes gsaRise {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.gsa-auth-card {
	animation-delay: .08s;
}

/* Signature accent strip along the top of the form card. */
.gsa-auth-card::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--gsa-accent-strong), var(--gsa-accent));
}

/* My Security page — device rows. */
.gsa-devices .gsa-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 10px 0;
	color: var(--gsa-text);
}

.gsa-device-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 16px;
	margin-top: 10px;
	border: 1px solid var(--gsa-border);
	border-radius: var(--gsa-radius-sm);
	background: var(--gsa-surface-muted);
}

.gsa-device-info {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.gsa-device-info strong {
	color: var(--gsa-primary);
	font-size: .98rem;
}

.gsa-device-info span {
	color: var(--gsa-text-soft);
	font-size: .86rem;
}

.gsa-device-now {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: .72rem;
	font-weight: 700;
	background: color-mix(in srgb, var(--gsa-accent) 16%, transparent);
	color: var(--gsa-accent-strong);
	vertical-align: middle;
}

.gsa-device-row .gsa-btn {
	min-height: 40px;
	padding: 0 14px;
	flex: none;
}

/* Contextual mini-guide on the brand panel (Recovery / Reset / Verify views). */
.gsa-guide {
	margin-top: 22px;
	padding: 16px 18px;
	border-radius: var(--gsa-radius);
	background: rgba(255, 255, 255, 0.10);
	border: 1px solid var(--gsa-border);
	position: relative;
	z-index: 1;
}

.gsa-guide-title {
	font-weight: 800;
	font-size: 1.02rem;
	margin-bottom: 10px;
	color: var(--gsa-primary);
}

.gsa-guide-steps {
	margin: 0 0 0 4px;
	padding: 0;
	list-style: none;
	counter-reset: gsa-step;
	display: grid;
	gap: 9px;
}

.gsa-guide-steps li {
	counter-increment: gsa-step;
	position: relative;
	padding-left: 32px;
	color: var(--gsa-text-soft);
	font-size: 0.93rem;
	line-height: 1.55;
}

.gsa-guide-steps li::before {
	content: counter(gsa-step);
	position: absolute;
	left: 0;
	top: 1px;
	width: 21px;
	height: 21px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid var(--gsa-border);
	color: var(--gsa-primary);
	font-size: 0.78rem;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gsa-guide-note {
	margin: 12px 0 0;
	padding-top: 10px;
	border-top: 1px dashed var(--gsa-border);
	color: var(--gsa-text-soft);
	font-size: 0.85rem;
	line-height: 1.55;
}

.gsa-trust-note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin-top: 20px;
	color: var(--gsa-text-soft);
	font-size: .84rem;
	position: relative;
	z-index: 1;
}

.gsa-trust-note svg {
	width: 13px;
	height: 13px;
}

.gsa-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(400px 240px at top right, rgba(59,130,246,.10), transparent 55%);
	pointer-events: none;
}

.gsa-card--compact {
	max-width: 580px;
	margin: 0 auto;
}

.gsa-card--header {
	padding-bottom: 28px;
}

.gsa-brand-card {
	background: var(--gsa-accent); /* fallback for very old browsers */
	background: var(--gsa-gradient);
	/* This panel sits on the accent colour → flip its text tokens to light so it
	   stays readable whatever accent the theme provides. */
	--gsa-primary: #ffffff;
	--gsa-text: #ffffff;
	--gsa-text-soft: rgba(255, 255, 255, 0.86);
	--gsa-border: rgba(255, 255, 255, 0.24);
	color: #ffffff;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

/* Soft light orbs + a faint tech grid give the panel life without any images. */
.gsa-brand-card::before {
	background:
		radial-gradient(340px 220px at 85% 10%, rgba(255, 255, 255, 0.16), transparent 60%),
		radial-gradient(320px 260px at 6% 96%, rgba(255, 255, 255, 0.10), transparent 55%);
}

.gsa-brand-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
	background-size: 26px 26px;
	pointer-events: none;
	-webkit-mask-image: radial-gradient(460px 460px at 30% 18%, rgba(0, 0, 0, 0.85), transparent 72%);
	mask-image: radial-gradient(460px 460px at 30% 18%, rgba(0, 0, 0, 0.85), transparent 72%);
}

.gsa-brand-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 30px;
	position: relative;
	z-index: 1;
}

.gsa-brand-top .gsa-brand-badge {
	margin-bottom: 0;
}

.gsa-live-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 13px;
	border-radius: 999px;
	background: rgba(255,255,255,.10);
	border: 1px solid var(--gsa-border);
	font-size: .8rem;
	font-weight: 700;
	position: relative;
	z-index: 1;
}

.gsa-live-dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #4ade80;
	box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
	animation: gsaPulse 2.2s ease-out infinite;
}

@keyframes gsaPulse {
	70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
	100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.gsa-brand-mark {
	width: 64px;
	height: 64px;
	border-radius: 20px;
	background: rgba(255,255,255,.12);
	border: 1px solid var(--gsa-border);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
	/* Soft halo ring around the shield mark */
	box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.06), var(--gsa-shadow-sm);
	position: relative;
	z-index: 1;
}

.gsa-brand-mark svg {
	width: 34px;
	height: 34px;
}

.gsa-trust-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: auto;
	padding-top: 30px;
	position: relative;
	z-index: 1;
}

.gsa-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 14px;
	border-radius: 999px;
	background: rgba(255,255,255,.10);
	border: 1px solid var(--gsa-border);
	font-size: .85rem;
	font-weight: 600;
}

.gsa-chip svg {
	width: 15px;
	height: 15px;
}

.gsa-brand-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border-radius: 999px;
	background: rgba(255,255,255,.06);
	border: 1px solid var(--gsa-border);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	width: fit-content;
	box-shadow: var(--gsa-shadow-sm);
	margin-bottom: 16px;
}

.gsa-brand-title,
.gsa-card-title {
	margin: 0;
	font-size: clamp(1.55rem, 2.6vw, 2.35rem);
	line-height: 1.16;
	font-weight: 800;
	color: var(--gsa-primary);
	position: relative;
	z-index: 1;
}

.gsa-card-title {
	font-size: clamp(1.35rem, 2.1vw, 1.8rem);
	margin-bottom: 10px;
}

.gsa-card-subtitle,
.gsa-brand-text,
.gsa-meta-text {
	color: var(--gsa-text-soft);
	font-size: 0.98rem;
	line-height: 1.72;
	margin: 0 0 18px;
	position: relative;
	z-index: 1;
}

/* Segmented control — one pill container, active tab is a raised white pill. */
.gsa-tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 5px;
	background: var(--gsa-surface-muted);
	border: 1px solid var(--gsa-border);
	border-radius: 999px;
	margin-bottom: 22px;
	position: relative;
	z-index: 1;
	width: fit-content;
	max-width: 100%;
}

.gsa-tab {
	padding: 9px 18px;
	border-radius: 999px;
	border: 0;
	color: var(--gsa-text-soft);
	font-weight: 600;
	text-decoration: none;
	background: transparent;
	transition: .2s ease;
	white-space: nowrap;
}

.gsa-tab:hover,
.gsa-tab:focus-visible {
	color: var(--gsa-accent-strong);
	outline: none;
}

.gsa-tab.is-active {
	background: var(--gsa-surface);
	color: var(--gsa-accent-strong);
	box-shadow: var(--gsa-shadow-sm);
}

.gsa-alert {
	position: relative;
	z-index: 1;
	padding: 14px 16px;
	border-radius: var(--gsa-radius-sm);
	margin-bottom: 18px;
	border: 1px solid transparent;
	font-size: .95rem;
	line-height: 1.6;
}

.gsa-alert--success {
	background: rgba(34,197,94,.10);
	border-color: rgba(34,197,94,.35);
	color: var(--gsa-ok-text);
	font-weight: 600;
}

.gsa-alert--error {
	background: rgba(220,38,38,.08);
	border-color: rgba(220,38,38,.35);
	color: var(--gsa-error-text);
	font-weight: 600;
}

.gsa-alert--info {
	background: rgba(59,130,246,.10);
	border-color: rgba(96,165,250,.35);
	color: var(--gsa-info-text);
	font-weight: 600;
}

.gsa-form {
	display: grid;
	gap: 16px;
	position: relative;
	z-index: 1;
}

.gsa-form--inline {
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
}

.gsa-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.gsa-grid--security {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
	align-items: start;
}

.gsa-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--gsa-primary);
	font-size: 0.95rem;
}

.gsa-input,
.gsa-wrap input[type="text"],
.gsa-wrap input[type="email"],
.gsa-wrap input[type="password"],
.gsa-wrap input[type="url"] {
	width: 100%;
	min-height: 52px;
	border-radius: 14px;
	border: 1px solid var(--gsa-border);
	background: var(--gsa-surface-muted);
	color: var(--gsa-text);
	padding: 0 16px;
	box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
	transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.gsa-input:hover,
.gsa-wrap input:hover {
	border-color: color-mix(in srgb, var(--gsa-accent) 35%, var(--gsa-border));
}

.gsa-wrap input::placeholder {
	color: var(--gsa-text-soft);
	opacity: .75;
}

.gsa-input:focus,
.gsa-wrap input:focus {
	outline: none;
	background: var(--gsa-surface);
	/* rgba lines = fallback; color-mix lines follow the theme-adaptive accent */
	border-color: rgba(96,165,250,.42);
	box-shadow: 0 0 0 4px rgba(59,130,246,.15);
	border-color: var(--gsa-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--gsa-accent) 18%, transparent);
}

/* Field wrapper with a leading icon — icon tints to the accent on focus. */
.gsa-field {
	position: relative;
}

.gsa-field-icon {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	color: var(--gsa-text-soft);
	pointer-events: none;
	transition: color .2s ease;
	z-index: 1;
}

.gsa-field-icon svg {
	width: 17px;
	height: 17px;
}

.gsa-field .gsa-input {
	padding-left: 44px;
}

.gsa-field:focus-within .gsa-field-icon {
	color: var(--gsa-accent);
}

/* One-time code inputs get a distinct, digital look (spacing modest so all six
   digits always stay visible — a wide letter-spacing pushed digits out of view
   on narrow/zoomed screens). */
.gsa-wrap input[inputmode="numeric"] {
	letter-spacing: .22em;
	text-align: center;
	font-weight: 700;
	font-size: 1.2rem;
	text-indent: .22em; /* balances the trailing letter-spacing when centred */
}

/* Keep autofilled fields on our palette (no browser yellow). */
.gsa-wrap input:-webkit-autofill,
.gsa-wrap input:-webkit-autofill:hover,
.gsa-wrap input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 1000px var(--gsa-surface-muted) inset;
	-webkit-text-fill-color: var(--gsa-text);
	caret-color: var(--gsa-text);
	transition: background-color 99999s ease-out;
}

.gsa-password-field {
	position: relative;
}

.gsa-password-toggle {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	border: 0;
	background: transparent;
	color: var(--gsa-accent-strong);
	font-weight: 700;
	padding: 8px 10px;
	border-radius: 10px;
}

.gsa-password-toggle:hover,
.gsa-password-toggle:focus-visible {
	background: var(--gsa-surface-muted);
	outline: none;
}

.gsa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 20px;
	border-radius: 14px;
	border: 1px solid transparent;
	font-weight: 700;
	font-size: 1.01rem;
	letter-spacing: .01em;
	text-decoration: none;
	cursor: pointer;
	transition: .2s ease;
}

.gsa-btn--primary {
	background: linear-gradient(180deg, var(--gsa-accent-strong), var(--gsa-accent));
	color: #fff;
	/* rgba line = fallback; color-mix follows the theme-adaptive accent */
	box-shadow: 0 12px 28px rgba(59,130,246,.28);
	box-shadow: 0 12px 28px color-mix(in srgb, var(--gsa-accent) 30%, transparent);
}

.gsa-btn--primary::after {
	content: "\2192";
	font-size: 1.02em;
	line-height: 1;
	transition: transform .2s ease;
}

.gsa-btn--primary:hover,
.gsa-btn--primary:focus-visible {
	filter: brightness(1.06);
	transform: translateY(-1px);
	outline: none;
}

.gsa-btn--primary:hover::after,
.gsa-btn--primary:focus-visible::after {
	transform: translateX(3px);
}

.gsa-btn--ghost {
	background: var(--gsa-surface-muted);
	border-color: var(--gsa-border);
	color: var(--gsa-primary);
}

.gsa-btn--ghost:hover,
.gsa-btn--ghost:focus-visible {
	background: var(--gsa-border);
	outline: none;
}

.gsa-btn--danger {
	background: rgba(220,38,38,.08);
	border-color: rgba(220,38,38,.30);
	color: var(--gsa-danger);
}

.gsa-btn--danger:hover,
.gsa-btn--danger:focus-visible {
	background: rgba(220,38,38,.14);
	outline: none;
}

.gsa-inline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}

.gsa-inline a {
	font-weight: 600;
}

.gsa-inline--badges {
	justify-content: flex-start;
	margin-top: 16px;
}

.gsa-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--gsa-text-soft);
}

.gsa-check input {
	width: 18px;
	height: 18px;
	accent-color: var(--gsa-accent);
}

.gsa-divider {
	display: flex;
	align-items: center;
	gap: 14px;
	color: var(--gsa-text-soft);
	font-size: .9rem;
	margin: 18px 0 4px;
}

.gsa-divider::before,
.gsa-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--gsa-border);
}

.gsa-step-list {
	display: grid;
	gap: 10px;
	margin-bottom: 18px;
}

.gsa-step {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var(--gsa-radius-sm);
	border: 1px solid var(--gsa-border);
	background: var(--gsa-surface-muted);
	color: var(--gsa-text-soft);
}

.gsa-step.is-current {
	border-color: rgba(96,165,250,.32);
	background: rgba(59,130,246,.10);
	color: var(--gsa-primary);
}

.gsa-step.is-complete {
	border-color: rgba(34,197,94,.25);
	background: rgba(34,197,94,.09);
	color: var(--gsa-ok-text);
}

.gsa-step__dot {
	width: 12px;
	height: 12px;
	border-radius: 999px;
	background: currentColor;
	opacity: .9;
}

.gsa-step__label {
	font-weight: 600;
}

.gsa-status {
	display: inline-flex;
	align-items: center;
	padding: 8px 12px;
	border-radius: 999px;
	font-size: .86rem;
	font-weight: 700;
	border: 1px solid var(--gsa-border);
	background: var(--gsa-surface-muted);
}

.gsa-status.is-success {
	background: rgba(34,197,94,.12);
	border-color: rgba(34,197,94,.24);
	color: var(--gsa-ok-text);
}

.gsa-status.is-warning {
	background: rgba(245,158,11,.12);
	border-color: rgba(245,158,11,.24);
	color: var(--gsa-warn-text);
}

.gsa-status.is-muted {
	color: var(--gsa-text-soft);
}

.gsa-detail-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 12px 0;
	border-bottom: 1px solid var(--gsa-border);
	color: var(--gsa-text-soft);
}

.gsa-detail-row:last-child {
	border-bottom: 0;
}

.gsa-detail-row strong,
.gsa-detail-row code {
	color: var(--gsa-primary);
	text-align: right;
}

.gsa-break {
	word-break: break-word;
	overflow-wrap: anywhere;
	max-width: 62%;
}

.gsa-steps-list {
	margin: 0 0 18px 18px;
	color: var(--gsa-text-soft);
	line-height: 1.8;
}

.gsa-wrap a {
	color: var(--gsa-accent-strong);
	text-decoration: none;
}

.gsa-wrap a:hover,
.gsa-wrap a:focus-visible {
	color: var(--gsa-primary);
	outline: none;
}

@media (max-width: 1100px) {
	.gsa-shell,
	.gsa-grid--security {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.gsa-wrap {
		width: min(calc(100% - 16px), 100%);
		margin: 20px auto;
	}
	/* On phones the form comes first — hide the decorative brand panel so the
	   very first thing a visitor sees is the sign-in card. Exception: when the
	   panel carries the step-by-step guide (Recovery/Reset/Verify) it stays. */
	.gsa-brand-card {
		display: none;
	}
	.gsa-brand-card:has(.gsa-guide) {
		display: flex;
	}
	.gsa-card {
		padding: 20px 16px;
		border-radius: 22px;
	}
	.gsa-grid,
	.gsa-form--inline {
		grid-template-columns: 1fr;
	}
	.gsa-inline {
		align-items: flex-start;
	}
	.gsa-brand-title,
	.gsa-card-title {
		font-size: 1.5rem;
	}
	.gsa-detail-row {
		flex-direction: column;
	}
	.gsa-detail-row strong,
	.gsa-detail-row code,
	.gsa-break {
		max-width: 100%;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gsa-wrap *,
	.gsa-wrap *::before,
	.gsa-wrap *::after {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}
