/**
 * Official portal refinements — loaded after main.css
 * Clean government-style surfaces, restrained motion, brand-first hero.
 */

/* --------------------------------------------------------------------------
   Buttons — flatter, official
   -------------------------------------------------------------------------- */

.ar-btn {
	border-radius: var(--ar-radius-sm);
	letter-spacing: 0;
	font-weight: 600;
	box-shadow: none;
}

.ar-btn--primary {
	background: var(--ar-ink);
	border-color: var(--ar-ink);
}

.ar-btn--primary:hover {
	background: var(--ar-ink-soft);
	box-shadow: none;
	transform: none;
}

.ar-btn--secondary {
	background: var(--ar-teal);
	border-color: var(--ar-teal);
}

.ar-btn--secondary:hover {
	background: var(--ar-teal-dark);
	border-color: var(--ar-teal-dark);
	transform: none;
}

.ar-btn--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.45);
	color: #fff;
}

.ar-btn--ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: #fff;
	color: #fff;
}

.ar-btn--outline:hover {
	transform: none;
	box-shadow: none;
}

/* --------------------------------------------------------------------------
   Header — compact, same width as content
   -------------------------------------------------------------------------- */

.ar-header {
	background: transparent;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border-bottom: none;
	box-shadow: none;
	padding-block: 0.5rem 0;
}

.ar-header__inner {
	min-height: var(--ar-header-height);
	padding-block: 0.25rem;
	background: var(--ar-card);
	border: 1px solid var(--ar-border);
	border-radius: var(--ar-radius);
	box-shadow: var(--ar-shadow);
}

.ar-header__mark {
	width: 28px;
	height: 28px;
	border-radius: var(--ar-radius-sm);
	background: var(--ar-ink);
	box-shadow: none;
	font-family: var(--ar-font-display);
	font-weight: 600;
	font-size: 0.8rem;
}

.ar-header__logo-primary {
	font-weight: 700;
	font-size: 0.95rem;
}

.ar-header__logo-secondary {
	text-transform: none;
	letter-spacing: 0.02em;
	font-size: 0.5625rem;
}

.ar-header__brand .custom-logo-link img,
.ar-header__brand img.custom-logo {
	max-height: 30px;
}

.ar-nav__list > li > a {
	font-weight: 500;
	font-size: 0.875rem;
	padding-block: 0.35rem;
}

.ar-dark-toggle {
	border-radius: var(--ar-radius-sm);
	border: 1px solid var(--ar-border);
	background: var(--ar-bg);
}

/* --------------------------------------------------------------------------
   Hero — brand first (full-bleed disabled; bar uses content width)
   -------------------------------------------------------------------------- */

.ar-hero,
.ar-hero--compact,
.ar-hero--official {
	position: relative;
	overflow: visible;
	min-height: 0;
	display: block;
	align-items: center;
	padding-block: 0.5rem;
	background: transparent;
	color: #f4f7fa;
	isolation: isolate;
}

.ar-hero__atmosphere {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(176, 141, 87, 0.18) 0, rgba 0, transparent 100%),
		radial-gradient(ellipse 70% 80% at 15% 20%, rgba(255, 255, 255, 0.08), transparent 55%),
		repeating-linear-gradient(
			-18deg,
			transparent,
			transparent 48px,
			rgba(255, 255, 255, 0.025) 48px,
			rgba(255, 255, 255, 0.025) 49px
		);
	animation: ar-hero-atmosphere 18s ease-in-out infinite alternate;
}

@keyframes ar-hero-atmosphere {
	from { opacity: 0.85; transform: scale(1); }
	to { opacity: 1; transform: scale(1.03); }
}

.ar-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 40rem;
	padding-block: 0;
}

.ar-hero__brand {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	margin: 0 0 1.75rem;
	animation: ar-fade-up 0.7s ease both;
}

.ar-hero__brand-mark {
	width: 3.25rem;
	height: 3.25rem;
	border-radius: var(--ar-radius-sm);
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.28);
	display: grid;
	place-items: center;
	font-family: var(--ar-font-display);
	font-weight: 700;
	font-size: 1.35rem;
	color: #fff;
}

