/* "Become a reseller" application (page template Reseller application): full screen, no site header or footer.
   One question per step with Back / Continue; without JavaScript every question shows as one long form (.apply without .is-ready). */

.main--app { padding-top: 0; }

.apply {
	--apply-accent: #70796e;
	--apply-pad: clamp(24px, 5vw, 96px);
	position: relative;
	display: grid;
	min-height: 100svh;
}
@media (min-width: 1200px) {
	.apply--split { grid-template-columns: minmax(0, 1fr) minmax(0, 0.88fr); }
}
.apply__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Progress: a thin line along the top of the screen */
.apply__line { position: fixed; inset: 0 0 auto; z-index: 30; height: 3px; pointer-events: none; }
.apply__line-fill { display: block; width: 0; height: 100%; background: var(--apply-accent); transition: width 0.6s var(--ease-out); }

/* Left panel: top bar + the steps */
.apply__panel {
	display: grid;
	grid-template-rows: auto 1fr;
	min-width: 0;
	min-height: 100svh;
	padding-inline: var(--apply-pad);
}
.apply__top {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 96px;
	background: var(--components-page);
}
.apply__logo .logo__mark { width: 116px; }
.apply__close .icon { width: 20px; height: 20px; transition: transform 0.4s var(--ease-out); }
.apply__close:hover .icon { transform: rotate(90deg); }

.apply__stage { display: grid; align-items: center; min-width: 0; padding-block: 3vh 8vh; }
.apply__form,
.apply__step--done { grid-area: 1 / 1; width: 100%; max-width: 720px; }
.apply.is-done .apply__form { display: none; }

/* Steps: stacked without JS, one at a time with JS (sliding sideways) */
.apply__step { min-width: 0; margin: 0; padding: 0; border: 0; }
.apply__step:focus { outline: 0; }
.apply:not(.is-ready) .apply__form { display: flex; flex-direction: column; gap: 80px; }
.apply:not(.is-ready) .apply__back,
.apply:not(.is-ready) .apply__continue,
.apply:not(.is-ready) .apply__step--welcome .apply__actions { display: none; }
.apply.is-ready .apply__form > .apply__step { display: none; }
.apply.is-ready .apply__form > .apply__step.is-active { display: block; animation: apply-in 0.55s var(--ease-out) both; }
.apply.is-ready[data-dir="back"] .apply__form > .apply__step.is-active { animation-name: apply-in-back; }
.apply.is-ready .apply__step--done:not([hidden]) { animation: apply-in 0.7s var(--ease-out) both; }
@keyframes apply-in { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes apply-in-back { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.apply.is-ready .apply__form > .apply__step.is-active,
	.apply.is-ready .apply__step--done:not([hidden]) { animation-duration: 0.01s; }
}

/* Welcome and thank-you */
.apply__eyebrow { display: block; margin-bottom: var(--spacing-2); }
.apply__title { max-width: 13ch; }
.apply__step--done .apply__title { max-width: 16ch; }
.apply__intro { max-width: 520px; margin-top: var(--spacing-3); font-size: 17.28px; line-height: 1.6; color: var(--black-lighter); }
.apply__meta { display: inline-flex; align-items: center; gap: 8px; font-size: 14.4px; color: var(--grey-basic); }
.apply__meta-icon { width: 20px; height: 20px; }
.apply__notice {
	display: inline-flex;
	margin-top: var(--spacing-3);
	padding: 10px 16px;
	border-radius: var(--radius-large);
	background: rgba(168, 167, 107, 0.18);
	color: var(--brand-headlines);
	font-size: 14.76px;
}
.apply__done-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--sizing-circle-medium);
	height: var(--sizing-circle-medium);
	margin-bottom: var(--spacing-4);
	border-radius: 50%;
	background: var(--apply-accent);
	color: #fff;
}
.apply__done-icon .icon { width: 28px; height: 28px; }

/* Question */
.apply__question { display: block; width: 100%; padding: 0; }
.apply__label { display: block; max-width: 18ch; }
.apply__optional { color: var(--grey-basic); font-size: 0.5em; letter-spacing: -0.01em; white-space: nowrap; vertical-align: middle; }
.apply__help { max-width: 520px; margin-top: var(--spacing-2); font-size: 16.32px; line-height: 1.55; color: var(--grey-basic); }
.apply__answer { margin-top: var(--spacing-5); }

/* Fields: the same fields as the contact form on home (.form__input, .form__label) */
.apply__input { max-width: 520px; }
.apply__input--area { height: 160px; }
.apply__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spacing-3); max-width: 640px; }
.apply__field { display: flex; flex-direction: column; gap: var(--spacing-1); }
.apply__field .apply__input { max-width: none; }
.apply__field-label .apply__optional { font-size: inherit; font-weight: var(--font-weight-regular, 400); vertical-align: baseline; }

