/*
 * Sign in, sign up and the store setup wizard.
 *
 * These three screens are the only place a first-time user meets WizPOS, so
 * they share one visual language: a brand panel on the left and a focused card
 * on the right. Nothing here should resemble a WordPress screen.
 */

:root {
	--wz-ink: #14181f;
	--wz-ink-soft: #5b6472;
	--wz-line: #e4e7ec;
	--wz-surface: #ffffff;
	--wz-canvas: #f6f7f9;
	--wz-brand: #0f5132;
	--wz-brand-bright: #16a34a;
	--wz-danger: #d92d20;
	--wz-radius: 14px;
}

* {
	box-sizing: border-box;
}

body.wz-auth {
	margin: 0;
	min-height: 100vh;
	/* Dynamic viewport height where it exists: a phone's 100vh includes the URL bar that is not
	   there, and a screen sized against it always scrolls by the height of that bar. */
	min-height: 100dvh;
	background: var(--wz-canvas);
	color: var(--wz-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.wz-auth-shell {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	min-height: 100vh;
	min-height: 100dvh;
}

/*
 * ONE COLUMN WHEN THERE IS NO BRAND PANEL.
 *
 * The panel is hidden on the role chooser and on each device's own sign in (see app-login.php).
 * Without this the hidden half stayed reserved by the grid, so the card rendered against the left
 * edge with an empty column beside it instead of sitting in the middle.
 */
.wz-auth-shell.wz-auth-solo {
	grid-template-columns: minmax(0, 1fr);
}

/* ---------------- brand panel ---------------- */

.wz-auth-aside {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 48px;
	color: #fff;
	background:
		radial-gradient(1200px 600px at 10% 0%, #16a34a33, transparent 60%),
		linear-gradient(160deg, #0f5132 0%, #0b3a24 55%, #07271a 100%);
}

.wz-auth-aside::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(#ffffff14 1px, transparent 1px);
	background-size: 22px 22px;
	opacity: 0.5;
	pointer-events: none;
}

.wz-auth-aside > * {
	position: relative;
	z-index: 1;
}

.wz-brand-lockup {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.wz-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 11px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.22);
	font-size: 1.05rem;
}

.wz-auth-pitch h2 {
	font-size: clamp(1.6rem, 2.4vw, 2.15rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 0 0 14px;
}

.wz-auth-pitch p {
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.98rem;
	line-height: 1.6;
	margin: 0;
	max-width: 42ch;
}

.wz-auth-points {
	list-style: none;
	padding: 0;
	margin: 26px 0 0;
	display: grid;
	gap: 12px;
}

.wz-auth-points li {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	color: rgba(255, 255, 255, 0.86);
	font-size: 0.92rem;
}

.wz-auth-points i {
	margin-top: 2px;
	color: #4ade80;
}

.wz-auth-foot {
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.8rem;
}

.wz-auth-foot a {
	color: rgba(255, 255, 255, 0.75);
	text-decoration: none;
}

.wz-auth-foot a:hover {
	color: #fff;
}

/* ---------------- form side ---------------- */

.wz-auth-main {
	display: flex;
	align-items: center;
	justify-content: center;
	/*
	 * THE GUTTER SHRINKS ON A SHORT SCREEN.
	 *
	 * It was a flat 40px top and bottom, which is 80px of a 716px tablet spent on air -- enough to
	 * push the sign-in cards 42px past the fold, so the last card sat half under the edge and the
	 * page scrolled when there was nothing to scroll to. Measured on the Pixel C: docH 758 against
	 * a 716px viewport. A fluid gutter keeps the airy look on a tall desktop and gives a landscape
	 * tablet the room instead.
	 */
	padding: clamp(14px, 3vh, 40px) clamp(14px, 2.5vw, 24px);
}

.wz-card {
	width: 100%;
	max-width: 460px;
	background: var(--wz-surface);
	border: 1px solid var(--wz-line);
	border-radius: var(--wz-radius);
	padding: clamp(16px, 2.6vh, 34px) clamp(18px, 2.4vw, 34px);
	box-shadow: 0 18px 40px -24px rgba(16, 24, 40, 0.28);
}

.wz-card-wide {
	max-width: 620px;
}

.wz-card h1 {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 6px;
}

.wz-card .wz-sub {
	color: var(--wz-ink-soft);
	font-size: 0.92rem;
	margin: 0 0 clamp(12px, 2vh, 24px);
}

.wz-label {
	display: block;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wz-ink-soft);
	margin-bottom: 7px;
}

.wz-field {
	margin-bottom: 18px;
}

.wz-input {
	width: 100%;
	padding: 12px 14px;
	font-size: 0.95rem;
	color: var(--wz-ink);
	background: #fff;
	border: 1px solid var(--wz-line);
	border-radius: 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wz-input:focus {
	outline: none;
	border-color: var(--wz-brand-bright);
	box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.wz-input-pin {
	text-align: center;
	font-size: 1.5rem;
	letter-spacing: 0.55em;
	text-indent: 0.55em;
	font-weight: 700;
}

.wz-hint {
	font-size: 0.8rem;
	color: var(--wz-ink-soft);
	margin-top: 6px;
}

.wz-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	padding: 13px 18px;
	font-size: 0.95rem;
	font-weight: 700;
	color: #fff;
	background: var(--wz-brand);
	border: 1px solid var(--wz-brand);
	border-radius: 10px;
	cursor: pointer;
	transition: transform 0.12s ease, background 0.15s ease;
}

.wz-btn:hover:not(:disabled) {
	background: #0b3a24;
}

.wz-btn:active:not(:disabled) {
	transform: scale(0.99);
}

.wz-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wz-btn-ghost {
	background: #fff;
	color: var(--wz-ink);
	border-color: var(--wz-line);
}

.wz-btn-ghost:hover:not(:disabled) {
	background: #f3f4f6;
}

.wz-btn-link {
	background: none;
	border: none;
	color: var(--wz-brand);
	font-weight: 600;
	font-size: 0.88rem;
	/*
	 * This class carries "Forgot password?", which is the only route back into
	 * an account from this screen. With `padding: 0` it measured 113x21, under
	 * the 24x24 Target Size (Minimum) in WCAG 2.2, from which it is not exempt:
	 * it is a <button>, not a link sitting inside a sentence. Missing it on a
	 * phone is the difference between recovering an account and ringing support.
	 *
	 * inline-flex + min-height claims a thumb-sized box while letting the word
	 * stay right-aligned in .wz-forgot; the negative right margin cancels the
	 * horizontal padding so the text still ends flush with the card edge.
	 */
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 10px;
	margin-right: -10px;
	cursor: pointer;
	text-decoration: none;
}

.wz-btn-link:hover {
	text-decoration: underline;
}

/* role tabs */

.wz-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	padding: 5px;
	background: var(--wz-canvas);
	border-radius: 11px;
	margin-bottom: 24px;
}

.wz-tab {
	padding: 10px 12px;
	font-size: 0.86rem;
	font-weight: 600;
	color: var(--wz-ink-soft);
	background: none;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wz-tab.is-active {
	background: #fff;
	color: var(--wz-ink);
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

/* alerts */

.wz-alert {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 0.88rem;
	line-height: 1.5;
	margin-bottom: 18px;
}

.wz-alert-error {
	background: #fef3f2;
	border: 1px solid #fecdca;
	color: #912018;
}

.wz-alert-info {
	background: #eff8ff;
	border: 1px solid #b2ddff;
	color: #175cd3;
}

.wz-alert-success {
	background: #ecfdf3;
	border: 1px solid #abefc6;
	color: #067647;
}

.wz-alert i {
	margin-top: 2px;
}

.wz-switch {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--wz-line);
	text-align: center;
	font-size: 0.9rem;
	color: var(--wz-ink-soft);
}

.wz-switch a {
	color: var(--wz-brand);
	font-weight: 700;
	text-decoration: none;
}

.wz-switch a:hover {
	text-decoration: underline;
}

.wz-forgot {
	display: flex;
	justify-content: flex-end;
	margin: -8px 0 16px;
}

/*
 * THE RESET PANEL TAKES THE CARD WHILE IT IS OPEN.
 *
 * Opening "Forgot password?" used to add the reset field and its own button underneath the
 * password field, the "keep me signed in" box and a green "Sign in" button -- a screen offering
 * two different actions, where the loud one was the wrong one. The form carries
 * data-mode="forgot" while the panel is open (set in auth-app.js) and these five things step
 * aside: the sign-in email and password, the link that opened the panel, the checkbox, and the
 * sign-in button. What is left is one question and one thing to press.
 *
 * Done in CSS rather than with inline styles so the form cannot be left in a half-hidden state
 * by a script that threw somewhere in the middle.
 */
#wzFormOwner[data-mode="forgot"] .wz-forgot,
#wzFormOwner[data-mode="forgot"] .wz-check,
#wzFormOwner[data-mode="forgot"] #wzEmailField,
#wzFormOwner[data-mode="forgot"] #wzPasswordField,
#wzFormOwner[data-mode="forgot"] #wzSubmitOwner {
	display: none;
}

/* The way out, centred under the one button the panel offers. */
.wz-forgot-back {
	display: block;
	margin: 14px auto 0;
	text-align: center;
}

/*
 * KEEP ME SIGNED IN.
 *
 * A checkbox the size of a thumb, because on the phones this form is used from a 13px
 * tick is a thing people miss. The label is the whole row, so the text is a tap target
 * as well -- and the tick stays the browser's own, so a screen reader announces it as a
 * checkbox rather than as a painted box.
 */
.wz-check {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	font-size: 0.9rem;
	color: var(--wz-ink-soft);
	cursor: pointer;
	user-select: none;
}

.wz-check input {
	width: 20px;
	height: 20px;
	margin: 0;
	flex: 0 0 auto;
	accent-color: var(--wz-primary, #0d4a2e);
	cursor: pointer;
}

.wz-legal {
	margin-top: 18px;
	font-size: 0.78rem;
	color: var(--wz-ink-soft);
	text-align: center;
	line-height: 1.55;
}

/* ---------------- onboarding wizard ---------------- */

.wz-steps {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 26px;
	flex-wrap: wrap;
}

.wz-step {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--wz-ink-soft);
}

.wz-step-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 1px solid var(--wz-line);
	background: #fff;
	font-size: 0.74rem;
	font-weight: 700;
}

.wz-step.is-active .wz-step-dot {
	background: var(--wz-brand);
	border-color: var(--wz-brand);
	color: #fff;
}

.wz-step.is-done .wz-step-dot {
	background: #ecfdf3;
	border-color: #abefc6;
	color: #067647;
}

.wz-step.is-active {
	color: var(--wz-ink);
}

.wz-step-sep {
	width: 18px;
	height: 1px;
	background: var(--wz-line);
}

.wz-panel[hidden] {
	display: none;
}

.wz-choice {
	display: grid;
	gap: 12px;
}

/*
 * A card you can type into.
 *
 * The head is a real button -- it is how a keyboard chooses this card -- but it must read as the
 * card's title rather than as a control inside it, so it carries none of the button chrome.
 */
.wz-choice-card-head {
background: none;
border: 0;
padding: 0;
font: inherit;
color: inherit;
cursor: pointer;
text-align: left;
}

.wz-choice-input {
margin-top: 10px;
}

/*
 * A card that opens into cards.
 *
 * The closed face is the chosen shop type's own card. The list hangs under it rather than pushing the
 * content down, so Continue stays exactly where it was while the list is open. It is capped to a share
 * of the viewport as well as a fixed height, so a short screen -- a phone on its side, a small laptop --
 * does not get a menu taller than the space it is in.
 */
.wz-cardselect {
position: relative;
}

.wz-cardselect > .wz-choice-card {
align-items: center;
justify-content: space-between;
}

.wz-cardselect-face {
display: block;
min-width: 0;
}

.wz-cardselect-caret {
color: var(--wz-ink-soft);
font-size: 0.85rem;
flex-shrink: 0;
margin-left: 10px;
transition: transform 0.15s ease;
}

.wz-cardselect.is-open .wz-cardselect-caret {
transform: rotate(180deg);
}

.wz-cardselect-list {
position: absolute;
top: calc(100% + 6px);
left: 0;
right: 0;
z-index: 30;
display: grid;
gap: 10px;
max-height: min(340px, 45vh);
overflow-y: auto;
padding: 10px;
background: var(--wz-surface);
border: 1px solid var(--wz-line);
border-radius: 14px;
box-shadow: 0 26px 50px -22px rgba(16, 24, 40, 0.36);
scrollbar-width: thin;
}

/*
 * Not enough room underneath, so the list opens upwards. The height is set inline by the script from the
 * room that actually exists. See placeCategoryList() -- on a phone the card sits just above the fold and
 * a list opening downwards was entirely invisible.
 */
.wz-cardselect.is-flip .wz-cardselect-list {
top: auto;
bottom: calc(100% + 6px);
}

/* The card styling sets display, so the attribute has to be honoured explicitly. */
.wz-cardselect-list[hidden] {
display: none;
}

.wz-cardselect-list .wz-choice-card {
background: #fff;
}

.wz-cardselect-list::-webkit-scrollbar {
width: 10px;
}

.wz-cardselect-list::-webkit-scrollbar-thumb {
background: rgba(15, 23, 42, 0.22);
border-radius: 6px;
border: 3px solid transparent;
background-clip: content-box;
}

.wz-choice-card {
	display: flex;
	gap: 13px;
	align-items: flex-start;
	padding: 15px;
	border: 1px solid var(--wz-line);
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	text-align: left;
	width: 100%;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wz-choice-card:hover {
	border-color: var(--wz-brand-bright);
}

.wz-choice-card.is-selected {
	border-color: var(--wz-brand-bright);
	box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.13);
}

.wz-choice-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--wz-canvas);
	color: var(--wz-brand);
	flex-shrink: 0;
}

