/**
 * The login screen.
 *
 * Measured off the Figma frame "Desktop / Login / Logged Out" (1440x1024):
 * stage #E2F1FB r24, white card 500x760 r28 at x=90, felt panel 759 wide
 * bleeding to the end edge. Every gap inside the card is 20px.
 */

body.is-bare {
	background: var(--navy-900);
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 24px 16px;
	padding-block-start: calc(24px + env(safe-area-inset-top, 0px));
	padding-block-end: calc(24px + env(safe-area-inset-bottom, 0px));
}

.bare-main {
	width: 100%;
}

/* ----------------------------------------------------------------- stage */

.auth {
	/* 681 / 759 of the 1440 frame.
	 *
	 * The frame puts the card on the LEFT and the felt on the RIGHT. That is a
	 * layout decision, not a reading direction, so the grid is laid out LTR —
	 * an RTL grid would place the first column on the right and mirror the whole
	 * design. The text inside each panel goes back to RTL below.
	 */
	direction: ltr;
	display: grid;
	grid-template-columns: 681fr 759fr;
	align-items: center;
	width: min(100%, 1440px);
	min-height: min(1024px, calc(100vh - 48px));
	margin-inline: auto;
	background: var(--page);
	border-radius: 24px;
	box-shadow: 0 40px 90px rgba(3, 12, 33, .45);
	overflow: hidden;
}

.auth__pane,
.auth__stage {
	direction: rtl;
}

.auth__pane {
	display: grid;
	place-items: center;
	padding: 40px 30px;
}

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

.auth-card {
	width: min(100%, 500px);
	padding: 48px;
	background: var(--surface);
	border: 1px solid #DAE1EC;
	border-radius: 28px;
	box-shadow: 0 24px 60px rgba(8, 28, 64, .10);

	/* The design is right-aligned throughout — start, not end. */
	text-align: start;

	display: flex;
	flex-direction: column;
	gap: 20px;
}

.auth-card__eyebrow {
	color: var(--navy-700);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.auth-card__title {
	margin: 0;
	color: var(--navy-900);
	font-size: 40px;
	font-weight: 800;
	line-height: 1.3;
}

.auth-card__lede {
	margin: 0;
	color: #475770;
	font-size: 19px;
	font-weight: 400;
	line-height: 1.55;
}

.auth-card__form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.auth-card .form-error {
	margin: 0;
}

/* ---------------------------------------------------------------- fields */

.auth-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.auth-field label {
	color: var(--navy-800);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

/* Says the rule before the field can break it. */
.auth-field__hint {
	margin: 0;
	color: var(--muted-3);
	font-size: 14px;
	line-height: 1.4;
}

.auth-input {
	position: relative;
	display: block;
}

.auth-input input {
	width: 100%;
	height: 56px;
	/* Room for the icon, which sits on the end side as the design shows.
	 *
	 * Physical rather than logical, because the input and the icon disagree
	 * about which side "end" is. The browser's own stylesheet forces
	 * input[type=tel] to direction: ltr (url and number too, depending on the
	 * engine), so its inline-end became the right — while the icon, a span
	 * that keeps the card's RTL, stayed on the left. Logical padding then
	 * reserved the empty side and the phone number ran under its own icon. */
	padding-right: 16px;
	padding-left: 52px;
	background: var(--surface-2);
	border: 1px solid var(--line-3);
	border-radius: 12px;
	font-family: inherit;
	font-size: 17px;
	font-weight: 400;
	color: var(--ink);
	/* Right for the same reason: on that LTR-flipped tel field "start" is the
	 * left edge, which put the phone number on the opposite side from every
	 * other row. The characters within are still ordered by the browser, so a
	 * "+972" prefix keeps its place. */
	text-align: right;
}

.auth-input input::placeholder {
	color: var(--muted-3);
}

.auth-input input:focus {
	outline: none;
	border-color: var(--navy-700);
	background: var(--surface);
	box-shadow: 0 0 0 3px rgba(10, 42, 97, .12);
}

.auth-input__icon {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: 24px;
	translate: 0 -50%;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: var(--muted-3);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
}

.auth-card__forgot {
	margin: 0;
}

.auth-card__forgot a {
	color: var(--link);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
}

/* --------------------------------------------------------------- buttons */

.auth-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border-radius: 12px;
	font-family: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform .12s ease, background-color .12s ease;
}

.auth-btn:hover {
	text-decoration: none;
	transform: translateY(-1px);
}

.auth-btn--primary {
	height: 58px;
	background: var(--navy-500);
	border: 0;
	color: #fff;
	font-size: 20px;
	box-shadow: 0 6px 14px rgba(5, 31, 79, .22);
}

.auth-btn--primary:hover {
	background: var(--navy-600);
}

.auth-btn--secondary {
	height: 54px;
	background: var(--green-050);
	border: 1px solid var(--green-600);
	color: var(--green-700);
	font-size: 18px;
}

.auth-card__divider {
	width: 100%;
	height: 1px;
	margin: 0;
	border: 0;
	background: #D9E0EB;
}

/* ------------------------------------------------------- the felt panel */

.auth__stage {
	position: relative;
	align-self: stretch;
	min-height: 520px;
	overflow: hidden;
	background:
		linear-gradient(180deg, rgba(1, 58, 26, .92) 0%, rgba(1, 58, 26, .18) 34%, rgba(1, 58, 26, 0) 52%),
		url("../img/login-felt.jpg") center / cover no-repeat;
}

/* The gold glow behind the wordmark. */
.auth__stage::before {
	content: "";
	position: absolute;
	inset-block-start: -180px;
	inset-inline-start: -60px;
	width: 460px;
	height: 460px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 184, 13, .46), transparent 70%);
	pointer-events: none;
}

.auth__lockup {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 26px 32px 0;
}

.auth__lockup:hover {
	text-decoration: none;
}

.auth__wheel {
	width: clamp(96px, 12vw, 182px);
	height: auto;
	flex: none;
}

.auth__name {
	display: grid;
	justify-items: center;
	gap: 6px;
}

/* The wordmark ships as the brand's navy artwork; the design shows it white. */
.auth__wordmark {
	width: clamp(170px, 21vw, 299px);
	height: auto;
	filter: brightness(0) invert(1);
}

.auth__tagline {
	color: var(--tint);
	font-size: clamp(17px, 1.9vw, 27px);
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
	.auth {
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
	}

	.auth__stage {
		order: -1;
		min-height: 320px;
	}

	.auth__pane {
		padding: 32px 20px;
	}
}

@media (max-width: 560px) {
	body.is-bare {
		padding: 0;
	}

	.auth {
		border-radius: 0;
		box-shadow: none;
	}

	.auth-card {
		padding: 28px 22px;
		border-radius: 20px;
	}

	.auth-card__title {
		font-size: 30px;
	}

	.auth-card__lede {
		font-size: 17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.auth-btn:hover {
		transform: none;
	}
}

/* ------------------------------------------------------------ checkboxes */

/* The registration card is taller than the login one; let it scroll rather
   than stretch the stage beside it. */
.auth-card--tall {
	max-height: calc(100vh - 120px);
	overflow-y: auto;
}

.auth-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	color: var(--ink-soft);
	font-size: 14px;
	line-height: 1.45;
	cursor: pointer;
}

.auth-check input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--navy-500);
	cursor: pointer;
}

.auth-card__lede strong {
	color: var(--navy-700);
}

/* Links inside the consent text stand apart from it, not only by colour. */
.auth label a {
	text-decoration: underline;
	text-underline-offset: 2px;
}
