/*!
 * Vibe Pass - Public customer pages (registration, login, dashboard)
 * Version: 1.0.0
 *
 * Layout only. Colours, spacing and every other value come from tokens.css,
 * so these pages follow Light and Dark Mode automatically. No raw colours
 * are allowed in this file - see the rule at the top of tokens.css.
 */

/* --- Auth pages (register / login / forgot password) ------------------- */

.vp-auth-wrap {
	display: flex;
	justify-content: center;
	padding: var(--vp-space-6) var(--vp-space-4);
	min-height: 60vh;
}

.vp-auth-card {
	width: 100%;
	max-width: 480px;
}

.vp-auth-title {
	margin: 0 0 var(--vp-space-2);
	font-size: var(--vp-text-2xl);
	font-weight: var(--vp-weight-bold);
	line-height: var(--vp-line-tight);
	color: var(--vp-text);
}

.vp-auth-subtitle {
	margin: 0 0 var(--vp-space-5);
	font-size: var(--vp-text-sm);
	color: var(--vp-text-subtle);
}

.vp-auth-switch {
	margin: var(--vp-space-5) 0 0;
	font-size: var(--vp-text-sm);
	color: var(--vp-text-subtle);
	text-align: center;
}

.vp-auth-switch a {
	color: var(--vp-brand);
	font-weight: var(--vp-weight-semibold);
	text-decoration: none;
	margin-left: var(--vp-space-1);
}

.vp-auth-switch a:hover {
	text-decoration: underline;
}

.vp-auth-form .vp-btn {
	width: 100%;
}

@media screen and (max-width: 480px) {
	.vp-auth-wrap {
		padding: var(--vp-space-4) var(--vp-space-3);
	}

	.vp-auth-card {
		padding: var(--vp-space-4);
	}
}

/* --- Logged-in dashboard shell ------------------------------------------ */

.vp-dashboard {
	max-width: 860px;
	margin: 0 auto;
	padding: var(--vp-space-5) var(--vp-space-4);
}

.vp-dashboard__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--vp-space-3);
	margin-bottom: var(--vp-space-4);
}

.vp-dashboard__header .vp-auth-title {
	margin-bottom: var(--vp-space-1);
}

.vp-dashboard__header .vp-auth-subtitle {
	margin: 0;
}

.vp-dashboard__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--vp-space-2);
	margin-bottom: var(--vp-space-4);
}

.vp-dashboard__tab {
	display: inline-block;
	padding: 8px 14px;
	border-radius: var(--vp-radius-pill);
	background: var(--vp-surface);
	border: 1px solid var(--vp-border);
	color: var(--vp-text-muted);
	font-size: var(--vp-text-sm);
	font-weight: var(--vp-weight-medium);
	text-decoration: none;
	white-space: nowrap;
}

.vp-dashboard__tab:hover {
	background: var(--vp-surface-2);
	color: var(--vp-text);
}

.vp-dashboard__tab--active {
	background: var(--vp-brand);
	border-color: var(--vp-brand);
	color: var(--vp-brand-contrast);
}

.vp-empty-state {
	padding: var(--vp-space-3) 0;
}

.vp-auth-logout {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	border-radius: var(--vp-radius);
	border: 1px solid var(--vp-border-strong);
	color: var(--vp-text);
	font-size: var(--vp-text-sm);
	font-weight: var(--vp-weight-semibold);
	text-decoration: none;
	white-space: nowrap;
}

.vp-auth-logout:hover {
	background: var(--vp-surface-2);
}

@media screen and (max-width: 480px) {
	.vp-dashboard {
		padding: var(--vp-space-4) var(--vp-space-3);
	}
}

/* --- Wallet tab (My Vibe Pass & QR) -------------------------------------
 * .vp-wallet itself (the coloured membership card) lives in tokens.css, so
 * it matches the admin Design Preview exactly. Everything below is layout
 * only for the rest of the tab. */

.vp-wallet-card {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: var(--vp-space-5);
	align-items: start;
}

.vp-wallet-card__info {
	display: flex;
	flex-direction: column;
	gap: var(--vp-space-4);
}

.vp-wallet-card__details {
	display: flex;
	flex-direction: column;
	gap: var(--vp-space-2);
}

.vp-wallet-card__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--vp-space-3);
	padding: var(--vp-space-2) 0;
	border-bottom: 1px solid var(--vp-border);
	font-size: var(--vp-text-sm);
}

.vp-wallet-card__row:last-child {
	border-bottom: none;
}

.vp-wallet-card__label {
	color: var(--vp-text-subtle);
}

.vp-wallet-card__value {
	color: var(--vp-text);
	font-weight: var(--vp-weight-medium);
	text-align: right;
}