.wz-choice-title {
	font-weight: 700;
	font-size: 0.93rem;
	margin-bottom: 3px;
}

.wz-choice-desc {
	font-size: 0.83rem;
	color: var(--wz-ink-soft);
	line-height: 1.5;
}

.wz-logo-preview {
	display: flex;
	align-items: center;
	gap: 14px;
}

.wz-logo-box {
	width: 74px;
	height: 74px;
	border-radius: 12px;
	border: 1px dashed var(--wz-line);
	background: var(--wz-canvas);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
	color: #b9bfc9;
}

.wz-logo-box img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.wz-staff-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--wz-line);
	border-radius: 11px;
	background: #fff;
	margin-bottom: 10px;
}

.wz-staff-meta {
	font-size: 0.82rem;
	color: var(--wz-ink-soft);
}

.wz-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	background: var(--wz-canvas);
	color: var(--wz-ink-soft);
}

.wz-badge-kitchen {
	background: #fffaeb;
	color: #b54708;
}

.wz-badge-manager {
	background: #eff8ff;
	color: #175cd3;
}

.wz-badge-owner {
	background: #ecfdf3;
	color: #067647;
}

.wz-badge-salesman {
	background: #f4f3ff;
	color: #5925dc;
}

.wz-actions {
	display: flex;
	gap: 10px;
	margin-top: 24px;
}

