/*
 * Admission form and status lookup.
 *
 * Written with CSS logical properties throughout, so one stylesheet serves
 * Urdu right-to-left and English left-to-right without a mirrored copy
 * (HANDOVER §13). It leans on the theme's custom properties where they exist
 * and falls back to its own values, so the plugin still looks deliberate if
 * it is ever activated under a different theme.
 */

:root {
	--ak-c-maroon: #7b1e3a;
	--ak-c-gold: #c8a349;
	--ak-c-ink: #241b1e;
	--ak-c-muted: #6b5d61;
	--ak-c-line: #e4d9cf;
	--ak-c-cream: #faf6f0;
	--ak-c-bad: #9b2226;
}

.ak-apply,
.ak-status {
	max-inline-size: 760px;
	margin-inline: auto;
	color: var(--ak-c-ink);
}

/* ---- step breadcrumbs ---- */

.ak-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	margin-block: 0 24px;
	list-style: none;
	font-size: 0.86rem;
}

.ak-steps li {
	flex: 1 1 auto;
	padding: 8px 12px;
	border: 1px solid var(--ak-c-line);
	border-radius: 999px;
	background: #fff;
	color: var(--ak-c-muted);
	text-align: center;
}

.ak-steps li.on {
	background: var(--ak-c-maroon);
	border-color: var(--ak-c-maroon);
	color: #fff;
}

.ak-steps li.done {
	border-color: var(--ak-c-gold);
	color: var(--ak-c-maroon);
}

/* ---- the form ---- */

.ak-form fieldset {
	margin-block: 0 20px;
	padding: 20px;
	border: 1px solid var(--ak-c-line);
	border-radius: 10px;
	background: #fff;
}

.ak-form legend {
	padding-inline: 10px;
	font-weight: 700;
	color: var(--ak-c-maroon);
}

.ak-form legend:focus-visible {
	outline: 2px solid var(--ak-c-gold);
	outline-offset: 3px;
}

.ak-field {
	margin-block: 0 16px;
}

.ak-field label {
	display: block;
	margin-block-end: 6px;
	font-weight: 600;
}

.ak-field input,
.ak-field select,
.ak-field textarea {
	inline-size: 100%;
	padding: 11px 13px;
	border: 1px solid var(--ak-c-line);
	border-radius: 8px;
	background: var(--ak-c-cream);
	color: inherit;
	font: inherit;
	/* 16px minimum stops iOS zooming the page on focus. */
	font-size: max(1rem, 16px);
}

.ak-field input:focus-visible,
.ak-field select:focus-visible,
.ak-field textarea:focus-visible {
	outline: 2px solid var(--ak-c-gold);
	outline-offset: 1px;
	background: #fff;
}

.ak-field input.ak-invalid {
	border-color: var(--ak-c-bad);
	background: #fdf3f3;
}

.ak-field small {
	display: block;
	margin-block-start: 6px;
	color: var(--ak-c-muted);
	font-size: 0.85rem;
}

.req {
	color: var(--ak-c-bad);
}

/* ---- checkboxes and radios ---- */

.ak-check,
.ak-radio {
	display: block;
	margin-block: 0 10px;
}

.ak-check label,
label.ak-check,
label.ak-radio {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-weight: 400;
	line-height: 1.55;
	cursor: pointer;
}

.ak-check input,
.ak-radio input {
	/* A comfortable target on a phone, and aligned to the first text line. */
	inline-size: 20px;
	block-size: 20px;
	margin-block-start: 2px;
	flex: 0 0 auto;
}

.ak-consent {
	padding: 14px;
	border-radius: 8px;
	background: var(--ak-c-cream);
	border: 1px solid var(--ak-c-line);
}

.ak-radios,
.ak-checks {
	margin-block: 0 16px;
	padding: 14px;
	border: 1px dashed var(--ak-c-line);
	border-radius: 8px;
	background: transparent;
}

