/**
 * The customer account area.
 *
 * Written with logical properties (padding-inline, margin-inline, inset-inline,
 * border-inline) rather than left/right throughout, so the Arabic build mirrors
 * itself from `dir="rtl"` alone and no rule here needs an RTL twin.
 *
 * The visual idea is a sheet of paper on the café's cream, not a dashboard.
 * There are no stat tiles: every number here belongs to a sentence, and a
 * customer with one order does not need a grid of cards to be told so.
 */

.grv-acct {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--grv-cream);
	color: var(--grv-ink);
}

/* ------------------------------------------------------------------- bar */

.grv-acct-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	max-width: var(--grv-max);
	margin-inline: auto;
	padding: 18px var(--grv-gutter);
}

.grv-acct-logo img {
	display: block;
	height: 34px;
	width: auto;
}

.grv-acct-bar-side {
	display: flex;
	align-items: center;
	gap: 8px;
}

.grv-acct-order,
.grv-acct-signout {
	padding: 9px 18px;
	border-radius: 100px;
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.grv-acct-order {
	background: var(--grv-ink);
	color: var(--grv-cream);
}

.grv-acct-order:hover {
	background: #16130e;
}

.grv-acct-signout {
	background: transparent;
	border: 1px solid rgba(110, 99, 71, 0.32);
	color: var(--grv-muted);
}

.grv-acct-signout:hover {
	border-color: var(--grv-clay);
	color: var(--grv-clay);
}

/* ------------------------------------------------------------ sign-in gate */

.grv-acct-gate {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(24px, 6vw, 64px) var(--grv-gutter) 80px;
}

.grv-acct-gate-card {
	width: 100%;
	max-width: 440px;
	background: var(--grv-card);
	border: 1px solid rgba(110, 99, 71, 0.14);
	border-radius: 20px;
	padding: clamp(28px, 5vw, 44px);
	box-shadow: 0 34px 60px -44px rgba(60, 52, 38, 0.55);
}

.grv-acct-gate-title {
	font-family: var(--grv-serif);
	font-weight: 600;
	font-size: clamp(28px, 4.4vw, 38px);
	line-height: 1.12;
	margin: 10px 0 10px;
}

/* The ways across: create, forgot, back. Links, not more buttons. */
.grv-acct-gate-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 18px;
	margin: 16px 0 0;
}

.grv-acct-gate-alt {
	padding: 4px 0;
	background: none;
	border: 0;
	font: inherit;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--grv-soft);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* Under a field, before any error. Quiet, and it never moves the button. */
.grv-acct-field-hint {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--grv-soft);
}

.grv-acct-gate-alt:hover,
.grv-acct-gate-alt:focus-visible {
	color: var(--grv-ink);
}

.grv-acct-alert {
	margin: 0 0 20px;
	padding: 12px 14px;
	border-radius: 12px;
	background: rgba(190, 115, 80, 0.1);
	border: 1px solid rgba(190, 115, 80, 0.3);
	color: #8a4b2c;
	font-size: 14px;
	line-height: 1.5;
}

/* ------------------------------------------------------------------ forms */

.grv-acct-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--grv-muted);
	margin-bottom: 7px;
}

.grv-acct-input,
.grv-acct-textarea {
	display: block;
	width: 100%;
	padding: 13px 15px;
	background: #fff;
	color: var(--grv-ink);
	/* Constant border width across every state: moving it shifts the layout. */
	border: 1px solid rgba(110, 99, 71, 0.34);
	border-radius: 12px;
	font-size: 16px; /* 16px or iOS zooms the page on focus. */
	line-height: 1.4;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.grv-acct-textarea {
	min-height: 132px;
	resize: vertical;
	font-family: inherit;
}

.grv-acct-input::placeholder,
.grv-acct-textarea::placeholder {
	color: var(--grv-faint);
}

.grv-acct-input:hover,
.grv-acct-textarea:hover {
	border-color: rgba(110, 99, 71, 0.55);
}

.grv-acct-input:focus-visible,
.grv-acct-textarea:focus-visible {
	outline: none;
	border-color: var(--grv-clay);
	box-shadow: 0 0 0 3px rgba(190, 115, 80, 0.22);
}

.grv-acct-input:disabled,
.grv-acct-textarea:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	background: rgba(245, 240, 231, 0.7);
}

.grv-acct-input.is-error {
	border-color: #b4472a;
}

/* Reserved so an error message appears without pushing the button down. */
.grv-acct-field-note {
	min-height: 20px;
	margin: 7px 0 0;
	font-size: 13.5px;
	line-height: 1.45;
	color: #a8452a;
}

.grv-acct-field-note:empty {
	margin: 0;
}

.grv-acct-submit {
	width: 100%;
	margin-top: 14px;
}

.grv-acct-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--grv-body);
	cursor: pointer;
}