.wz-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.wz-empty {
	padding: 22px;
	text-align: center;
	color: var(--wz-ink-soft);
	font-size: 0.88rem;
	border: 1px dashed var(--wz-line);
	border-radius: 11px;
}

/* ---------------- responsive ---------------- */

/*
 * A TABLET SIGNS IN ON ONE SCREEN.
 *
 * The role cards were one per row inside a 460px card. On the Pixel C that list alone is taller
 * than the display once the headline, the tabs and the "not this device" row are added: measured
 * 758px of document in a 716px viewport, and the sixth card (Salesman) would have added another
 * ~86px. Two columns use width the tablet already has instead of asking for height it does not.
 */
@media (min-width: 720px) {
	.wz-card {
		max-width: 760px;
	}

	.wz-roles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}
}

/*
 * A SHORT SCREEN GETS NO BRAND PANEL.
 *
 * Below ~640px of height the picture column costs more than it is worth: stacked above the form
 * (which is what happens under 900px wide) it is the reason the page scrolls. The form is the
 * page.
 */
@media (max-height: 640px) {
	.wz-auth-aside {
		display: none;
	}

	.wz-auth-shell {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 900px) {
	.wz-auth-shell {
		grid-template-columns: minmax(0, 1fr);
	}

	.wz-auth-aside {
		padding: 30px 24px;
		gap: 22px;
	}

	.wz-auth-points {
		display: none;
	}

	.wz-auth-pitch h2 {
		font-size: 1.45rem;
	}

	.wz-auth-main {
		padding: 28px 18px 44px;
	}

	.wz-card {
		padding: 24px;
	}

	.wz-grid-2 {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 420px) {
	.wz-tabs {
		grid-template-columns: 1fr;
	}

	.wz-logo-preview {
		flex-direction: column;
		align-items: flex-start;
	}

	/* Five step markers do not fit beside their labels on a small phone, so the
	   dots carry the progress on their own. */
	.wz-steps {
		gap: 6px;
	}

	.wz-step {
		font-size: 0;
		gap: 0;
	}

	.wz-step-dot {
		font-size: 0.72rem;
		width: 26px;
		height: 26px;
	}

	.wz-step-sep {
		width: 10px;
	}
}

/*
 * The store's own address, with its copy button, on the wizard's last screen.
 *
 * The two dashboards show the same thing using Bootstrap classes, because they are not styled
 * by this file at all. Here the button is narrowed to sit beside the field rather than taking
 * the full width `.wz-btn` normally does.
 */
.wz-copyrow {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.wz-copyrow .wz-input {
	flex: 1 1 auto;
	min-width: 0;
}

.wz-copyrow .wz-btn {
	flex: 0 0 auto;
	width: auto;
	padding-left: 18px;
	padding-right: 18px;
}
/*
    The figures on a storefront category card.

    They sit UNDER the description rather than beside it, because they are the part a merchant reads
    first: what will really load, and how much of it has a photograph. The line stays at 15px or above
    per the product's own reading rule, and the number is the only bold thing in it. Both figures are
    computed by StorefrontService::preview(), so the card cannot promise a menu the seed will not write.
*/
.wz-cat-figures {
        display: block;
        margin-top: 6px;
        font-size: 15px;
        line-height: 1.55;
        color: #334155;
}

.wz-cat-figures strong {
        font-size: 16px;
        color: #0f172a;
}

.wz-choice-card.is-selected .wz-cat-figures {
        color: #0f172a;
}