.ar-hero__brand-text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	line-height: 1.15;
}

.ar-hero__brand-name {
	font-family: var(--ar-font-display);
	font-size: clamp(1.75rem, 4vw, 2.35rem);
	font-weight: 700;
	color: #fff;
	letter-spacing: 0;
}

.ar-hero__brand-en {
	font-size: 0.8125rem;
	font-weight: 500;
	color: rgba(244, 247, 250, 0.72);
	letter-spacing: 0.04em;
}

.ar-hero__title {
	font-family: var(--ar-font-display);
	font-size: clamp(1.25rem, 2.6vw, 1.65rem);
	font-weight: 600;
	color: rgba(255, 255, 255, 0.96);
	margin: 0 0 0.75rem;
	max-width: 22ch;
	animation: ar-fade-up 0.7s ease 0.08s both;
}

.ar-hero__subtitle {
	margin: 0 0 1.75rem;
	font-size: 1.0625rem;
	line-height: 1.75;
	color: rgba(232, 238, 245, 0.82);
	max-width: 34rem;
	animation: ar-fade-up 0.7s ease 0.14s both;
}

.ar-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	animation: ar-fade-up 0.7s ease 0.2s both;
}

.ar-hero--official .ar-hero__actions .ar-btn--secondary {
	background: #fff;
	color: var(--ar-ink);
	border-color: #fff;
}

.ar-hero--official .ar-hero__actions .ar-btn--secondary:hover {
	background: #f0f4f8;
	color: var(--ar-ink);
}

@keyframes ar-fade-up {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ar-hero__atmosphere,
	.ar-hero__brand,
	.ar-hero__title,
	.ar-hero__subtitle,
	.ar-hero__actions {
		animation: none !important;
	}
}

/* --------------------------------------------------------------------------
   Sections — quieter hierarchy
   -------------------------------------------------------------------------- */

.ar-section__eyebrow {
	color: var(--ar-gold);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: none;
	letter-spacing: 0.04em;
}

.ar-section__title {
	font-weight: 600;
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.ar-section--alt {
	background: color-mix(in srgb, var(--ar-bg-muted) 88%, transparent);
	border-block: 1px solid var(--ar-border);
}

/* --------------------------------------------------------------------------
   Cards / grids — border-first, less chrome
   -------------------------------------------------------------------------- */

.ar-card,
.ar-service-card,
.ar-gov-card,
.ar-quick-card,
.ar-country-card,
.ar-result-card,
.ar-tool-card {
	border-radius: var(--ar-radius);
	box-shadow: none;
	border: 1px solid var(--ar-border);
	background: var(--ar-card);
	transition: border-color var(--ar-transition), background var(--ar-transition);
}

.ar-card:hover,
.ar-service-card:hover,
.ar-gov-card:hover,
.ar-quick-card:hover,
.ar-country-card:hover,
.ar-tool-card:hover {
	box-shadow: none;
	border-color: var(--ar-teal);
	transform: none;
}

.ar-quick-access {
	padding-block: 1.75rem 0.5rem;
	margin-top: -1.5rem;
	position: relative;
	z-index: 2;
}

.ar-quick-access__grid {
	gap: 0.75rem;
}

.ar-quick-card {
	padding: 1rem 1.15rem;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	text-decoration: none;
	color: inherit;
	border-top: 2px solid var(--ar-ink);
}

.ar-quick-card__icon {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--ar-radius-sm);
	background: var(--ar-teal-soft);
	color: var(--ar-teal);
	display: grid;
	place-items: center;
	flex-shrink: 0;
}

.ar-quick-card__title {
	font-family: var(--ar-font-display);
	font-size: 0.98rem;
	font-weight: 600;
	color: var(--ar-heading);
	display: block;
	margin-bottom: 0.2rem;
}