.grv-acct-check input {
	inline-size: 18px;
	block-size: 18px;
	margin: 2px 0 0;
	accent-color: var(--grv-clay);
	flex: 0 0 auto;
}

/* ---------------------------------------------------------- link sent state */

.grv-acct-sent-title {
	font-family: var(--grv-serif);
	font-weight: 600;
	font-size: 26px;
	margin: 0 0 8px;
}

.grv-acct-sent-body {
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--grv-body);
	margin: 0 0 12px;
}


/* --------------------------------------------------------------- signed in */

.grv-acct-main {
	flex: 1;
	width: 100%;
	max-width: var(--grv-max);
	margin-inline: auto;
	padding: clamp(14px, 3vw, 34px) var(--grv-gutter) 90px;
}

.grv-acct-head {
	margin-bottom: clamp(24px, 4vw, 40px);
}

.grv-acct-title {
	font-family: var(--grv-serif);
	font-weight: 600;
	font-size: clamp(32px, 5vw, 50px);
	line-height: 1.08;
	margin: 8px 0 4px;
}

.grv-acct-sub {
	font-size: 15px;
	color: var(--grv-muted);
	margin: 0;
}

.grv-acct-layout {
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	gap: clamp(24px, 4vw, 52px);
	align-items: start;
}

/* ------------------------------------------------------------------- rail */

.grv-acct-rail {
	display: flex;
	flex-direction: column;
	gap: 2px;
	position: sticky;
	top: 24px;
}

.grv-acct-rail-link {
	position: relative;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	color: var(--grv-muted);
	transition: background 0.2s, color 0.2s;
}

.grv-acct-rail-link:hover {
	background: rgba(110, 99, 71, 0.07);
	color: var(--grv-ink);
}

.grv-acct-rail-link:focus-visible {
	outline: 2px solid var(--grv-clay);
	outline-offset: 2px;
}

.grv-acct-rail-link.is-on {
	background: var(--grv-ink);
	color: var(--grv-on-dark);
	font-weight: 600;
}

.grv-acct-rail-link.is-on:hover {
	background: var(--grv-ink);
	color: var(--grv-on-dark);
}

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

.grv-acct-panel {
	min-height: 260px;
}

.grv-acct-loading {
	padding: 40px 0;
	color: var(--grv-soft);
	font-size: 15px;
}

.grv-acct-card {
	background: var(--grv-card);
	border: 1px solid rgba(110, 99, 71, 0.14);
	border-radius: 18px;
	padding: clamp(20px, 3vw, 30px);
}

.grv-acct-card + .grv-acct-card {
	margin-top: 16px;
}

.grv-acct-card-title {
	font-family: var(--grv-serif);
	font-weight: 600;
	font-size: 24px;
	line-height: 1.2;
	margin: 0 0 4px;
}

.grv-acct-card-note {
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--grv-body);
	margin: 0 0 18px;
}

.grv-acct-card-note:last-child {
	margin-bottom: 0;
}

/* The one big number a page is about: balance, orders. Set in the
   serif at display size so it reads as a statement, not a metric. */
.grv-acct-figure {
	font-family: var(--grv-serif);
	font-weight: 600;
	font-size: clamp(40px, 7vw, 62px);
	line-height: 1;
	/* Cormorant defaults to old-style figures, which set a 2 and a 0 at
	   different heights and render "210.00" as something closer to "2 I 0.00".
	   Lovely in a paragraph, wrong on a balance. */
	font-variant-numeric: lining-nums tabular-nums;
	font-feature-settings: "lnum" 1, "tnum" 1;
	margin: 6px 0 2px;
}

.grv-acct-figure-unit {
	font-size: 0.42em;
	font-family: var(--grv-sans);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--grv-soft);
	margin-inline-end: 0.3em;
	vertical-align: 0.42em;
}

/* ------------------------------------------------------------------ orders */

.grv-acct-order-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	border-top: 1px solid rgba(110, 99, 71, 0.14);
}

.grv-acct-order-row:first-child {
	border-top: none;
	padding-top: 0;
}

.grv-acct-order-main {
	min-width: 0;
}

.grv-acct-order-num {
	font-weight: 600;
	font-size: 15.5px;
	font-variant-numeric: tabular-nums;
}

.grv-acct-order-items {
	font-size: 14px;
	line-height: 1.5;
	color: var(--grv-muted);
	margin: 3px 0 0;
}

.grv-acct-order-when {
	font-size: 13px;
	color: var(--grv-soft);
	margin: 4px 0 0;
}

.grv-acct-order-side {
	text-align: end;
	flex: 0 0 auto;
}