.vp-wallet-card__qr {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--vp-space-3);
	padding: var(--vp-space-4);
	background: var(--vp-surface-2);
	border: 1px solid var(--vp-border);
	border-radius: var(--vp-radius-lg);
	text-align: center;
}

.vp-wallet-card__qr-image {
	width: 100%;
	max-width: 220px;
	line-height: 0;
}

.vp-wallet-card__qr-image svg {
	width: 100%;
	height: auto;
	border-radius: var(--vp-radius-sm);
}

@media screen and (max-width: 640px) {
	.vp-wallet-card {
		grid-template-columns: 1fr;
	}
}

/* --- Business directory & profile (Phase 5) ----------------------------- */

.vp-directory {
	max-width: 1080px;
	margin: 0 auto;
	padding: var(--vp-space-5) var(--vp-space-4);
}

.vp-directory__intro {
	margin-bottom: var(--vp-space-5);
}

.vp-directory__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--vp-space-3);
	padding: var(--vp-space-4);
	background: var(--vp-surface);
	border: 1px solid var(--vp-border);
	border-radius: var(--vp-radius-lg);
	margin-bottom: var(--vp-space-5);
}

.vp-directory__filters .vp-field {
	margin-bottom: 0;
	flex: 1 1 180px;
}

.vp-directory__filters select,
.vp-directory__filters input {
	max-width: none;
}

.vp-directory__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--vp-space-4);
}

.vp-biz-card {
	display: flex;
	flex-direction: column;
	background: var(--vp-surface);
	border: 1px solid var(--vp-border);
	border-radius: var(--vp-radius-lg);
	overflow: hidden;
	text-decoration: none;
	color: var(--vp-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vp-biz-card:hover {
	border-color: var(--vp-border-strong);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.vp-biz-card__cover {
	position: relative;
	height: 110px;
	background: var(--vp-surface-3) center / cover no-repeat;
}

.vp-biz-card__logo {
	position: absolute;
	left: var(--vp-space-3);
	bottom: -18px;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: var(--vp-radius);
	border: 2px solid var(--vp-surface);
	background: var(--vp-surface);
}

.vp-biz-card__body {
	padding: var(--vp-space-4) var(--vp-space-3) var(--vp-space-3);
	padding-top: calc(var(--vp-space-4) + 12px);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.vp-biz-card__name {
	font-size: var(--vp-text-base);
	font-weight: var(--vp-weight-semibold);
	color: var(--vp-text);
}

.vp-biz-card__badge {
	margin-inline-start: 6px;
	vertical-align: middle;
}

.vp-biz-card__category {
	font-size: var(--vp-text-sm);
	color: var(--vp-text-subtle);
}

.vp-biz-card__location {
	font-size: var(--vp-text-xs);
	color: var(--vp-text-subtle);
	margin-bottom: 4px;
}

.vp-directory__pagination {
	display: flex;
	flex-wrap: wrap;
	gap: var(--vp-space-2);
	margin-top: var(--vp-space-5);
}

.vp-biz-profile__back {
	font-size: var(--vp-text-sm);
	color: var(--vp-text-subtle);
	text-decoration: none;
}

.vp-biz-profile__back:hover {
	color: var(--vp-text);
}

.vp-biz-profile__hero {
	position: relative;
	height: 220px;
	border-radius: var(--vp-radius-lg);
	background: var(--vp-surface-3) center / cover no-repeat;
	margin-bottom: 44px;
}

.vp-biz-profile__logo {
	position: absolute;
	left: var(--vp-space-4);
	bottom: -32px;
	width: 84px;
	height: 84px;
	object-fit: cover;
	border-radius: var(--vp-radius-lg);
	border: 3px solid var(--vp-surface);
	background: var(--vp-surface);
}

.vp-biz-profile__header {
	margin-bottom: var(--vp-space-5);
}

.vp-biz-profile__name {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--vp-space-2);
	margin: 0 0 var(--vp-space-2);
	font-size: var(--vp-text-2xl);
	font-weight: var(--vp-weight-bold);
	color: var(--vp-text);
}

.vp-biz-profile__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--vp-space-3);
	font-size: var(--vp-text-sm);
	color: var(--vp-text-subtle);
}

.vp-biz-profile__grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: var(--vp-space-5);
	align-items: start;
}

.vp-biz-profile__section {
	margin-bottom: var(--vp-space-4);
}

.vp-biz-profile__description {
	white-space: pre-line;
	color: var(--vp-text-muted);
	line-height: var(--vp-line-normal, 1.6);
}

.vp-biz-profile__hours {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--vp-text-sm);
}

.vp-biz-profile__hours th,
.vp-biz-profile__hours td {
	text-align: left;
	padding: 6px 0;
	border-bottom: 1px solid var(--vp-border);
	font-weight: var(--vp-weight-normal);
	color: var(--vp-text-muted);
}