.ar-result-listing-card__header,
.ar-result-listing-card__meta,
.ar-result-listing-card__date,
.ar-gov-card__meta,
.ar-service-card__desc,
.ar-quick-card__desc,
.ar-country-hub__exams,
.ar-country-hub__desc,
.ar-portal-meta {
	display: none !important;
}

.ar-badge,
.ar-badge--now,
.ar-badge--available,
.ar-badge--gold {
	border-radius: var(--ar-radius-xs);
	font-weight: 600;
	letter-spacing: 0;
}

.ar-service-card__icon,
.ar-gov-card__cta {
	border-radius: var(--ar-radius-sm);
}

/* --------------------------------------------------------------------------
   Forms / search — clean official inputs
   -------------------------------------------------------------------------- */

.ar-form-input,
.ar-search-form input[type="text"],
.ar-search-form input[type="search"],
.ar-search-form select,
.ar-search-card input,
.ar-search-card select {
	border-radius: var(--ar-radius-sm);
	border: 1px solid var(--ar-border-strong);
	box-shadow: none;
	background: var(--ar-card);
}

.ar-form-input:focus,
.ar-search-form input:focus,
.ar-search-form select:focus,
.ar-search-card input:focus,
.ar-search-card select:focus {
	border-color: var(--ar-teal);
	box-shadow: 0 0 0 2px var(--ar-teal-soft);
}

.ar-search-card,
.ar-exam-search {
	border-radius: var(--ar-radius);
	border: 1px solid var(--ar-border);
	box-shadow: none;
	background: var(--ar-card);
}

.ar-search-tabs__btn {
	border-radius: var(--ar-radius-sm);
}

.ar-search-tabs__btn.is-active {
	background: var(--ar-ink);
	color: #fff;
}

/* --------------------------------------------------------------------------
   Portal pages
   -------------------------------------------------------------------------- */

.ar-page-header h1,
.ar-portal-hero h1,
.ar-portal-exam .ar-page-header h1,
.ar-portal-country .ar-page-header h1 {
	font-weight: 600;
	font-size: clamp(1.4rem, 2.8vw, 1.85rem);
}

.ar-portal-hero {
	border-bottom: 1px solid var(--ar-border);
	padding-bottom: 1.5rem;
	margin-bottom: 1.5rem;
}

.ar-portal-hero__flag {
	filter: grayscale(0.15);
}

.ar-breadcrumb {
	font-size: 0.8125rem;
	color: var(--ar-text-muted);
}

/* --------------------------------------------------------------------------
   Footer — formal, content width
   -------------------------------------------------------------------------- */

.ar-footer {
	background: transparent;
	color: rgba(244, 247, 250, 0.82);
	border-top: none;
	margin-top: 0;
	padding-block: 0.75rem 1.25rem;
}

.ar-footer > .ar-container {
	background: var(--ar-ink);
	border-radius: var(--ar-radius);
	border-top: 3px solid var(--ar-gold);
	padding-block: 1.25rem 0.75rem;
	box-shadow: var(--ar-shadow);
}

.ar-footer a {
	color: rgba(244, 247, 250, 0.78);
}

.ar-footer a:hover {
	color: #fff;
}

.ar-footer__links h3,
.ar-footer__social h3 {
	color: #fff;
	font-weight: 600;
	font-size: 0.875rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	padding-bottom: 0.4rem;
	margin-bottom: 0.65rem;
}

.ar-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	color: rgba(244, 247, 250, 0.55);
	font-size: 0.75rem;
	padding-block: 0.65rem 0.15rem;
	margin-block-start: 0.75rem;
}

/* Alert — content width */
.ar-alert-bar {
	background: transparent;
	border-bottom: none;
	padding-block: 0.35rem 0;
}

.ar-alert-bar__inner {
	background: var(--ar-alert-bg);
	border-radius: var(--ar-radius);
	padding-block: 0.4rem;
	box-shadow: var(--ar-shadow);
}

/* --------------------------------------------------------------------------
   Stats / clutter reduction
   -------------------------------------------------------------------------- */

.ar-stats {
	padding-block: 1.5rem;
}

