/**
 * ArtyTraders partner signup modal.
 *
 * Design tokens taken from the live artytraders.com stylesheet (WoodMart theme):
 *   body/UI font ...... Darker Grotesque     (--wd-text-font)
 *   display font ...... Libre Caslon Display (--wd-alternative-font)
 *   title ............. #242424              (--wd-title-color)
 *   body text ......... #767676              (--wd-text-color)
 *   primary ........... #000                 (--wd-primary-color)
 *   radius ............ 0                    (--wd-brd-radius)
 * Accents sampled from the live page: tan #DDCDAC, sage #A7B3A3, gold #B49664.
 */

.att-modal {
	--att-ink: #000;
	--att-title: #242424;
	--att-body: #767676;
	--att-line: rgba(0, 0, 0, 0.13);
	--att-line-soft: rgba(0, 0, 0, 0.07);
	--att-tan: #ddcdac;
	--att-tan-dim: #c9b78d;
	--att-sage: #a7b3a3;
	--att-gold: #b49664;
	--att-dark: #0d0d0d;
	--att-surface: #fff;
	--att-surface-2: #faf9f7;
	--att-danger: #b3261e;
	--att-h: 50px;

	--att-font: var(--wd-text-font, "Darker Grotesque", Arial, Helvetica, sans-serif);
	--att-display: var(--wd-alternative-font, "Libre Caslon Display", Georgia, serif);

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px 18px;
	font-family: var(--att-font);
	-webkit-font-smoothing: antialiased;
}

.att-modal[hidden] {
	display: none;
}

/* Don't inherit the theme's box model — inputs are width:100% inside a grid,
   so a content-box theme would push them past their column. */
.att-modal,
.att-modal *,
.att-modal *::before,
.att-modal *::after {
	box-sizing: border-box;
}

/**
 * Theme hardening.
 *
 * WoodMart (and most themes) style bare `button`/`input` elements — uppercase
 * transforms, letter-spacing, inset shadows, min-heights. An element selector like
 * `button` is only specificity (0,0,1), so it wins over anything we simply never
 * declared. Neutralise those up front, at the SAME specificity as the component rules
 * below (single class), so each component still overrides by source order.
 *
 * Keep this block above the component definitions.
 */
.att-role,
.att-btn,
.att-cta,
.att-google,
.att-back,
.att-modal__close,
.att-password__toggle,
.att-roles,
.att-form,
.att-field label {
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	box-shadow: none;
	background-image: none;
	text-decoration: none;
	min-height: 0;
	list-style: none;
}

/* Themes love to restyle inputs; state ours explicitly rather than inherit theirs. */
.att-modal input[type="text"],
.att-modal input[type="email"],
.att-modal input[type="password"] {
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	background-image: none;
	max-width: none;
	margin: 0;
}

/* ---------------------------------------------------------------- overlay */

.att-modal__overlay {
	position: absolute;
	inset: 0;
	/* No backdrop-filter here on purpose: combined with a fixed-position, transformed
	   dialog it causes compositing artefacts in Safari and some Chromium builds. */
	background: rgba(10, 10, 10, 0.82);
	opacity: 0;
	transition: opacity 0.3s ease;
	cursor: pointer;
}

.att-modal.is-open .att-modal__overlay {
	opacity: 1;
}

.att-modal--gated .att-modal__overlay {
	cursor: default;
}

/* ----------------------------------------------------------------- dialog */

.att-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	max-height: min(92vh, 760px);
	background: var(--att-surface);
	border-radius: 0;
	box-shadow: 0 40px 110px rgba(0, 0, 0, 0.5);
	transform: translateY(16px) scale(0.985);
	opacity: 0;
	transition: transform 0.38s cubic-bezier(0.2, 0.7, 0.25, 1), opacity 0.3s ease;
	outline: none;
	overflow: hidden;
}

.att-modal.is-open .att-modal__dialog {
	transform: translateY(0) scale(1);
	opacity: 1;
}

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

.att-panel {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	background: var(--att-surface);
}

.att-panel__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 30px 14px;
	flex: 0 0 auto;
}

.att-stepper {
	display: flex;
	align-items: baseline;
	gap: 5px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #b9b9b9;
}

.att-stepper__num {
	color: var(--att-ink);
}

.att-stepper__label {
	margin-left: 8px;
	color: var(--att-body);
	letter-spacing: 0.12em;
}

.att-modal__close {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 0;
	color: #a5a5a5;
	cursor: pointer;
	transition: color 0.18s ease, border-color 0.18s ease;
}

.att-modal__close:hover {
	color: var(--att-ink);
	border-color: var(--att-line);
}

.att-modal__close[hidden] {
	display: none;
}

.att-modal__close svg {
	width: 17px;
	height: 17px;
}

