/**
 * Passwordless section on the WooCommerce account login form.
 * Scope: .ieg-pw* only. Never restyles the password form itself.
 */

.ieg-pw {
	margin-top: 4px;
}

.ieg-pw__divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 22px 0 16px;
	color: #6b6b6b;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	white-space: nowrap;
}

.ieg-pw__divider::before,
.ieg-pw__divider::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: currentColor;
	opacity: 0.25;
	min-width: 24px;
}

.ieg-pw__magic {
	width: 100%;
}

.ieg-pw__hint {
	margin: 10px 0 0;
	font-size: 13px;
	color: #6b6b6b;
	line-height: 1.5;
}

/* Status / notices (aria-live region above the login card). */
.ieg-pw-status:empty {
	display: none;
}

.ieg-pw-notice {
	padding: 12px 14px;
	border-radius: 6px;
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.5;
}

.ieg-pw-notice--success {
	background: #eef8f0;
	border: 1px solid #bfe3c6;
	color: #1e5b2a;
}

.ieg-pw-notice--error {
	background: #fdf0f0;
	border: 1px solid #f0c4c4;
	color: #8a1f1f;
}

.ieg-pw-notice--info {
	background: #f0f4fa;
	border: 1px solid #c9d8ee;
	color: #1f3f6e;
}

/* Fallback-code entry. */
.ieg-pw__code {
	margin-top: 14px;
}

.ieg-pw__code-toggle {
	background: none;
	border: none;
	padding: 0;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font-size: 13px;
}

.ieg-pw__code-fields {
	display: flex;
	gap: 10px;
	margin-top: 10px;
	flex-wrap: wrap;
}

.ieg-pw__code-fields input {
	flex: 1 1 150px;
	min-width: 0;
	letter-spacing: 0.18em;
	font-family: SFMono-Regular, Menlo, Consolas, monospace;
}

.ieg-pw__code-submit {
	flex: 0 0 auto;
}

/* Passkeys. */
.ieg-pw__passkey {
	width: 100%;
	margin-bottom: 12px;
}

.ieg-pw-security {
	max-width: 640px;
}

.ieg-pw-keys {
	list-style: none;
	margin: 16px 0;
	padding: 0;
}

.ieg-pw-keys__row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ieg-pw-keys__label {
	font-weight: 600;
	flex: 1 1 160px;
	min-width: 0;
	overflow-wrap: anywhere;
}

.ieg-pw-keys__badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 8px;
	border-radius: 999px;
	background: #eef4ee;
	border: 1px solid #bfe3c6;
	color: #1e5b2a;
	vertical-align: middle;
}

.ieg-pw-keys__meta {
	color: #6b6b6b;
	font-size: 13px;
	flex: 0 1 auto;
}

.ieg-pw-keys__actions {
	flex: 0 0 auto;
	margin-left: auto;
}

.ieg-pw-keys__rename,
.ieg-pw-keys__remove {
	background: none;
	border: none;
	padding: 0 0 0 12px;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font-size: 13px;
}

.ieg-pw-keys__remove {
	color: #8a1f1f;
}

.ieg-pw-add {
	margin-top: 20px;
}

.ieg-pw-add label {
	display: block;
	font-size: 13px;
	margin-bottom: 6px;
}

.ieg-pw-add__row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.ieg-pw-add__row input {
	flex: 1 1 200px;
	min-width: 0;
}

.ieg-pw-add__btn {
	flex: 0 0 auto;
}

/* Accessibility. */
.ieg-pw__magic:focus-visible,
.ieg-pw__code-toggle:focus-visible,
.ieg-pw__code-submit:focus-visible,
.ieg-pw__code-fields input:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.ieg-pw *,
	.ieg-pw-status *,
	.ieg-login-toggle__btn {
		transition: none !important;
		animation: none !important;
	}
}

/* Sign-in mode toggle (segmented control). Rendered hidden; JS reveals it. */
.ieg-login-toggle:not([hidden]) {
	display: flex;
	background: rgba(13, 13, 15, 0.04);
	padding: 4px;
	border-radius: var(--ieg-radius-sm, 0.35rem);
	margin-bottom: 24px;
	border: 1px solid var(--ieg-line, rgba(13, 13, 15, 0.14));
}

.ieg-login-toggle__btn {
	flex: 1 1 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	background: none;
	border: none;
	padding: 8px 12px;
	font-size: 14px;
	font-weight: 500;
	color: var(--ieg-steel, #6f7178);
	cursor: pointer;
	border-radius: calc(var(--ieg-radius-sm, 0.35rem) - 2px);
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ieg-login-toggle__btn:hover {
	color: var(--ieg-ink, #0d0d0f);
}

.ieg-login-toggle__btn[aria-pressed="true"] {
	background: var(--ieg-white, #ffffff);
	color: var(--ieg-ink, #0d0d0f);
	box-shadow: 0 2px 8px rgba(13, 13, 15, 0.08);
	font-weight: 600;
}

.ieg-login-toggle__btn .ieg-btn-icon {
	width: 16px;
	height: 16px;
}

/* Mode visibility (classes added by login.js once the toggle is wired).
   Password recovery is intentionally NOT hidden — it stays reachable in
   both modes. */
.ieg-login-mode--passwordless .ieg-login-row--password,
.ieg-login-mode--passwordless .ieg-login-row--submit {
	display: none !important;
}

.ieg-login-mode--password .ieg-pw {
	display: none !important;
}

.ieg-login-enhanced .ieg-pw__divider {
	display: none !important;
}

/* Button icon + label layout. Scoped to .ieg-pw for specificity instead of
   !important, and gated on :not([hidden]) so the passkey button's hidden
   attribute keeps it invisible until login.js confirms browser support. */
.ieg-pw .ieg-pw__passkey:not([hidden]),
.ieg-pw .ieg-pw__magic {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-weight: 600;
}

.ieg-btn-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.ieg-pw .ieg-pw__magic {
	border: 1px solid var(--ieg-line, rgba(13, 13, 15, 0.14));
	background: transparent;
	color: var(--ieg-ink, #0d0d0f);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ieg-pw .ieg-pw__magic:hover:not([disabled]) {
	background: var(--ieg-ink, #0d0d0f);
	color: var(--ieg-white, #ffffff);
	border-color: var(--ieg-ink, #0d0d0f);
}
