/*
 * AS Plus mobile sign-in panel.
 *
 * The same two steps everywhere they appear: the wide panel on the sign-in page, the card inside
 * the dashboard for a visitor who is not signed in, and the compact box inside the QR prompt on the
 * menu. Colours, radius and type come from the theme tokens (--asplus-*), so a rebranded site
 * restyles this with the rest of the theme.
 *
 * Without JavaScript both steps are simply shown one under the other — that is the fallback, not a
 * bug — so the `.js-phone` rule is what hides the inactive step.
 */

.asplus-phone {
	--phone-gold: var(--asplus-accent, #d8ae6a);
	--phone-ink: #1b1a18;
	--phone-red: #e5484d;
	--phone-radius: var(--asplus-radius, 16px);

	display: flex;
	flex-direction: column;
	gap: 14px;
}

.asplus-phone .asplus-icon {
	display: block;
	width: 1.2em;
	height: 1.2em;
	flex: none;
}

.asplus-phone-step {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.js-phone .asplus-phone-step:not(.is-active) {
	display: none;
}

.asplus-phone-step + .asplus-phone-step {
	padding-block-start: 14px;
	border-block-start: 1px solid var(--asplus-border, rgba(245, 242, 238, 0.1));
}

.js-phone .asplus-phone-step + .asplus-phone-step {
	padding-block-start: 14px;
}

/* ------------------------------------------------------------------ words */

.asplus-phone-title {
	margin: 0;
	font-size: 1.18rem;
	font-weight: 700;
	color: var(--asplus-text, #f5f2ee);
}

.asplus-phone-lead {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.7;
	color: var(--asplus-muted, rgba(245, 242, 238, 0.66));
}

.asplus-phone-new {
	display: block;
	color: var(--phone-gold);
}

.asplus-phone-hint {
	margin: 0;
	font-size: 0.78rem;
	line-height: 1.7;
	color: var(--asplus-muted, rgba(245, 242, 238, 0.55));
}

.asplus-phone-test {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 10px 12px;
	border: 1px dashed rgba(216, 174, 106, 0.45);
	border-radius: calc(var(--phone-radius) * 0.6);
	background: rgba(216, 174, 106, 0.08);
	color: var(--phone-gold);
	font-size: 0.78rem;
	line-height: 1.7;
}

/* ------------------------------------------------------------------ fields */

.asplus-phone-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.asplus-phone-label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--asplus-text, #f5f2ee);
}

.asplus-phone-field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding-inline: 12px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--asplus-border, rgba(245, 242, 238, 0.12));
	border-radius: calc(var(--phone-radius) * 0.6);
	color: var(--asplus-muted, rgba(245, 242, 238, 0.5));
	transition: border-color 0.18s ease, background 0.18s ease;
}

.asplus-phone-field:focus-within {
	border-color: var(--phone-gold);
	background: rgba(255, 255, 255, 0.07);
	color: var(--phone-gold);
}

.asplus-phone-field input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 12px 0;
	border: 0;
	background: transparent;
	color: var(--asplus-text, #f5f2ee);
	font: inherit;
	font-size: 1.02rem;
	letter-spacing: 0.06em;
	text-align: start;
}

.asplus-phone-field input:focus {
	outline: none;
}

.asplus-phone-field input::placeholder {
	color: rgba(245, 242, 238, 0.3);
	letter-spacing: 0.04em;
}

.asplus-phone-code {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.35em !important;
}

/* ------------------------------------------------------------------ buttons */

.asplus-phone .asplus-phone-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-block-start: 2px;
	padding: 13px 18px;
	border: 1px solid transparent;
	border-radius: calc(var(--phone-radius) * 0.6);
	background: var(--phone-gold);
	color: var(--phone-ink);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.18s ease, transform 0.18s ease;
}

.asplus-phone .asplus-phone-btn:hover {
	filter: brightness(1.08);
}

.asplus-phone .asplus-phone-btn:active {
	transform: translateY(1px);
}

.asplus-phone .asplus-phone-btn--line {
	background: transparent;
	border-color: var(--asplus-border, rgba(245, 242, 238, 0.18));
	color: var(--asplus-text, #f5f2ee);
}

.asplus-phone form.is-busy .asplus-phone-btn {
	opacity: 0.6;
	pointer-events: none;
}

.asplus-phone-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--phone-gold);
	font: inherit;
	font-size: 0.82rem;
	cursor: pointer;
	text-decoration: none;
}

.asplus-phone-link:hover:not(:disabled) {
	text-decoration: underline;
}

