/**
 * Awesome Loyalty - customer facing styles (mobile first).
 */

.al-app {
	--al-radius: 18px;
	--al-gap: 16px;
	--al-surface: #ffffff;
	--al-muted: #6b7280;
	--al-border: rgba(17, 24, 39, 0.08);
	--al-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
	box-sizing: border-box;
	max-width: 560px;
	margin: 0 auto;
	padding: 20px 16px 48px;
	font-family: var(--al-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	color: var(--al-text, #111827);
	line-height: 1.5;
}

.al-app *,
.al-app *::before,
.al-app *::after {
	box-sizing: border-box;
}

body.al-standalone {
	margin: 0;
	background:
		var(--al-bg-image, none) center / cover no-repeat,
		linear-gradient(160deg, color-mix(in srgb, var(--al-primary, #4f46e5) 12%, #ffffff), #f6f7fb);
	min-height: 100vh;
	padding-top: env(safe-area-inset-top, 0px);
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Header ------------------------------------------------------------ */

.al-header {
	text-align: center;
	margin-bottom: var(--al-gap);
}

.al-logo {
	max-width: 110px;
	height: auto;
	margin: 0 auto 10px;
	display: block;
	border-radius: 14px;
}

.al-business {
	font-size: 1.45rem;
	margin: 0 0 4px;
	font-weight: 700;
}

.al-branch {
	margin: 0;
	color: var(--al-muted);
	font-size: 0.95rem;
}

.al-banner {
	width: 100%;
	height: auto;
	border-radius: var(--al-radius);
	margin-bottom: var(--al-gap);
	display: block;
}

/* Cards -------------------------------------------------------------- */

.al-card {
	background: var(--al-surface);
	border: 1px solid var(--al-border);
	border-radius: var(--al-radius);
	box-shadow: var(--al-shadow);
	padding: 20px;
	margin-bottom: var(--al-gap);
}

.al-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 10px;
}

.al-subtitle {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--al-muted);
	margin: 18px 0 8px;
}

.al-eyebrow {
	margin: 0;
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--al-muted);
}

.al-muted {
	color: var(--al-muted);
	font-size: 0.92rem;
}

.al-center {
	text-align: center;
}

.al-pill {
	display: inline-block;
	background: color-mix(in srgb, var(--al-primary, #4f46e5) 12%, #ffffff);
	color: var(--al-primary, #4f46e5);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 0.85rem;
	font-weight: 600;
	margin: 0 0 12px;
}

/* Loyalty card ------------------------------------------------------- */

.al-loyalty__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 16px;
}

.al-cycle {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--al-muted);
	white-space: nowrap;
	border: 1px solid var(--al-border);
	border-radius: 999px;
	padding: 4px 10px;
}

.al-stamps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}

.al-stamp {
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	border: 2px dashed color-mix(in srgb, var(--al-primary, #4f46e5) 35%, #ffffff);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	color: #ffffff;
	transition: transform 0.25s ease, background 0.25s ease;
}

.al-stamp.is-filled {
	background: var(--al-primary, #4f46e5);
	border-style: solid;
	border-color: var(--al-primary, #4f46e5);
	transform: scale(1.02);
}

.al-progress {
	height: 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--al-primary, #4f46e5) 12%, #ffffff);
	overflow: hidden;
}

.al-progress__bar {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--al-primary, #4f46e5), var(--al-secondary, #0ea5e9));
	transition: width 0.4s ease;
}

.al-progress__label {
	text-align: center;
	font-weight: 700;
	margin: 10px 0 4px;
}

.al-remaining,
.al-unlocked {
	text-align: center;
	margin: 0 0 14px;
}

.al-unlocked {
	font-weight: 700;
	color: var(--al-primary, #4f46e5);
	font-size: 1.05rem;
}

/* Buttons ------------------------------------------------------------ */

.al-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	padding: 14px 18px;
	border: 0;
	border-radius: 14px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.2s ease, transform 0.1s ease;
}

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

.al-btn:disabled {
	opacity: 0.6;
	cursor: progress;
}

.al-btn--primary {
	background: var(--al-button, #4f46e5);
	color: #ffffff;
}

.al-btn--secondary {
	background: color-mix(in srgb, var(--al-secondary, #0ea5e9) 15%, #ffffff);
	color: var(--al-secondary, #0ea5e9);
}

.al-btn--ghost {
	background: transparent;
	border: 1px solid var(--al-border);
	color: var(--al-text, #111827);
}

.al-btn:hover {
	filter: brightness(0.96);
}

.al-link {
	background: none;
	border: 0;
	color: var(--al-muted);
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.9rem;
	padding: 8px;
}

/* Forms -------------------------------------------------------------- */

.al-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.al-tab {
	flex: 1;
	padding: 10px;
	border-radius: 12px;
	border: 1px solid var(--al-border);
	background: #ffffff;
	font-weight: 600;
	cursor: pointer;
	color: var(--al-muted);
}

.al-tab.is-active {
	background: var(--al-primary, #4f46e5);
	border-color: var(--al-primary, #4f46e5);
	color: #ffffff;
}

.al-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.al-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.al-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--al-muted);
}

.al-field input,
.al-field select,
.al-field textarea {
	width: 100%;
	padding: 13px 14px;
	border: 1px solid var(--al-border);
	border-radius: 12px;
	font-size: 1rem;
	font-family: inherit;
	color: var(--al-text, #111827);
	background: #fbfbfd;
}

.al-field input:focus,
.al-field select:focus,
.al-field textarea:focus {
	outline: 2px solid color-mix(in srgb, var(--al-primary, #4f46e5) 45%, #ffffff);
	outline-offset: 1px;
}

.al-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.88rem;
	color: var(--al-muted);
}

.al-check input {
	margin-top: 3px;
	width: 18px;
	height: 18px;
}

/* Alerts ------------------------------------------------------------- */

.al-alert {
	display: none;
	border-radius: 14px;
	padding: 14px 16px;
	margin-bottom: var(--al-gap);
	font-weight: 600;
}

.al-alert.is-visible {
	display: block;
}

.al-alert.is-success {
	background: #ecfdf5;
	color: #047857;
}

.al-alert.is-error {
	background: #fef2f2;
	color: #b91c1c;
}

.al-alert.is-info {
	background: #eff6ff;
	color: #1d4ed8;
}

.al-notice {
	border-radius: 14px;
	padding: 14px 16px;
}

.al-notice--error {
	background: #fef2f2;
	color: #b91c1c;
}

.al-notice--info {
	background: #eff6ff;
	color: #1d4ed8;
}

/* Rewards ------------------------------------------------------------ */

.al-reward {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px;
	border: 1px solid var(--al-border);
	border-radius: 14px;
	margin-bottom: 10px;
	background: #fbfbfd;
}

.al-reward__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.95rem;
}

.al-reward__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: 700;
	letter-spacing: 0.06em;
	background: var(--al-primary, #4f46e5);
	color: #ffffff;
	border-radius: 10px;
	padding: 8px 10px;
	white-space: nowrap;
}

.al-reward--redeemed .al-reward__code,
.al-reward--expired .al-reward__code,
.al-reward--cancelled .al-reward__code {
	background: #e5e7eb;
	color: #6b7280;
}

.al-expiry {
	font-size: 0.82rem;
	color: #b45309;
}

.al-terms {
	font-size: 0.8rem;
	color: var(--al-muted);
	margin: -4px 0 12px;
}

.al-code-box {
	text-align: center;
	margin: 18px 0;
}

.al-code {
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	padding: 14px 22px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--al-primary, #4f46e5) 10%, #ffffff);
	color: var(--al-primary, #4f46e5);
	border: 1px dashed var(--al-primary, #4f46e5);
}

.al-reward-single__value {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 4px 0 8px;
}

/* Lists -------------------------------------------------------------- */

.al-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.al-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--al-border);
	font-size: 0.95rem;
}

.al-list li:last-child {
	border-bottom: 0;
}

.al-list span {
	color: var(--al-muted);
}

.al-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
}

.al-timeline li {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 2px 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--al-border);
}

.al-timeline li span {
	grid-column: 1;
	font-size: 0.85rem;
}

.al-timeline li em {
	grid-row: 1 / span 2;
	grid-column: 2;
	align-self: center;
	font-style: normal;
	font-weight: 700;
	color: var(--al-primary, #4f46e5);
}

.al-status--available {
	color: #047857;
}

.al-status--redeemed {
	color: var(--al-muted);
}

.al-status--expired,
.al-status--cancelled {
	color: #b91c1c;
}

/* Social ------------------------------------------------------------- */

.al-social__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
}

.al-social__btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px;
	border-radius: 14px;
	border: 1px solid var(--al-border);
	background: #fbfbfd;
	text-decoration: none;
	color: var(--al-text, #111827);
	font-weight: 600;
	min-height: 52px;
}

.al-social__btn:hover {
	background: #f3f4f6;
}

.al-social__icon {
	font-size: 1.2rem;
}

/* Scratch card ------------------------------------------------------- */

.al-scratch__stage {
	position: relative;
	width: 100%;
	max-width: 320px;
	margin: 14px auto;
	border-radius: 16px;
	overflow: hidden;
	background: color-mix(in srgb, var(--al-secondary, #0ea5e9) 12%, #ffffff);
}

.al-scratch__prize {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-align: center;
	padding: 12px;
}

.al-scratch__prize-label {
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--al-primary, #4f46e5);
}

.al-scratch__prize-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.al-scratch__foil {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	touch-action: none;
	cursor: grab;
}

.al-scratch__foil.is-cleared {
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

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

.al-qr-block {
	text-align: center;
}

.al-qr-img {
	width: 220px;
	height: 220px;
	max-width: 100%;
	border-radius: 14px;
	background: #ffffff;
	padding: 10px;
	border: 1px solid var(--al-border);
}

.al-qr-caption {
	color: var(--al-muted);
	font-size: 0.85rem;
}

/* Testimonials -------------------------------------------------------- */

.al-testimonials__grid {
	display: grid;
	gap: 14px;
}

.al-testimonial-item {
	border: 1px solid var(--al-border);
	border-radius: 14px;
	padding: 14px;
	background: #fbfbfd;
}

.al-testimonial-item__photo {
	width: 100%;
	height: auto;
	border-radius: 12px;
	margin-bottom: 10px;
	display: block;
}

.al-stars {
	color: #f59e0b;
	margin: 0 0 6px;
	letter-spacing: 0.08em;
}

.al-testimonial-item__text {
	margin: 0 0 8px;
}

.al-testimonial-item__by {
	display: flex;
	gap: 8px;
	align-items: baseline;
	margin: 0;
	font-size: 0.85rem;
}

/* Staff panel --------------------------------------------------------- */

.al-staff .al-staff__actions {
	display: grid;
	gap: 10px;
	margin-top: 14px;
}

/* Footer -------------------------------------------------------------- */

.al-footer {
	text-align: center;
	padding-top: 6px;
}

.al-legal {
	display: flex;
	gap: 14px;
	justify-content: center;
	font-size: 0.82rem;
}

.al-legal a {
	color: var(--al-muted);
}

@media (min-width: 640px) {
	.al-testimonials__grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.al-app * {
		transition: none !important;
	}
}
