/* =========================================================
   MFC Representative Network — Front-end styles
   Theme: Caterpillar yellow / gold on a medium-dark charcoal —
   kept deliberately lighter than pure black so the frosted-glass
   panels still read as glass — over a full-screen fixed, blurred
   factory photograph.
   ========================================================= */

.mfc-rn-wrap {
	--mfc-bg: #2a271f;
	--mfc-surface: rgba(255, 255, 255, 0.08);
	--mfc-surface-strong: rgba(255, 255, 255, 0.1);
	--mfc-border: rgba(255, 205, 17, 0.22);
	--mfc-border-soft: rgba(255, 255, 255, 0.14);
	--mfc-text: #f5f2e8;
	--mfc-text-dim: #cfc6b3;
	--mfc-accent: #ffcd11;
	--mfc-accent-2: #d4af37;
	--mfc-accent-ink: #211a00;
	--mfc-radius: 20px;
	--mfc-radius-lg: 30px;
	--mfc-shadow: 0 20px 46px rgba(0, 0, 0, 0.38);

	position: relative;
	isolation: isolate;
	font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
	color: var(--mfc-text);
	line-height: 1.9;
}

/* Full-screen fixed factory photo — sits behind everything and stays put
   while the page scrolls, per the "Full Screen Fixed Background"
   requirement. Only a light blur is applied here so the photo itself stays
   clearly visible; the frosted look comes from the glass panels'
   own backdrop-filter, not from fogging the whole page. */
.mfc-rn-wrap::before {
	content: "";
	position: fixed;
	inset: -20px;
	z-index: -2;
	background-image: var(--mfc-bg-photo);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	filter: blur(6px) saturate(115%) brightness(0.98);
	transform: scale(1.04);
}

/* A light warm-charcoal wash — just enough for the yellow accents and
   text to stay legible, while keeping the factory photo clearly visible
   underneath rather than buried in fog. */
.mfc-rn-wrap::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(180deg, rgba(24, 21, 16, 0.28) 0%, rgba(22, 19, 14, 0.24) 45%, rgba(18, 16, 12, 0.42) 100%),
		radial-gradient(900px 480px at 12% 0%, rgba(255, 205, 17, 0.08) 0%, transparent 60%),
		radial-gradient(800px 460px at 100% 15%, rgba(212, 175, 55, 0.07) 0%, transparent 55%);
}

.mfc-rn-wrap * {
	box-sizing: border-box;
}

.mfc-rn-wrap img {
	max-width: 100%;
}

/* ===================== GLASS PANEL BASE ===================== */
.mfc-glass {
	position: relative;
	background: linear-gradient(160deg, rgba(30, 27, 20, 0.55) 0%, rgba(30, 27, 20, 0.32) 55%, rgba(255, 205, 17, 0.05) 100%);
	backdrop-filter: blur(22px) saturate(160%);
	-webkit-backdrop-filter: blur(22px) saturate(160%);
	border: 1px solid var(--mfc-border);
	border-radius: var(--mfc-radius);
	box-shadow: var(--mfc-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Faint top-edge sheen — the classic glass-panel highlight. */
.mfc-glass::before {
	content: "";
	position: absolute;
	top: 0;
	left: 12%;
	right: 12%;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(255, 205, 17, 0.5), transparent);
	border-radius: 999px;
}

.mfc-section {
	max-width: 1180px;
	margin: 0 auto;
	padding: 56px 24px;
}

.mfc-map-section {
	padding-top: 28px;
}

.mfc-section-title {
	font-size: clamp(22px, 2.6vw, 30px);
	font-weight: 800;
	text-align: center;
	margin: 0 0 10px;
	color: var(--mfc-text);
	letter-spacing: -0.2px;
}

.mfc-section-subtitle {
	text-align: center;
	color: var(--mfc-text-dim);
	font-size: 15px;
	margin: 0 0 48px;
}

.mfc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	border-radius: 999px;
	padding: 14px 32px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
	text-decoration: none;
}

.mfc-btn-primary {
	background: linear-gradient(135deg, var(--mfc-accent), #e6b400);
	color: var(--mfc-accent-ink);
	box-shadow: 0 12px 28px rgba(255, 205, 17, 0.3);
}

.mfc-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 36px rgba(255, 205, 17, 0.42);
	color: var(--mfc-accent-ink);
}

.mfc-btn-large {
	padding: 16px 44px;
	font-size: 16px;
}

