/**
 * Access portal — the group learner's front door.
 * Colours and type come from the Elementor kit, so the site's design system stays
 * the single source of truth. Usable down to 320px.
 */

.ds-access {
	--ds-blue: var(--e-global-color-primary, #006ACB);
	--ds-green: var(--e-global-color-secondary, #44AF21);
	--ds-ink: var(--e-global-color-text, #181818);
	--ds-grey-600: #616161;
	--ds-grey-100: #DADADA;
	--ds-grey-50: #F2F2F2;
	--ds-danger: #B3261E;
	--ds-font-head: var(--e-global-typography-primary-font-family, "Montserrat"), sans-serif;
	--ds-font-body: var(--e-global-typography-text-font-family, "Lato"), sans-serif;

	max-width: 560px;
	margin-inline: auto;
	font-family: var(--ds-font-body);
	color: var(--ds-ink);
}

.ds-access__form,
.ds-access__resume {
	background: #fff;
	border: 1px solid var(--ds-grey-100);
	border-radius: 12px;
	box-shadow: 0 2px 14px rgba(10, 42, 74, 0.08);
	padding: clamp(20px, 5vw, 36px);
}

.ds-access__title {
	font-family: var(--ds-font-head);
	font-weight: 600;
	font-size: clamp(1.35rem, 4vw, 1.75rem);
	line-height: 1.25;
	color: var(--ds-blue);
	margin: 0 0 8px;
}

.ds-access__lede {
	margin: 0 0 24px;
	color: var(--ds-grey-600);
	line-height: 1.6;
}

.ds-access__field {
	margin: 0 0 20px;
	display: flex;
	flex-direction: column;
}

.ds-access__label {
	font-family: var(--ds-font-head);
	font-weight: 600;
	margin-bottom: 2px;
}

.ds-access__hint {
	font-size: 0.85rem;
	color: var(--ds-grey-600);
	margin-bottom: 8px;
	line-height: 1.45;
}

.ds-access__input {
	font-family: inherit;
	font-size: 1rem;
	color: var(--ds-ink);
	background: #fff;
	border: 1px solid var(--ds-grey-100);
	border-radius: 8px;
	padding: 12px 14px;
	min-height: 48px; /* comfortable touch target */
	width: 100%;
}

.ds-access__input:focus-visible {
	outline: 2px solid var(--ds-blue);
	outline-offset: 2px;
	border-color: var(--ds-blue);
}

/* Codes are read off paper — give them room and rhythm. */
.ds-access__input--code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ds-access__input.is-invalid {
	border-color: var(--ds-danger);
	border-width: 2px;
}

/* Errors carry an icon as well as colour, never colour alone. */
.ds-access__error {
	color: var(--ds-danger);
	font-size: 0.9rem;
	margin-top: 6px;
	font-weight: 600;
}

.ds-access__error::before {
	content: "⚠ ";
}

.ds-access__alert {
	background: #FDECEA;
	border-left: 4px solid var(--ds-danger);
	border-radius: 6px;
	color: #7A1C16;
	padding: 12px 14px;
	margin-bottom: 20px;
	font-weight: 600;
}

.ds-access__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 14px 24px;
	border: 0;
	border-radius: 8px;
	background: var(--ds-blue);
	color: #fff;
	font-family: var(--ds-font-head);
	font-size: 1.05rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease;
}

.ds-access__button:hover,
.ds-access__button:focus {
	background: var(--ds-green);
	color: #fff;
}

.ds-access__button:focus-visible {
	outline: 2px solid var(--ds-ink);
	outline-offset: 3px;
}

.ds-access__foot {
	margin: 20px 0 0;
	font-size: 0.9rem;
	color: var(--ds-grey-600);
	text-align: center;
}

.ds-access__foot a {
	color: var(--ds-blue);
	font-weight: 600;
}

.ds-access__resume {
	text-align: center;
}

/* Small phones: trim the chrome, never the usability. */
@media (max-width: 400px) {
	.ds-access__form,
	.ds-access__resume {
		padding: 18px 14px;
		border-radius: 10px;
	}

	.ds-access__input--code {
		letter-spacing: 0.04em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ds-access__button {
		transition: none;
	}
}

/* Shown when the code is valid but we still need to know who is holding it. */
.ds-access__prompt {
	background: #EAF3FB;
	border-left: 4px solid var(--ds-blue);
	border-radius: 6px;
	color: #0B3F6E;
	padding: 12px 14px;
	margin-bottom: 20px;
	font-weight: 600;
	line-height: 1.5;
}