.att-rule {
	display: block;
	height: 2px;
	margin: 0 30px;
	background: var(--att-line-soft);
	flex: 0 0 auto;
}

.att-rule__fill {
	display: block;
	height: 100%;
	width: 50%;
	background: var(--att-ink);
	transition: width 0.45s cubic-bezier(0.2, 0.7, 0.25, 1);
}

.att-panel__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 26px 30px 30px;
}

/* ------------------------------------------------------------------ steps */

.att-step[hidden] {
	display: none;
}

.att-head {
	margin-bottom: 22px;
}

.att-eyebrow {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--att-gold);
	line-height: 1.2;
}

.att-title {
	margin: 0 0 8px;
	font-family: var(--att-display);
	font-size: 31px;
	font-weight: 400;
	line-height: 1.14;
	letter-spacing: -0.01em;
	color: var(--att-title);
}

.att-sub {
	margin: 0;
	font-size: 17px;
	line-height: 1.5;
	color: var(--att-body);
}

.att-chip {
	display: inline-block;
	margin-left: 3px;
	padding: 1px 10px;
	background: var(--att-tan);
	color: var(--att-ink);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	vertical-align: 1px;
}

.att-back {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin: 0 0 14px;
	padding: 0;
	background: none;
	border: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #a5a5a5;
	cursor: pointer;
	transition: color 0.18s ease;
}

.att-back:hover {
	color: var(--att-ink);
}

.att-back svg {
	width: 14px;
	height: 14px;
}

/* ------------------------------------------------------------- role tiles */

.att-roles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

/* Prefixed with .att-modal (0,2,0) so background, alignment and transform beat the
   theme's own `button` styling, which otherwise fills these tiles grey and uppercases
   the labels. */
.att-modal .att-role {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 11px;
	min-height: 116px;
	margin: 0;
	padding: 20px 14px;
	background: var(--att-surface);
	border: 1px solid var(--att-line);
	border-radius: 0;
	font-family: inherit;
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.18s ease, background 0.18s ease;
}

.att-modal .att-role:hover {
	border-color: var(--att-ink);
	background: var(--att-surface-2);
}

.att-modal .att-role:focus-visible {
	outline: 2px solid var(--att-gold);
	outline-offset: 2px;
}

.att-modal .att-role.is-selected {
	background: var(--att-ink);
	border-color: var(--att-ink);
}

.att-role__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--att-line);
	color: var(--att-title);
	transition: all 0.18s ease;
}

.att-role__icon svg {
	width: 21px;
	height: 21px;
}

.att-modal .att-role.is-selected .att-role__icon {
	background: var(--att-tan);
	border-color: var(--att-tan);
	color: var(--att-ink);
}

.att-modal .att-role__label {
	display: block;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--att-title);
	transition: color 0.18s ease;
}

.att-modal .att-role.is-selected .att-role__label {
	color: #fff;
}

/* Tan corner flag on the selected tile. */
.att-role::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 0;
	height: 0;
	border-top: 20px solid var(--att-tan);
	border-left: 20px solid transparent;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.att-role.is-selected::after {
	opacity: 1;
}

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

.att-btn,
.att-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: var(--att-h);
	padding: 10px 26px;
	background: var(--att-ink);
	color: #fff;
	border: 1px solid var(--att-ink);
	border-radius: 0;
	font-family: var(--att-font);
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1;
	cursor: pointer;
	transition: background 0.22s ease, color 0.22s ease;
}

.att-btn__arrow svg {
	width: 17px;
	height: 17px;
	display: block;
	transition: transform 0.22s ease;
}

.att-btn--primary:hover:not(:disabled),
.att-cta:hover {
	background: #fff;
	color: var(--att-ink);
}

.att-btn--primary:hover:not(:disabled) .att-btn__arrow svg {
	transform: translateX(3px);
}

.att-btn--ghost {
	background: transparent;
	color: var(--att-body);
	border-color: var(--att-line);
}

.att-btn--ghost:hover {
	background: var(--att-surface-2);
	color: var(--att-ink);
}

.att-btn--full {
	width: 100%;
}

.att-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.att-btn.is-loading {
	pointer-events: none;
	opacity: 0.75;
}

.att-btn.is-loading .att-btn__arrow {
	display: none;
}

.att-btn.is-loading .att-btn__label::after {
	content: "";
	display: inline-block;
	width: 13px;
	height: 13px;
	margin-left: 9px;
	vertical-align: -1px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: att-spin 0.7s linear infinite;
}

@keyframes att-spin {
	to {
		transform: rotate(360deg);
	}
}

.att-foot {
	margin-top: 20px;
}

/* ----------------------------------------------------------------- google */