.asplus-phone-link:disabled {
	opacity: 0.5;
	cursor: default;
}

.asplus-phone-link .asplus-icon {
	width: 1em;
	height: 1em;
}

.asplus-phone-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
}

.asplus-phone-resend-form {
	display: contents;
}

.asplus-phone-timer {
	padding: 4px 9px;
	border: 1px solid var(--asplus-border, rgba(245, 242, 238, 0.14));
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--asplus-muted, rgba(245, 242, 238, 0.7));
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.08em;
}

.asplus-phone-timer.is-over {
	border-color: rgba(229, 72, 77, 0.5);
	color: var(--phone-red);
}

.asplus-phone-back {
	margin-inline-start: auto;
}

/* ------------------------------------------------------------------ notice */

.asplus-phone-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 11px 13px;
	border-radius: calc(var(--phone-radius) * 0.55);
	border: 1px solid var(--asplus-border, rgba(245, 242, 238, 0.14));
	background: rgba(255, 255, 255, 0.05);
	color: var(--asplus-text, #f5f2ee);
	font-size: 0.85rem;
	line-height: 1.7;
}

.asplus-phone-notice.is-error {
	border-color: rgba(229, 72, 77, 0.45);
	background: rgba(229, 72, 77, 0.12);
}

.asplus-phone-notice.is-success {
	border-color: rgba(216, 174, 106, 0.5);
	background: rgba(216, 174, 106, 0.12);
}

/* ------------------------------------------------------------------ variants */

.asplus-phone--card {
	padding: 18px;
	border: 1px solid var(--asplus-border, rgba(245, 242, 238, 0.12));
	border-radius: var(--phone-radius);
	background: var(--asplus-surface, #161615);
}

.asplus-phone--modal {
	padding: 0;
}

/* A page on light colours, e.g. a child theme that flipped the tokens. */
.asplus-phone .asplus-phone-field input:invalid {
	box-shadow: none;
}

/* ------------------------------------------------------------------ QR greeting */

.asplus-qr {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

/* JS closes the greeting; the attribute is how it says so, and this box is a flex container. */
.asplus-qr[hidden] {
	display: none !important;
}

.asplus-qr-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 7, 6, 0.74);
	backdrop-filter: blur(3px);
	cursor: pointer;
}

.asplus-qr-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: min(430px, 100%);
	max-height: calc(100vh - 36px);
	overflow-y: auto;
	padding: 22px 20px;
	border: 1px solid var(--asplus-border, rgba(245, 242, 238, 0.14));
	border-radius: calc(var(--asplus-radius, 16px) * 1.1);
	background: var(--asplus-surface, #161615);
	color: var(--asplus-text, #f5f2ee);
	box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55);
}

body.asplus-qr-open {
	overflow: hidden;
}

.asplus-qr-table {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 4px;
	color: var(--asplus-accent, #d8ae6a);
	font-size: 0.78rem;
	letter-spacing: 0.02em;
}

.asplus-qr-table .asplus-icon {
	width: 1.1em;
	height: 1.1em;
}

.asplus-qr-title {
	margin: 0 0 6px;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.5;
}

.asplus-qr-lead {
	margin: 0 0 14px;
	color: var(--asplus-muted, rgba(245, 242, 238, 0.66));
	font-size: 0.85rem;
	line-height: 1.8;
}

.asplus-qr-skip {
	display: block;
	margin-block-start: 16px;
	padding-block-start: 12px;
	border-block-start: 1px solid var(--asplus-border, rgba(245, 242, 238, 0.12));
	color: var(--asplus-muted, rgba(245, 242, 238, 0.65));
	font-size: 0.82rem;
	text-align: center;
	text-decoration: none;
}

.asplus-qr-skip:hover {
	color: var(--asplus-accent, #d8ae6a);
	text-decoration: underline;
}

/* ------------------------------------------------------------------ phones */

@media (max-width: 600px) {
	.asplus-phone--card {
		padding: 16px 14px;
	}

	.asplus-phone-foot {
		gap: 8px 12px;
	}

	.asplus-phone-back {
		margin-inline-start: 0;
	}

	/* On a phone the greeting rises from the bottom edge, where the thumb already is. */
	.asplus-qr {
		align-items: flex-end;
		padding: 0;
	}

	.asplus-qr-dialog {
		width: 100%;
		max-height: 88vh;
		padding: 20px 16px 24px;
		border-inline: 0;
		border-block-end: 0;
		border-radius: 22px 22px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.asplus-phone *,
	.asplus-phone *::before,
	.asplus-phone *::after {
		transition: none !important;
	}
}