/* ===================== HOME (BACK) BUTTON ===================== */
/* Minimal, text-only, small glass pill — no icon, per spec. */
.mfc-home-btn {
	position: absolute;
	top: 20px;
	left: 20px;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	padding: 9px 20px;
	border-radius: 999px;
	color: var(--mfc-text-dim);
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
	transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mfc-home-btn:hover,
.mfc-home-btn:focus-visible {
	transform: translateY(-1px);
	color: var(--mfc-accent);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(255, 205, 17, 0.22);
}

/* ===================== BRAND / LOGO ===================== */
.mfc-brand {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px;
	border-radius: 999px;
}

.mfc-brand img {
	height: 26px;
	width: auto;
	max-width: 110px;
	object-fit: contain;
	border-radius: 6px;
	display: block;
}

.mfc-brand-text {
	font-size: 13px;
	font-weight: 700;
	color: var(--mfc-text);
	white-space: nowrap;
}

/* Screen-reader-only heading — keeps a semantic H1 for SEO/accessibility
   now that the visual title card has been removed; invisible on screen. */
.mfc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ===================== QUICK NAV ===================== */
/* The plugin now opens straight on the map, so the quicknav also carries
   the top clearance needed to clear the fixed home-button/logo pills. */
.mfc-quicknav {
	position: sticky;
	top: 12px;
	z-index: 4;
	display: flex;
	justify-content: center;
	gap: 6px;
	width: fit-content;
	max-width: calc(100% - 32px);
	margin: 86px auto 0;
	padding: 6px;
	border-radius: 999px;
	overflow-x: auto;
}

.mfc-quicknav a {
	flex-shrink: 0;
	padding: 10px 20px;
	border-radius: 999px;
	color: var(--mfc-text-dim);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.2s ease, color 0.2s ease;
}

.mfc-quicknav a:hover,
.mfc-quicknav a:focus-visible {
	color: var(--mfc-accent-ink);
	background: linear-gradient(135deg, var(--mfc-accent), var(--mfc-accent-2));
}

/* ===================== MAP ===================== */
.mfc-map-layout {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 28px;
	align-items: start;
}

.mfc-map-canvas-wrap {
	position: relative;
	/* Matches the viewBox (20 0 970 960) of the vector province map so it
	   isn't stretched. */
	aspect-ratio: 970 / 960;
	padding: 20px;
	overflow: hidden;
}

.mfc-map-canvas-wrap:hover {
	transform: none;
}

.mfc-iran-map {
	position: absolute;
	inset: 20px;
	width: calc(100% - 40px);
	height: calc(100% - 40px);
}

.mfc-water-body {
	fill: rgba(96, 165, 220, 0.16);
	stroke: rgba(96, 165, 220, 0.28);
	stroke-width: 0.6;
	pointer-events: none;
}

.mfc-province-path {
	fill: rgba(255, 255, 255, 0.05);
	stroke: rgba(245, 242, 232, 0.32);
	stroke-width: 1.2;
	stroke-linejoin: round;
	cursor: pointer;
	transition: fill 0.18s ease;
	outline: none;
}

.mfc-province-path:hover,
.mfc-province-path:focus-visible {
	fill: rgba(255, 205, 17, 0.3);
}

.mfc-province-path[data-has-reps="1"] {
	stroke: rgba(212, 175, 55, 0.55);
}

.mfc-province-path.is-active {
	fill: rgba(255, 205, 17, 0.45);
	stroke: var(--mfc-accent);
	stroke-width: 1.8;
}

.mfc-map-hover-label {
	position: absolute;
	transform: translate(-50%, -130%);
	background: #1e1a13;
	border: 1px solid var(--mfc-border);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 8px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
	z-index: 2;
}

.mfc-map-card-panel {
	padding: 26px;
	min-height: 320px;
}

.mfc-map-card-panel:hover {
	transform: none;
}

.mfc-map-card-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 260px;
	color: var(--mfc-text-dim);
	text-align: center;
}

.mfc-map-panel-title {
	font-size: 18px;
	font-weight: 800;
	margin: 0 0 4px;
	color: var(--mfc-text);
}

.mfc-map-panel-count {
	color: var(--mfc-accent);
	font-size: 13px;
	margin: 0 0 18px;
}

.mfc-mini-rep-card {
	background: var(--mfc-surface-strong);
	border: 1px solid var(--mfc-border-soft);
	border-radius: 14px;
	padding: 14px;
	margin-bottom: 12px;
}

.mfc-mini-rep-card strong {
	display: block;
	font-size: 15px;
	margin-bottom: 4px;
	color: var(--mfc-text);
}

.mfc-mini-rep-card span {
	display: block;
	font-size: 13px;
	color: var(--mfc-text-dim);
}

/* ===================== SEARCH ===================== */
.mfc-search-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: end;
	padding: 24px;
	margin-bottom: 40px;
}

.mfc-search-bar:hover {
	transform: none;
}