.att-google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 11px;
	width: 100%;
	min-height: var(--att-h);
	padding: 10px 20px;
	background: #fff;
	color: var(--att-title);
	border: 1px solid var(--att-line);
	border-radius: 0;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.att-google:hover {
	border-color: var(--att-ink);
	background: var(--att-surface-2);
}

.att-google.is-loading {
	pointer-events: none;
	opacity: 0.7;
}

.att-google__icon svg {
	width: 19px;
	height: 19px;
	display: block;
}

.att-divider {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 18px 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #b0b0b0;
}

.att-divider::before,
.att-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--att-line-soft);
}

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

.att-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.att-field {
	margin-bottom: 14px;
	text-align: left;
}

.att-field label {
	display: block;
	margin-bottom: 5px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--att-title);
}

.att-modal input[type="text"],
.att-modal input[type="email"],
.att-modal input[type="password"] {
	width: 100%;
	height: var(--att-h);
	padding: 0 14px;
	background: var(--att-surface-2);
	border: 1px solid var(--att-line);
	border-radius: 0;
	box-shadow: none;
	font-family: inherit;
	font-size: 18px;
	font-weight: 500;
	color: var(--att-title);
	transition: border-color 0.18s ease, background 0.18s ease;
}

.att-modal input:focus {
	outline: none;
	background: #fff;
	border-color: var(--att-ink);
	box-shadow: none;
}

.att-modal .att-field.has-error input {
	border-color: var(--att-danger);
	background: #fdf6f5;
}

.att-password {
	position: relative;
}

.att-password input {
	padding-right: 48px;
}

.att-password__toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 46px;
	height: var(--att-h);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: none;
	border: 0;
	color: #a5a5a5;
	cursor: pointer;
	transition: color 0.18s ease;
}

.att-password__toggle:hover,
.att-password__toggle.is-on {
	color: var(--att-ink);
}

.att-password__toggle svg {
	width: 19px;
	height: 19px;
}

.att-hint {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	color: #a5a5a5;
}

.att-field__error {
	display: none;
	margin-top: 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--att-danger);
}

.att-field.has-error .att-field__error {
	display: block;
}

.att-field.has-error .att-hint {
	display: none;
}

.att-error {
	margin: 0 0 14px;
	padding: 11px 14px;
	background: #fdf1f0;
	border-left: 3px solid var(--att-danger);
	font-size: 16px;
	line-height: 1.4;
	color: #7d1a15;
}

.att-error[hidden] {
	display: none;
}

.att-legal {
	margin: 13px 0 0;
	font-size: 14px;
	line-height: 1.45;
	color: #a5a5a5;
	text-align: center;
}

.att-legal a {
	color: var(--att-body);
	text-decoration: underline;
}

.att-legal a:hover {
	color: var(--att-ink);
}

/* ------------------------------------------------------------- done state */

.att-step--done {
	text-align: center;
	padding-top: 14px;
}

.att-done__mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0 auto 22px;
	background: var(--att-sage);
	color: #fff;
}

.att-done__mark svg {
	width: 31px;
	height: 31px;
}

.att-step--done .att-sub {
	margin-bottom: 26px;
}

.att-step--done .att-sub strong {
	color: var(--att-title);
	font-weight: 700;
}

.att-step--done .att-btn + .att-btn {
	margin-top: 10px;
}

/* ----------------------------------------------------------------- mobile */

@media (max-width: 600px) {
	.att-modal {
		padding: 0;
		align-items: flex-end;
	}

	.att-modal__dialog {
		max-width: none;
		max-height: 94vh;
		transform: translateY(30px) scale(1);
	}

	.att-panel__bar {
		padding: 16px 20px 12px;
	}

	.att-rule {
		margin: 0 20px;
	}

	.att-panel__body {
		padding: 22px 20px 26px;
	}

	.att-title {
		font-size: 27px;
	}

	.att-roles {
		gap: 8px;
	}

	.att-modal .att-role {
		min-height: 100px;
		gap: 9px;
		padding: 15px 10px;
	}

	.att-modal .att-role__label {
		font-size: 17px;
	}

	.att-role__icon {
		width: 38px;
		height: 38px;
	}

	.att-field-row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.att-stepper__label {
		display: none;
	}
}

/* On short screens the tiles would otherwise force the panel to scroll. */
@media (max-height: 700px) and (min-width: 601px) {
	.att-role {
		min-height: 0;
	}

}

@media (prefers-reduced-motion: reduce) {
	.att-modal__overlay,
	.att-modal__dialog,
	.att-rule__fill,
	.att-btn__arrow svg {
		transition: none;
	}

	.att-btn.is-loading .att-btn__label::after {
		animation: none;
	}
}

/* Lock background scroll while the modal is open. */
html.att-locked,
body.att-locked {
	overflow: hidden;
}