.vp-biz-profile__hours tr:last-child th,
.vp-biz-profile__hours tr:last-child td {
	border-bottom: none;
}

.vp-biz-profile__hours-row--today th,
.vp-biz-profile__hours-row--today td {
	color: var(--vp-text);
	font-weight: var(--vp-weight-semibold);
}

.vp-biz-profile__contact p {
	margin: 0 0 var(--vp-space-2);
	font-size: var(--vp-text-sm);
	color: var(--vp-text-muted);
}

.vp-biz-profile__contact a {
	color: var(--vp-brand);
	text-decoration: none;
}

.vp-biz-profile__contact a:hover {
	text-decoration: underline;
}

@media screen and (max-width: 720px) {
	.vp-biz-profile__grid {
		grid-template-columns: 1fr;
	}
}

/* --- QR Scanner & Transactions (Phase 7) -------------------------------- */

.vp-scanner {
	display: flex;
	flex-direction: column;
	gap: var(--vp-space-4);
}

.vp-scanner__camera {
	position: relative;
	max-width: 420px;
	margin: 0 auto;
	overflow: hidden;
	border-radius: var(--vp-radius-lg);
	background: #000;
}

.vp-scanner__video {
	display: block;
	width: 100%;
	height: auto;
}

.vp-scanner__frame {
	position: absolute;
	inset: 12%;
	border: 3px solid var(--vp-brand);
	border-radius: var(--vp-radius-md);
	pointer-events: none;
	box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
}

.vp-scanner__camera-actions {
	display: flex;
	align-items: center;
	gap: var(--vp-space-3);
	flex-wrap: wrap;
}

.vp-scanner-summary,
.vp-scanner-receipt {
	display: flex;
	flex-direction: column;
	gap: var(--vp-space-1);
	margin-bottom: var(--vp-space-4);
	max-width: 480px;
}

.vp-scanner-summary__row,
.vp-scanner-receipt__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--vp-space-3);
	padding: var(--vp-space-2) 0;
	border-bottom: 1px solid var(--vp-border);
	font-size: var(--vp-text-sm);
}

.vp-scanner-summary__row:last-child,
.vp-scanner-receipt__row:last-child {
	border-bottom: none;
}

.vp-scanner-receipt__row--total {
	font-size: var(--vp-text-base);
	padding-top: var(--vp-space-3);
	border-top: 1px solid var(--vp-border-strong);
}

.vp-scanner-round {
	max-width: 480px;
	margin-bottom: var(--vp-space-4);
}

.vp-scanner-round__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--vp-space-2);
	margin: var(--vp-space-3) 0;
}

.vp-scanner-round input[type="number"] {
	max-width: 200px;
	font-weight: var(--vp-weight-bold);
}

.vp-scanner-lock {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--vp-space-4);
	background: rgba(0, 0, 0, 0.6);
}

.vp-scanner-lock__box {
	width: 100%;
	max-width: 360px;
}

@media print {
	.vp-dashboard__header,
	.vp-dashboard__tabs,
	.vp-scanner-lock,
	.vp-form-actions {
		display: none !important;
	}
}

/* Phase 8: the "Request cancellation" mini-form on the business Transaction
 * History tab. A plain <details>/<summary> disclosure needs no JavaScript to
 * open and close, matching this plugin's front-end script generally staying
 * out of the way unless a feature (like the scanner) genuinely needs it. */

.vp-inline-form summary {
	cursor: pointer;
	list-style: none;
}

.vp-inline-form summary::-webkit-details-marker {
	display: none;
}

.vp-inline-form[open] summary {
	margin-bottom: var(--vp-space-2);
}

/* --- Renewal tab plan cards (Phase 10, Vibe Pass Commerce) --------------
 * Rendered by the companion Commerce plugin on the customer dashboard's
 * Renewal tab (first purchase, renewal, upgrade, free renewal). Styled
 * here in Core so it shares the same design tokens as the rest of the
 * dashboard rather than shipping its own separate stylesheet. */

.vp-plan-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--vp-space-4);
	margin: var(--vp-space-3) 0 var(--vp-space-5);
}

.vp-plan-card {
	display: flex;
	flex-direction: column;
	gap: var(--vp-space-2);
}

.vp-plan-card__title {
	font-weight: var(--vp-weight-medium);
	color: var(--vp-text);
}

.vp-plan-card__price {
	font-size: var(--vp-text-xl);
	font-weight: var(--vp-weight-bold);
	color: var(--vp-brand);
}

.vp-plan-card .vp-btn {
	width: 100%;
	text-align: center;
}

/* Spend Target progress bar (Phase 9), shown inside the Wallet tab and the
   admin Loyalty Targets screen's per-row progress cell. */
.vp-target-progress {
	margin-top: var(--vp-space-4);
	padding-top: var(--vp-space-4);
	border-top: 1px solid var(--vp-border);
}
