/* Order Generator: three steps in a row. Inherits the theme's font and text
   colour, so it works on light and dark themes. Responsive without media or
   container queries: the steps wrap onto new rows when the card is narrow. */
.og-card {
	--og-accent: #2563eb;
	--og-ok: #15803d;
	--og-err: #b91c1c;
	--og-line: rgba(127, 127, 127, 0.35);
	--og-soft: rgba(127, 127, 127, 0.08);
	--og-badge-bg: #2563eb;
	--og-badge-fg: #ffffff;
	--og-field: #ffffff;
	box-sizing: border-box;
	max-width: 980px;
	margin: 0 auto;
	padding: 18px 20px 20px;
	border: 1px solid var(--og-line);
	border-radius: 14px;
	background: var(--og-soft);
	color: inherit;
	font: inherit;
	line-height: 1.5;
}
.og-card *, .og-card *::before, .og-card *::after { box-sizing: border-box; }
.og-card [hidden] { display: none !important; }

.og-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.og-title { margin: 0; font-size: 1.25em; line-height: 1.3; font-family: inherit; color: inherit; }
.og-pill {
	padding: 2px 10px;
	border-radius: 999px;
	border: 1px solid currentColor;
	font-size: 0.8em;
	font-weight: 600;
	color: var(--og-ok);
	white-space: nowrap;
}
.og-pill.is-empty { color: var(--og-err); }

.og-help {
	position: relative;
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 1px solid var(--og-line);
	color: inherit;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1;
}
.og-help:hover { border-color: currentColor; }
.og-help::after {
	content: attr(data-tip);
	position: absolute;
	right: 0;
	bottom: calc(100% + 8px);
	padding: 6px 10px;
	border-radius: 6px;
	background: #111;
	color: #fff;
	font-size: 13px;
	font-weight: 400;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transform: translateY(4px);
	transition: opacity .15s, transform .15s;
	z-index: 10;
}
.og-help:hover::after, .og-help:focus-visible::after { opacity: 1; transform: none; }

/* Steps */
.og-steps { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.og-steps--3 { max-width: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.og-generator { display: contents; }
.og-step {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 14px;
	border: 1px solid var(--og-line);
	border-radius: 12px;
}
.og-step-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1em; font-weight: 700; line-height: 1.3; font-family: inherit; color: inherit; }
.og-step-title .og-num {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--og-badge-bg);
	color: var(--og-badge-fg);
	font-style: normal;
	font-size: 12px;
	font-weight: 700;
}
/* Steps after the email stay dimmed until a customer is verified with authorizations left. */
.og-card:not(.is-verified) .og-step:not(.og-step-order) { opacity: .5; }

.og-label { display: block; font-weight: 600; margin-bottom: 6px; }
.og-field { position: relative; }
.og-input {
	display: block;
	width: 100%;
	min-height: 46px;
	padding: 10px 42px 10px 12px;
	border: 1px solid var(--og-line);
	border-radius: 8px;
	background: var(--og-field);
	color: inherit;
	font: inherit;
	font-size: 16px; /* 16px+ prevents iOS zoom on focus. */
}
.og-input[aria-invalid="true"] { border-color: var(--og-err); }

.og-card a:focus-visible,
.og-input:focus-visible,
.og-button:focus-visible {
	outline: 3px solid var(--og-accent);
	outline-offset: 2px;
}
.og-input:focus { border-color: var(--og-accent); }

.og-spinner {
	position: absolute;
	right: 14px;
	top: 50%;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	border: 2px solid var(--og-line);
	border-top-color: var(--og-accent);
	border-radius: 50%;
	animation: og-spin .7s linear infinite;
}
@keyframes og-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .og-spinner { animation-duration: 2s; } }

.og-hint { margin: 6px 0 0; font-size: 13px; opacity: .75; }
.og-status { margin: 0; min-height: 1.4em; font-size: 0.92em; }
.og-status:empty { min-height: 0; }
.og-status.is-error { color: var(--og-err); font-weight: 600; }
.og-status.og-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Stats: three small tiles, label above number so they fit a narrow step. */
.og-panel { margin: 0; }
.og-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.og-stats div {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	padding: 6px 8px;
	border: 1px solid var(--og-line);
	border-radius: 8px;
}
.og-stats dt { margin: 0; font-size: 11.5px; font-weight: 600; opacity: .7; }
.og-stats dd { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }

.og-bar { display: flex; gap: 3px; height: 6px; margin-top: 8px; }
.og-seg { flex: 1; border-radius: 3px; background: var(--og-ok); }
.og-seg.is-used { background: var(--og-line); }
.og-progress { position: relative; flex: 1; border-radius: 3px; background: var(--og-line); overflow: hidden; }
.og-progress span { position: absolute; inset: 0 auto 0 0; background: var(--og-ok); border-radius: 3px; }
/* 0 left: warning colour instead of the neutral "used" colour. */
.og-bar.is-empty .og-seg,
.og-bar.is-empty .og-progress { background: var(--og-err); opacity: .55; }

.og-note { margin: 6px 0 0; font-size: 12px; opacity: .8; }

/* Limit notice: one horizontal row under the steps. */
.og-limit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--og-err);
}
.og-limit p { flex: 1 1 260px; margin: 0; }
.og-button {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 8px;
	background: var(--og-accent);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}
.og-button:hover { filter: brightness(1.1); color: #fff; }

@media (max-width: 480px) {
	.og-card { padding: 14px; }
	.og-step { padding: 12px; }
}

/* Fields: always white so they stand out from the card, even if the theme styles inputs. */
.og-card .og-input,
.og-card .og-auth-input { background: var(--og-field) !important; background-color: var(--og-field) !important; color: #1f2937 !important; }

.og-card .og-button,
.og-card .og-button:hover,
.og-card .og-button:focus,
.og-card .og-button:active { background: var(--og-accent) !important; color: #fff !important; text-decoration: none; }
.og-card .og-button:hover { filter: brightness(1.12); }