.mfc-search-field {
	flex: 1;
	min-width: 180px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mfc-search-field label {
	font-size: 13px;
	color: var(--mfc-text-dim);
	font-weight: 600;
}

.mfc-search-field input,
.mfc-search-field select,
.mfc-form-field input,
.mfc-form-field select,
.mfc-form-field textarea {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--mfc-border-soft);
	border-radius: 12px;
	padding: 12px 14px;
	color: var(--mfc-text);
	font-family: inherit;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.mfc-search-field input:focus,
.mfc-search-field select:focus,
.mfc-form-field input:focus,
.mfc-form-field select:focus,
.mfc-form-field textarea:focus {
	border-color: var(--mfc-accent);
	background: rgba(255, 255, 255, 0.1);
}

.mfc-search-field select option,
.mfc-form-field select option {
	color: #111;
}

.mfc-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: 22px;
}

.mfc-rep-card {
	padding: 22px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mfc-rep-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 26px 54px rgba(0, 0, 0, 0.42);
}

.mfc-rep-card-top {
	display: flex;
	align-items: center;
	gap: 14px;
}

.mfc-rep-logo {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	object-fit: cover;
	background: var(--mfc-surface-strong);
	flex-shrink: 0;
}

.mfc-rep-logo-fallback {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--mfc-accent), var(--mfc-accent-2));
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mfc-accent-ink);
	font-weight: 800;
	flex-shrink: 0;
}

.mfc-rep-name {
	font-size: 16px;
	font-weight: 800;
	margin: 0;
	color: var(--mfc-text);
}

.mfc-rep-meta {
	font-size: 13px;
	color: var(--mfc-text-dim);
	margin: 0;
}

.mfc-rep-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.mfc-rep-tag {
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(255, 205, 17, 0.1);
	color: var(--mfc-accent);
	border: 1px solid rgba(255, 205, 17, 0.24);
}

.mfc-rep-actions {
	display: flex;
	gap: 10px;
	margin-top: 10px;
}

.mfc-rep-actions a {
	flex: 1;
	text-align: center;
	font-size: 13px;
	padding: 10px;
	border-radius: 10px;
	text-decoration: none;
	font-weight: 700;
	border: 1px solid var(--mfc-border-soft);
	color: var(--mfc-text);
	transition: all 0.2s ease;
}

.mfc-rep-actions a.mfc-rep-call {
	background: rgba(255, 205, 17, 0.12);
	border-color: rgba(255, 205, 17, 0.3);
	color: var(--mfc-accent);
}

.mfc-rep-actions a:hover {
	transform: translateY(-2px);
}

.mfc-no-results {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--mfc-text-dim);
	padding: 40px 0;
}

/* ===================== JOIN FORM ===================== */
.mfc-join-inner {
	padding: 46px;
}

.mfc-join-inner:hover {
	transform: none;
}

.mfc-form-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 18px;
	margin-bottom: 18px;
}

.mfc-form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mfc-form-field label {
	font-size: 13px;
	font-weight: 600;
	color: var(--mfc-text-dim);
}

.mfc-form-field-full {
	margin-bottom: 22px;
}

.mfc-form-message {
	margin-top: 16px;
	font-size: 14px;
	min-height: 20px;
}

.mfc-form-message.is-success { color: #6fcf7c; }
.mfc-form-message.is-error { color: #ff6b6b; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
	.mfc-map-layout {
		grid-template-columns: 1fr;
	}
	.mfc-form-grid {
		grid-template-columns: 1fr;
	}
	.mfc-join-inner {
		padding: 28px 20px;
	}
	.mfc-quicknav {
		margin-top: 78px;
	}
}

@media (max-width: 600px) {
	.mfc-rn-wrap {
		overflow-x: hidden;
	}
	.mfc-section {
		padding: 40px 16px;
	}
	.mfc-map-section {
		padding-top: 20px;
	}
	.mfc-quicknav {
		margin-top: 70px;
	}

	/* Home button + brand box shrink and drop to text-only compact pills. */
	.mfc-home-btn {
		top: 14px;
		left: 14px;
		padding: 8px 14px;
		font-size: 11.5px;
	}
	.mfc-brand {
		top: 14px;
		right: 14px;
		padding: 6px 12px;
	}
	.mfc-brand img {
		height: 20px;
	}
	.mfc-brand-text {
		font-size: 12px;
	}

	.mfc-quicknav {
		justify-content: flex-start;
		max-width: calc(100% - 20px);
		margin: -28px auto 0;
	}
	.mfc-quicknav a {
		padding: 9px 16px;
		font-size: 12.5px;
	}

	.mfc-search-bar {
		padding: 18px;
	}
	.mfc-search-field {
		min-width: 100%;
	}
	.mfc-btn,
	.mfc-search-field input,
	.mfc-search-field select,
	.mfc-form-field input,
	.mfc-form-field select,
	.mfc-form-field textarea {
		min-height: 46px;
	}
	#mfcSearchBtn {
		width: 100%;
	}

	.mfc-map-canvas-wrap {
		padding: 12px;
	}
	.mfc-join-inner {
		padding: 22px 16px;
	}
	.mfc-results-grid {
		grid-template-columns: 1fr;
	}
}