.grv-acct-order-total {
	font-weight: 600;
	font-size: 15.5px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* -------------------------------------------------------------- the stages

   An order moves through four states, and the customer's real question is
   "should I leave the house yet?". So the stages are shown as a track with a
   filled portion rather than as a status word: the distance left to travel is
   the answer, and it is legible without reading. */

.grv-acct-track {
	display: flex;
	align-items: flex-start;
	gap: 0;
	margin: 18px 0 0;
}

.grv-acct-stage {
	flex: 1 1 0;
	min-width: 0;
	position: relative;
	padding-top: 22px;
	text-align: center;
	font-size: 12.5px;
	line-height: 1.35;
	color: var(--grv-faint);
}

/* The rail behind the dots, drawn per-segment so the ends stay square. */
.grv-acct-stage::before {
	content: "";
	position: absolute;
	inset-block-start: 6px;
	inset-inline-start: 0;
	inline-size: 100%;
	block-size: 2px;
	background: rgba(110, 99, 71, 0.2);
}

.grv-acct-stage:first-child::before {
	inset-inline-start: 50%;
	inline-size: 50%;
}

.grv-acct-stage:last-child::before {
	inline-size: 50%;
}

.grv-acct-stage::after {
	content: "";
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: calc(50% - 7px);
	inline-size: 14px;
	block-size: 14px;
	border-radius: 50%;
	background: var(--grv-cream);
	border: 2px solid rgba(110, 99, 71, 0.3);
}

.grv-acct-stage.is-done {
	color: var(--grv-muted);
}

.grv-acct-stage.is-done::before {
	background: var(--grv-leaf);
}

.grv-acct-stage.is-done::after {
	background: var(--grv-leaf);
	border-color: var(--grv-leaf);
}

.grv-acct-stage.is-now {
	color: var(--grv-ink);
	font-weight: 600;
}

.grv-acct-stage.is-now::after {
	background: var(--grv-clay);
	border-color: var(--grv-clay);
	box-shadow: 0 0 0 4px rgba(190, 115, 80, 0.22);
}

/* ------------------------------------------------------------------ badges */

.grv-acct-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.grv-acct-badge-live {
	background: rgba(94, 124, 78, 0.16);
	color: #3f5836;
}

.grv-acct-badge-done {
	background: rgba(110, 99, 71, 0.14);
	color: var(--grv-muted);
}

.grv-acct-badge-off {
	background: rgba(180, 71, 42, 0.13);
	color: #933d24;
}

/* ------------------------------------------------------------------- empty */

.grv-acct-empty {
	padding: 34px 0 8px;
	text-align: center;
}

.grv-acct-empty-title {
	font-family: var(--grv-serif);
	font-size: 22px;
	font-weight: 600;
	margin: 0 0 6px;
}

.grv-acct-empty-note {
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--grv-muted);
	margin: 0 auto 18px;
	max-width: 40ch;
}

/* ------------------------------------------------------------------- misc */

.grv-acct-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 13px 0;
	border-top: 1px solid rgba(110, 99, 71, 0.14);
	font-size: 15px;
}

.grv-acct-row:first-of-type {
	border-top: none;
}

.grv-acct-row-label {
	color: var(--grv-muted);
}

.grv-acct-row-value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	text-align: end;
}

.grv-acct-field {
	margin-bottom: 16px;
}

.grv-acct-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.grv-acct-note {
	margin: 14px 0 0;
	padding: 11px 14px;
	border-radius: 11px;
	background: rgba(94, 124, 78, 0.13);
	color: #3d5434;
	font-size: 14px;
	line-height: 1.5;
}

.grv-acct-err {
	margin: 14px 0 0;
	padding: 11px 14px;
	border-radius: 11px;
	background: rgba(180, 71, 42, 0.1);
	color: #933d24;
	font-size: 14px;
	line-height: 1.5;
}

/* ------------------------------------------------------------------- foot */

.grv-acct-foot {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 22px var(--grv-gutter) 34px;
	font-size: 13.5px;
	color: var(--grv-soft);
}

.grv-acct-foot a:hover {
	color: var(--grv-clay);
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 800px) {
	.grv-acct-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	/* The rail becomes a scrolling strip. It scrolls inside itself so the page
	   body never gains a horizontal scrollbar. */
	.grv-acct-rail {
		position: static;
		flex-direction: row;
		gap: 6px;
		overflow-x: auto;
		scrollbar-width: none;
		padding-bottom: 4px;
		margin-inline: calc(var(--grv-gutter) * -1);
		padding-inline: var(--grv-gutter);
	}

	.grv-acct-rail::-webkit-scrollbar {
		display: none;
	}

	.grv-acct-rail-link {
		flex: 0 0 auto;
		white-space: nowrap;
		background: rgba(110, 99, 71, 0.07);
	}

	.grv-acct-stage {
		font-size: 11.5px;
	}
}

@media (max-width: 460px) {
	.grv-acct-order-row {
		flex-direction: column;
		gap: 6px;
	}

	.grv-acct-order-side {
		text-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.grv-acct * {
		transition-duration: 0.01ms !important;
	}
}