.ar-stat-card {
	border-radius: var(--ar-radius);
	box-shadow: none;
	border: 1px solid var(--ar-border);
	background: var(--ar-card);
}

/* --------------------------------------------------------------------------
   Reveal motion — subtle
   -------------------------------------------------------------------------- */

[data-reveal] {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.45s ease, transform 0.45s ease;
}

[data-reveal].is-visible,
[data-reveal].ar-revealed {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	[data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
	.ar-hero,
	.ar-hero--official,
	.ar-hero--bar {
		min-height: 0;
		padding-block: 0.65rem;
	}

	.ar-hero__inner {
		flex-wrap: wrap;
		gap: 0.65rem;
	}

	.ar-hero__title {
		flex: 1 1 100%;
		order: 3;
		white-space: normal;
		font-size: 0.9rem;
	}

	.ar-hero__actions {
		margin-inline-start: 0;
		order: 2;
	}

	.ar-hero__brand {
		order: 1;
	}

	.ar-hero__brand-name {
		font-size: 1.05rem;
	}

	.ar-quick-access {
		margin-top: 0;
	}

	.ar-hero__actions .ar-btn {
		justify-content: center;
	}
}

/* --------------------------------------------------------------------------
   Hero bar — short, content-width (aligned with results cards)
   -------------------------------------------------------------------------- */

.ar-hero,
.ar-hero--compact,
.ar-hero--official,
.ar-hero.ar-hero--official.ar-hero--bar {
	min-height: 0 !important;
	padding-block: 0.5rem !important;
	padding-inline: 0;
	background: transparent !important;
}

.ar-hero--bar .ar-hero__atmosphere {
	display: none;
}

.ar-hero--bar .ar-hero__inner {
	max-width: var(--ar-container);
	width: 100%;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin-inline: auto;
	padding-block: 0.4rem;
	background:
		linear-gradient(165deg, var(--ar-hero-from) 0%, var(--ar-hero-via) 48%, var(--ar-hero-to) 100%);
	border-radius: var(--ar-radius);
	box-shadow: var(--ar-shadow);
	color: #f4f7fa;
}

.ar-hero--bar .ar-hero__brand {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
	flex-shrink: 0;
	animation: none;
}

.ar-hero--bar .ar-hero__brand-mark {
	width: 1.65rem;
	height: 1.65rem;
	font-size: 0.8rem;
}

.ar-hero--bar .ar-hero__brand-name {
	font-size: 1rem;
	white-space: nowrap;
}

.ar-hero--bar .ar-hero__brand-en,
.ar-hero--bar .ar-hero__subtitle {
	display: none !important;
}

.ar-hero--bar .ar-hero__title {
	font-family: var(--ar-font);
	font-size: 0.9rem;
	font-weight: 500;
	margin: 0;
	max-width: none;
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	animation: none;
	line-height: 1.3;
}

.ar-hero--bar .ar-hero__actions {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.4rem;
	margin: 0;
	margin-inline-start: auto;
	flex-shrink: 0;
	animation: none;
}

.ar-hero--bar .ar-btn--sm {
	padding: 0.3rem 0.7rem;
	font-size: 0.75rem;
}

.ar-hero--bar ~ .ar-quick-access,
.ar-quick-access {
	margin-top: 0;
	padding-block: 1rem 0.25rem;
}

@media (max-width: 640px) {
	.ar-header {
		padding-block: 0.35rem 0;
	}

	.ar-hero--bar .ar-hero__inner {
		flex-wrap: wrap;
		gap: 0.5rem;
		padding-block: 0.5rem;
	}

	.ar-hero--bar .ar-hero__title {
		flex: 1 1 100%;
		order: 3;
		white-space: normal;
		overflow: visible;
		text-overflow: unset;
		font-size: 0.85rem;
	}

	.ar-hero--bar .ar-hero__actions {
		margin-inline-start: 0;
		order: 2;
	}

	.ar-hero--bar .ar-hero__brand {
		order: 1;
	}
}
