/**
 * The sign-in screen.
 *
 * Two halves: a plum panel that says whose shop this is, and a cream pane holding the form. On a
 * phone the panel collapses to a band across the top — it is identification, not decoration, and
 * a distributor standing in their own shop should reach the first field without scrolling.
 *
 * Every colour is a theme token with a literal fallback behind it, so the screen is still the
 * brand's when the theme is switched off and still legible when it is missing.
 */

.hf-portal {
	margin: 0;
	background: var(--cream, #FBF7F1);
	color: var(--ink, #191512);
}

.portal {
	min-block-size: 100svh;
	display: grid;
	grid-template-columns: 1fr;
	align-items: stretch;
}

@media (min-width: 60rem) {
	.portal {
		grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
	}
}

/* ── the panel ──────────────────────────────────────────────────────────── */

.portal__brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .55rem;
	padding: clamp(1.6rem, 5vw, 3rem);
	background: var(--plum, #3C1A57);
	color: var(--cream, #FBF7F1);
}

.portal__mark {
	display: block;
	margin-block-end: auto;
	font-family: var(--display, system-ui), sans-serif;
	font-weight: 800;
	font-size: 1.5rem;
	line-height: 1.1;
	color: inherit;
	text-decoration: none;
}

.portal__mark img {
	display: block;
	inline-size: clamp(7rem, 22vw, 11rem);
	block-size: auto;
}

/* The two lines of copy are the panel's whole argument, so they sit at the foot of it on a wide
   screen — read last, after the mark, on the way to the form. */
.portal__line {
	margin: clamp(1.6rem, 5vw, 3rem) 0 0;
	max-inline-size: 22ch;
	font-family: var(--display, system-ui), sans-serif;
	font-weight: 800;
	font-size: clamp(1.15rem, 3.4vw, 1.5rem);
	line-height: 1.25;
	letter-spacing: -.02em;
}

.portal__sub {
	margin: 0;
	max-inline-size: 34ch;
	font-size: .88rem;
	line-height: 1.7;
	opacity: .72;
}

.portal__back {
	margin-block-start: 1.4rem;
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	font-size: .8rem;
	color: inherit;
	text-decoration: none;
	opacity: .72;
	transition: opacity .2s;
}

.portal__back:hover {
	opacity: 1;
}

/* The arrow is drawn pointing left. In an RTL column "back" is to the right, and an arrow is a
   picture rather than a character with a direction, so it is flipped by hand. */
[dir="rtl"] .portal__back span {
	display: inline-block;
	transform: scaleX(-1);
}

/* Stacked, the panel is a band rather than a column, and its only job is to say whose shop this
   is before the first field. The copy stays — a distributor who has never signed in here needs
   it — but the air between the mark and the line is what a phone cannot afford. */
@media (max-width: 59.99rem) {
	.portal__brand {
		gap: .4rem;
	}

	.portal__mark img {
		inline-size: 6.5rem;
	}

	.portal__line {
		margin-block-start: 1rem;
	}

	.portal__back {
		margin-block-start: .9rem;
	}
}

/* ── the pane ───────────────────────────────────────────────────────────── */

.portal__pane {
	display: grid;
	place-items: center;
	padding: clamp(1.6rem, 6vw, 4rem) clamp(1.1rem, 5vw, 3rem);
}

.portal__card {
	inline-size: 100%;
	max-inline-size: 26rem;
}

.portal__title {
	margin: 0 0 .3rem;
	font-family: var(--display, system-ui), sans-serif;
	font-weight: 800;
	font-size: clamp(1.5rem, 5vw, 2rem);
	line-height: 1.1;
	letter-spacing: -.03em;
	color: var(--plum, #3C1A57);
}

.portal__hint {
	margin: 0 0 1.8rem;
	font-size: .9rem;
	line-height: 1.7;
	color: var(--muted, #584C55);
}

/* ── messages ───────────────────────────────────────────────────────────── */

.portal__msg {
	margin: 0 0 1.4rem;
	padding: .8rem 1rem;
	border-radius: .8rem;
	font-size: .88rem;
	line-height: 1.6;
	border-inline-start: 3px solid currentColor;
}

.portal__msg--bad {
	background: rgb(196 33 43 / .08);
	color: var(--field, #C4212B);
}

.portal__msg--good {
	background: rgb(60 26 87 / .07);
	color: var(--plum, #3C1A57);
}

/* ── the form ───────────────────────────────────────────────────────────── */

.portal__row {
	margin: 0 0 1.15rem;
}

.portal__row label {
	display: block;
	margin-block-end: .35rem;
	font-size: .85rem;
	font-weight: 500;
}

.portal__form input[type="tel"],
.portal__form input[type="text"],
.portal__form input[type="password"] {
	inline-size: 100%;
	padding: .8rem 1rem;
	border: 1.5px solid rgb(60 26 87 / .18);
	border-radius: .8rem;
	background: #fff;
	color: var(--ink, #191512);
	font: inherit;
	font-size: 1rem;
	transition: border-color .2s, box-shadow .2s;
}

.portal__form input[type="tel"]:focus,
.portal__form input[type="text"]:focus,
.portal__form input[type="password"]:focus {
	outline: none;
	border-color: var(--plum, #3C1A57);
	box-shadow: 0 0 0 3px rgb(60 26 87 / .12);
}

.portal__form input:focus-visible {
	outline: none;
}

.portal__row--split {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-block-end: 1.6rem;
}

.portal__check {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	margin: 0;
	font-size: .85rem;
	font-weight: 400;
	cursor: pointer;
}

.portal__check input {
	inline-size: 1.05rem;
	block-size: 1.05rem;
	accent-color: var(--plum, #3C1A57);
}

.portal__link {
	font-size: .85rem;
	color: var(--plum, #3C1A57);
	text-decoration: underline;
	text-underline-offset: .2em;
	text-decoration-thickness: 1px;
	text-decoration-color: rgb(60 26 87 / .35);
}

.portal__link:hover {
	text-decoration-color: currentColor;
}

.portal__go {
	display: block;
	inline-size: 100%;
	padding: .95rem 1.4rem;
	border: 0;
	border-radius: 999px;
	background: var(--plum, #3C1A57);
	color: var(--cream, #FBF7F1);
	font-family: var(--display, system-ui), sans-serif;
	font-weight: 800;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color .25s;
}

.portal__go:hover {
	background: var(--ink, #191512);
}

/* The same button drawn as a link, for the dead-end screen where there is nothing to submit. */
.portal__go--link {
	text-align: center;
	text-decoration: none;
}

.portal__foot {
	margin: 1.6rem 0 0;
	font-size: .85rem;
	line-height: 1.7;
	color: var(--muted, #584C55);
}