.ak-radios legend,
.ak-checks legend {
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--ak-c-ink);
}

/* The browser's own rule for [hidden] is display:none, but it loses to any
 * class selector that sets display — .ak-btn below sets inline-block, which
 * left the Back button on screen at step one even though the script had
 * hidden it. Restore the attribute's authority. */
[hidden] {
	display: none !important;
}

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

.ak-btn {
	display: inline-block;
	padding: 12px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--ak-c-maroon);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	min-block-size: 44px;
}

.ak-btn:hover,
.ak-btn:focus-visible {
	background: #5f1730;
	color: #fff;
}

.ak-btn[disabled],
.ak-btn.is-sending {
	opacity: 0.6;
	cursor: progress;
}

.ak-nav {
	display: flex;
	gap: 12px;
	justify-content: space-between;
}

.ak-nav .ak-prev {
	background: #fff;
	color: var(--ak-c-maroon);
	border: 1px solid var(--ak-c-line);
}

/* ---- messages ---- */

.ak-errors {
	margin-block: 0 20px;
	padding: 14px 16px;
	border: 1px solid var(--ak-c-bad);
	/* Never colour alone: the border and the heading carry the meaning too. */
	border-inline-start-width: 4px;
	border-radius: 8px;
	background: #fdf3f3;
	color: #6b1416;
}

.ak-errors ul {
	margin-block: 8px 0;
	padding-inline-start: 20px;
}

.ak-note,
.ak-empty {
	color: var(--ak-c-muted);
	font-size: 0.9rem;
	line-height: 1.7;
}

.ak-connector-unavailable {
	padding: 16px;
	border: 1px dashed var(--ak-c-line);
	border-radius: 8px;
	background: var(--ak-c-cream);
	color: var(--ak-c-muted);
}

/* ---- the receipt ---- */

.ak-apply-done {
	padding: 28px;
	border: 1px solid var(--ak-c-gold);
	border-radius: 12px;
	background: var(--ak-c-cream);
	text-align: center;
}

.ak-apply-done h2 {
	margin-block-start: 0;
	color: var(--ak-c-maroon);
}

.ak-reference {
	margin-block: 18px;
	padding: 14px;
	border: 1px dashed var(--ak-c-maroon);
	border-radius: 8px;
	background: #fff;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	/* Western digits in an isolated run, so the reference reads correctly
	 * inside a right-to-left paragraph (HANDOVER §13). */
	direction: ltr;
	unicode-bidi: isolate;
}

/* ---- status timeline ---- */

.ak-timeline {
	margin-block: 24px 0;
	padding: 20px;
	border: 1px solid var(--ak-c-line);
	border-radius: 10px;
	background: #fff;
}

.ak-current {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: baseline;
	margin-block-start: 0;
}

.ak-current .ak-label {
	color: var(--ak-c-muted);
}

.ak-current .ak-state {
	font-size: 1.15rem;
	color: var(--ak-c-maroon);
}

.ak-clarify {
	margin-block: 16px;
	padding: 14px 16px;
	border-inline-start: 4px solid var(--ak-c-gold);
	border-radius: 8px;
	background: var(--ak-c-cream);
}

.ak-clarify p {
	margin-block-end: 0;
}

.ak-steps-done {
	margin-block: 16px 0;
	padding-inline-start: 20px;
	color: var(--ak-c-muted);
}

.ak-steps-done li {
	margin-block-end: 6px;
}

.ak-steps-done time {
	margin-inline-start: 8px;
	font-size: 0.86rem;
}

/* ---- honeypot ----
 * Positioned off-screen rather than display:none, because some bots skip
 * fields that are not rendered at all. */
.ak-hp {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (max-width: 560px) {
	.ak-form fieldset {
		padding: 16px;
	}

	.ak-steps {
		font-size: 0.78rem;
	}

	.ak-nav {
		flex-direction: column-reverse;
	}

	.ak-nav .ak-btn {
		inline-size: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
	}
}