/* Round check as in the contact form and newsletter consent */
.apply__consent {
	display: flex;
	align-items: flex-start;
	gap: var(--spacing-1);
	max-width: 520px;
	margin-top: var(--spacing-3);
	font-size: 13.68px;
	line-height: 1.35;
	color: var(--black-lighter);
	cursor: pointer;
}
.apply__consent a { font-weight: var(--font-weight-bold); }
.apply__consent input,
.apply__mark {
	flex: none;
	appearance: none;
	width: 16px;
	height: 16px;
	margin: 1px 0 0;
	border: 1px solid var(--input-border);
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s;
}
.apply__consent input:checked,
.apply__choice:has(input:checked) .apply__mark {
	border-color: var(--brand-headlines);
	background: var(--brand-headlines) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M13.2 4.64L7.18 10.95L4.81 8.46L3.65 9.67L7.18 13.36L14.35 5.84L13.2 4.64Z' fill='%234a4f49'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.apply__consent input:focus-visible { outline: 2px solid var(--brand-headlines); outline-offset: 2px; }

/* Choices: bordered like the fields, the round check of the forms in front */
.apply__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spacing-1); max-width: 640px; }
.apply__choice {
	display: flex;
	align-items: center;
	gap: var(--spacing-1-5, 12px);
	min-height: var(--sizing-button-medium);
	padding: 10px var(--spacing-3);
	border: 1px solid var(--input-border);
	border-radius: var(--radius-medium);
	background: transparent;
	font-size: 15.36px;
	line-height: 1.4;
	color: var(--brand-headlines);
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}
.apply__choice:hover { border-color: var(--black-lighter); }
.apply__choice:has(input:focus-visible) { outline: 2px solid var(--brand-headlines); outline-offset: 2px; }
.apply__choice:has(input:checked) { border-color: var(--brand-headlines); background: var(--grey-neutral-8); }
.apply__mark { margin: 0; }
.apply__choice--multi .apply__mark { border-radius: 4px; }
.apply__mark-icon { display: none; }
.apply__other { display: block; max-width: 640px; margin-top: var(--spacing-1); }
.apply__other .apply__input { max-width: none; }

/* Buttons and errors */
.apply__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: var(--spacing-5); }
.apply__actions--step { gap: 12px; }
.apply__back { padding-inline: var(--spacing-4); }
.apply__back-icon { width: 20px; height: 20px; transform: rotate(180deg); transition: transform 0.3s var(--ease-out); }
.apply__back:hover .apply__back-icon { transform: rotate(180deg) translateX(3px); }
.button.is-loading { opacity: 0.6; pointer-events: none; }
/* Errors as the contact form and newsletter (live demo): one tinted rounded bar in the demo red */
.apply__error {
	display: block;
	max-width: 640px;
	margin-top: var(--spacing-2);
	padding: 0.65rem var(--spacing-2);
	border-radius: var(--radius-xlarge);
	background: rgba(217, 24, 66, 0.1);
	font-size: 0.95em;
	line-height: 1.5;
	color: #d91842;
}
.apply__error[hidden] { display: none; }
.apply__error-icon { display: none; }
.apply__error:not([hidden]) { animation: apply-shake 0.4s var(--ease-out); }
@keyframes apply-shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.apply__consent.is-invalid input { border-color: var(--brand-primary); box-shadow: 0 0 0 5px rgba(74, 79, 73, 0.2); }

/* Photo (desktop) */
.apply__media { position: sticky; top: 0; height: 100svh; margin: 0; padding: 16px 16px 16px 0; }
.apply__image { width: 100%; height: 100%; border-radius: var(--radius-xlarge); object-fit: cover; }

/* "Leave the application?" */
.apply-leave {
	width: min(440px, calc(100vw - 32px));
	padding: 32px;
	border: 0;
	border-radius: var(--radius-2xlarge);
	background: var(--components-page);
	color: var(--brand-headlines);
	box-shadow: var(--shadow-dropdown);
}
.apply-leave[open] { animation: apply-pop 0.35s var(--ease-out); }
.apply-leave::backdrop { background: rgba(10, 10, 12, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.apply-leave__text { margin-top: var(--spacing-1); font-size: 16.32px; line-height: 1.55; color: var(--black-lighter); }
.apply-leave__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--spacing-4); }
@keyframes apply-pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (max-width: 1199px) {
	.apply__media { display: none; }
}
@media (max-width: 767px) {
	.apply { --apply-pad: 20px; }
	.apply__top { height: 72px; }
	.apply__logo .logo__mark { width: 96px; }
	.apply__stage { align-items: start; padding-block: 4vh 32px; }
	.apply__choices,
	.apply__fields { grid-template-columns: minmax(0, 1fr); }
	.apply__step--multi .apply__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.apply__step--multi .apply__choice { gap: 8px; padding-inline: 12px; }
	.apply__actions--step { position: sticky; bottom: 0; margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--components-page); }
	.apply__actions--step .button[data-apply-next],
	.apply__actions--step .button[data-apply-submit] { flex: 1; }
}
