/*
 * BGA Membership plugin front-end styles.
 * Tokens mirror the site's active Novamira design system
 * ("BGA Horse — Engineered Arena Standard"): navy authority + one warm
 * orange accent, Vazirmatn everywhere, full-pill buttons, tinted shadows,
 * no scroll-triggered motion (hover-only, by deliberate brand choice).
 */
:root {
	--bga-bg: #161824;
	--bga-bg-dark: #0d0e16;
	--bga-bg-light: #2b2e42;
	--bga-accent-1: #ff6e03;
	--bga-accent-2: #ffa54d;
	--bga-accent-mid: #ff8a3d;
	--bga-ivory: #f7f4ee;
	--bga-ivory-dark: #efe9db;
	--bga-text: #575349;
	--bga-text-light: #8a867b;
	--bga-white: #ffffff;
	--bga-border: #e4dfd3;
	--bga-success: #2e7d4f;
	--bga-danger: #c0392b;
	--bga-font: "Vazirmatn", sans-serif;
	--bga-radius-sm: 6px;
	--bga-radius-md: 14px;
	--bga-radius-lg: 28px;
	--bga-radius-pill: 999px;
}

.bga-wrap {
	font-family: var(--bga-font);
	color: var(--bga-text);
	direction: rtl;
	text-align: right;
}

.bga-wrap * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------- */
.bga-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	border-radius: var(--bga-radius-pill);
	font-family: var(--bga-font);
	font-weight: 700;
	font-size: 15px;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.bga-btn-primary {
	background: linear-gradient(135deg, var(--bga-accent-1), var(--bga-accent-2));
	color: var(--bga-bg-dark);
	box-shadow: 0 8px 24px rgba(255, 110, 3, 0.28);
}

.bga-btn-primary:hover {
	box-shadow: 0 10px 30px rgba(255, 110, 3, 0.42);
	transform: translateY(-1px);
	color: var(--bga-bg-dark);
}

.bga-btn-ghost {
	background: transparent;
	border: 2px solid var(--bga-border);
	color: var(--bga-bg);
}

.bga-btn-ghost:hover {
	background: var(--bga-bg);
	color: var(--bga-white);
	border-color: var(--bga-bg);
}

.bga-btn:disabled,
.bga-btn.bga-btn-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* ---------------------------------------------------------------------
 * Login card (glassmorphism, matches the sign-in-card-2 reference brief)
 * ------------------------------------------------------------------- */
.bga-login-screen {
	min-height: 640px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 64px 20px;
	background: radial-gradient(circle at 30% 20%, rgba(255, 138, 61, 0.18), transparent 55%),
		radial-gradient(circle at 80% 80%, rgba(255, 110, 3, 0.14), transparent 50%),
		var(--bga-bg);
	border-radius: var(--bga-radius-lg);
}

.bga-login-card {
	width: 100%;
	max-width: 400px;
	padding: 48px 36px;
	border-radius: var(--bga-radius-lg);
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
	text-align: center;
}

.bga-login-logo {
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	border-radius: var(--bga-radius-md);
	background: linear-gradient(135deg, var(--bga-accent-1), var(--bga-accent-2));
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
}

.bga-login-title {
	color: var(--bga-white);
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 8px;
}

.bga-login-subtitle {
	color: rgba(255, 255, 255, 0.6);
	font-size: 14px;
	margin: 0 0 32px;
	line-height: 1.7;
}

.bga-google-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 14px 20px;
	border-radius: var(--bga-radius-pill);
	background: var(--bga-white);
	color: #1f1f1f;
	font-family: var(--bga-font);
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
	border: 1px solid transparent;
	transition: box-shadow 0.25s ease, transform 0.15s ease;
}

.bga-google-btn:hover {
	box-shadow: 0 0 0 4px rgba(255, 165, 77, 0.35), 0 12px 30px rgba(255, 110, 3, 0.25);
	transform: translateY(-1px);
	color: #1f1f1f;
}

.bga-login-note {
	margin-top: 28px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.4);
	line-height: 1.8;
}

/* ---------------------------------------------------------------------
 * Status pills / badges
 * ------------------------------------------------------------------- */
.bga-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 14px;
	border-radius: var(--bga-radius-pill);
	font-size: 12px;
	font-weight: 700;
}

.bga-pill-pending {
	background: rgba(255, 138, 61, 0.14);
	color: #b54d00;
}

.bga-pill-approved {
	background: rgba(46, 125, 79, 0.14);
	color: var(--bga-success);
}

.bga-pill-rejected {
	background: rgba(192, 57, 43, 0.12);
	color: var(--bga-danger);
}

.bga-badge-champion {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border-radius: var(--bga-radius-pill);
	background: linear-gradient(135deg, var(--bga-accent-1), var(--bga-accent-2));
	color: var(--bga-bg-dark);
	font-size: 12px;
	font-weight: 700;
}

/* ---------------------------------------------------------------------
 * Dashboard
 * ------------------------------------------------------------------- */
.bga-dashboard-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 28px 32px;
	background: var(--bga-bg);
	border-radius: var(--bga-radius-lg);
	color: var(--bga-white);
	margin-bottom: 32px;
}

.bga-dashboard-header h2 {
	margin: 0 0 6px;
	font-size: 20px;
}

.bga-dashboard-header p {
	margin: 0;
	color: rgba(255, 255, 255, 0.65);
	font-size: 14px;
}

.bga-listing-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--bga-white);
	border-radius: var(--bga-radius-md);
	overflow: hidden;
	border: 1px solid var(--bga-border);
}

.bga-listing-table th,
.bga-listing-table td {
	padding: 14px 18px;
	text-align: right;
	border-bottom: 1px solid var(--bga-border);
	font-size: 14px;
}

.bga-listing-table th {
	background: var(--bga-ivory);
	font-weight: 700;
}

.bga-empty-state {
	text-align: center;
	padding: 48px 24px;
	background: var(--bga-ivory);
	border-radius: var(--bga-radius-lg);
	color: var(--bga-text-light);
}

.bga-notice {
	padding: 14px 18px;
	border-radius: var(--bga-radius-sm);
	margin-bottom: 20px;
	font-size: 14px;
}

.bga-notice-error {
	background: rgba(192, 57, 43, 0.08);
	color: var(--bga-danger);
	border: 1px solid rgba(192, 57, 43, 0.2);
}

.bga-notice-success {
	background: rgba(46, 125, 79, 0.08);
	color: var(--bga-success);
	border: 1px solid rgba(46, 125, 79, 0.2);
}

/* ---------------------------------------------------------------------
 * Forms (profile completion + submit listing)
 * ------------------------------------------------------------------- */
.bga-form-card {
	background: var(--bga-white);
	border: 1px solid var(--bga-border);
	border-radius: var(--bga-radius-lg);
	padding: 32px;
	max-width: 720px;
}

.bga-field {
	margin-bottom: 20px;
}

.bga-field label {
	display: block;
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 8px;
	color: var(--bga-bg);
}

.bga-input,
.bga-select,
.bga-textarea,
.bga-field input[type="text"],
.bga-field input[type="number"],
.bga-field input[type="tel"],
.bga-field input[type="url"],
.bga-field select,
.bga-field textarea {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--bga-border);
	border-radius: var(--bga-radius-sm);
	font-family: var(--bga-font);
	font-size: 14px;
	background: var(--bga-white);
	color: var(--bga-bg);
}

.bga-input:focus,
.bga-field input:focus,
.bga-field select:focus,
.bga-field textarea:focus {
	outline: none;
	border-color: var(--bga-accent-mid);
	box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.15);
}

.bga-input-full {
	grid-column: 1 / -1;
}

.bga-radio-group {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.bga-radio-option {
	flex: 1;
	min-width: 160px;
	border: 2px solid var(--bga-border);
	border-radius: var(--bga-radius-md);
	padding: 16px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.bga-radio-option:has(input:checked) {
	border-color: var(--bga-accent-mid);
	background: rgba(255, 138, 61, 0.06);
}

.bga-radio-option input {
	margin-inline-end: 8px;
}

.bga-fields-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.bga-birthdate-selects {
	display: flex;
	gap: 8px;
}

/* Numbered sections in the submit-listing form */
.bga-form-section {
	border-top: 1px solid var(--bga-border);
	padding-top: 24px;
	margin-top: 28px;
}

.bga-form-section:first-of-type {
	border-top: none;
	padding-top: 0;
	margin-top: 0;
}

.bga-form-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	font-size: 16px;
	font-weight: 700;
	color: var(--bga-bg);
}

.bga-form-section-title span {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--bga-accent-1), var(--bga-accent-2));
	color: var(--bga-white);
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.bga-submit-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	border-top: 1px solid var(--bga-border);
	margin-top: 28px;
	padding-top: 24px;
}

.bga-submit-bar p {
	margin: 0;
	font-size: 13px;
	color: var(--bga-text-light);
	max-width: 460px;
	line-height: 1.7;
}

/* "Sell your horse" banner at the top of the marketplace page */
.bga-sell-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	background: var(--bga-bg);
	border-radius: var(--bga-radius-lg);
	padding: 28px 32px;
	margin-bottom: 28px;
}

.bga-sell-cta-text h3 {
	margin: 0 0 6px;
	color: var(--bga-white);
	font-size: 20px;
	font-weight: 700;
}

.bga-sell-cta-text p {
	margin: 0;
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	max-width: 560px;
	line-height: 1.7;
}

.bga-sell-cta .bga-btn {
	flex-shrink: 0;
}

@media (max-width: 640px) {
	.bga-sell-cta {
		padding: 22px;
	}

	.bga-sell-cta .bga-btn {
		width: 100%;
		text-align: center;
	}
}

.bga-birthdate-selects select {
	flex: 1;
	min-width: 0;
}

@media (max-width: 640px) {
	.bga-fields-grid {
		grid-template-columns: 1fr;
	}
}

/* Achievements repeater */
.bga-ach-repeater {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 16px;
}

.bga-ach-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--bga-ivory);
	border: 1px solid var(--bga-border);
	border-radius: var(--bga-radius-md);
	padding: 16px;
}

.bga-ach-row-fields {
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr 120px;
	gap: 10px;
}

.bga-ach-row-fields .bga-input-full {
	grid-column: 1 / -1;
}

.bga-ach-remove {
	background: var(--bga-white);
	border: 1px solid var(--bga-border);
	border-radius: 50%;
	width: 28px;
	height: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--bga-danger);
	font-size: 16px;
}

/* Gallery picker */
.bga-gallery-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}

.bga-gallery-thumb {
	position: relative;
	width: 84px;
	height: 84px;
	border-radius: var(--bga-radius-sm);
	overflow: hidden;
	border: 1px solid var(--bga-border);
}

.bga-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bga-gallery-remove {
	position: absolute;
	top: 2px;
	left: 2px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	font-size: 12px;
	cursor: pointer;
	line-height: 1;
}

/* ---------------------------------------------------------------------
 * Marketplace grid
 * ------------------------------------------------------------------- */
.bga-marketplace-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 20px;
	background: var(--bga-ivory);
	border-radius: var(--bga-radius-lg);
	margin-bottom: 28px;
}

.bga-marketplace-filters select,
.bga-marketplace-filters input {
	padding: 10px 14px;
	border-radius: var(--bga-radius-sm);
	border: 1px solid var(--bga-border);
	font-family: var(--bga-font);
	background: var(--bga-white);
}

.bga-marketplace-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

@media (max-width: 960px) {
	.bga-marketplace-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.bga-marketplace-grid {
		grid-template-columns: 1fr;
	}
}

.bga-listing-card {
	display: block;
	background: var(--bga-white);
	border: 1px solid var(--bga-border);
	border-radius: var(--bga-radius-md);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bga-listing-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 34px rgba(22, 24, 36, 0.14);
	border-color: transparent;
	color: inherit;
}

.bga-listing-card-image {
	height: 200px;
	background-size: cover;
	background-position: center;
	background-color: var(--bga-ivory-dark);
	position: relative;
}

.bga-listing-card-image .bga-badge-champion {
	position: absolute;
	top: 12px;
	right: 12px;
}

.bga-listing-card-body {
	padding: 18px;
}

.bga-listing-card-title {
	font-weight: 700;
	font-size: 16px;
	margin: 0 0 6px;
	color: var(--bga-bg);
}

.bga-listing-card-meta {
	font-size: 13px;
	color: var(--bga-text-light);
	margin: 0 0 10px;
}

.bga-listing-card-price {
	font-weight: 700;
	color: var(--bga-accent-1);
	font-size: 15px;
}

/* ---------------------------------------------------------------------
 * Single listing
 * ------------------------------------------------------------------- */
.bga-single-listing {
	margin-top: 32px;
}

.bga-single-gallery {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin-bottom: 28px;
}

.bga-single-gallery img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: var(--bga-radius-sm);
}

.bga-single-specs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 28px;
}

.bga-spec-item {
	background: var(--bga-ivory);
	border-radius: var(--bga-radius-md);
	padding: 16px;
}

.bga-spec-label {
	font-size: 12px;
	color: var(--bga-text-light);
	margin-bottom: 4px;
}

.bga-spec-value {
	font-weight: 700;
	color: var(--bga-bg);
}

.bga-achievements-block {
	background: linear-gradient(135deg, rgba(255, 110, 3, 0.08), rgba(255, 165, 77, 0.08));
	border: 1px solid rgba(255, 138, 61, 0.3);
	border-radius: var(--bga-radius-lg);
	padding: 24px;
	margin-bottom: 28px;
}

.bga-achievements-block h3 {
	margin-top: 0;
	color: var(--bga-bg);
}

.bga-achievement-item {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255, 138, 61, 0.2);
}

.bga-achievement-item:last-child {
	border-bottom: none;
}

.bga-achievement-icon {
	font-size: 20px;
}

/* ---------------------------------------------------------------------
 * Site-wide login popup (modal) + floating trigger
 * ------------------------------------------------------------------- */
.bga-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(13, 14, 22, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
	font-family: var(--bga-font);
	direction: rtl;
}

.bga-modal-overlay.bga-modal-open {
	opacity: 1;
	visibility: visible;
}

body.bga-modal-no-scroll {
	overflow: hidden;
}

.bga-modal-panel {
	position: relative;
	width: 100%;
	max-width: 400px;
	transform: translateY(12px) scale(0.98);
	transition: transform 0.2s ease;
}

.bga-modal-overlay.bga-modal-open .bga-modal-panel {
	transform: translateY(0) scale(1);
}

.bga-modal-panel .bga-login-card {
	width: 100%;
	max-width: none;
	padding: 48px 36px;
	border-radius: var(--bga-radius-lg);
	background: rgba(22, 24, 36, 0.92);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
	text-align: center;
}

.bga-modal-close {
	position: absolute;
	top: -14px;
	left: -14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--bga-white);
	color: var(--bga-bg);
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.bga-floating-login {
	position: fixed;
	bottom: 24px;
	left: 24px;
	z-index: 99999;
	padding: 14px 28px;
	border-radius: var(--bga-radius-pill);
	background: linear-gradient(135deg, var(--bga-accent-1), var(--bga-accent-2));
	color: var(--bga-bg-dark);
	font-family: var(--bga-font);
	font-weight: 700;
	font-size: 15px;
	border: none;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(255, 110, 3, 0.35);
	transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.bga-floating-login:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 34px rgba(255, 110, 3, 0.45);
}

@media (max-width: 640px) {
	.bga-floating-login {
		bottom: 16px;
		left: 16px;
		padding: 12px 22px;
		font-size: 14px;
	}
}

/* ------------------------------------------------------------------
 * Header account chip — shown instead of the "درخواست مشاوره" button
 * once someone is logged in (see includes/shortcodes.php,
 * bga_shortcode_header_account()).
 * ------------------------------------------------------------------ */
.bga-header-account {
	position: relative;
	font-family: var(--bga-font);
	direction: rtl;
}

.bga-header-account-trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--bga-bg);
	border: none;
	border-radius: var(--bga-radius-pill);
	padding: 6px 14px 6px 6px;
	cursor: pointer;
	font-family: inherit;
}

.bga-header-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--bga-accent-1), var(--bga-accent-2));
	color: var(--bga-white);
	font-weight: 700;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.bga-header-username {
	color: var(--bga-white);
	font-size: 13px;
	font-weight: 600;
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bga-header-account-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 160px;
	background: var(--bga-white);
	border-radius: var(--bga-radius-md);
	box-shadow: 0 14px 34px rgba(22, 24, 36, 0.18);
	padding: 6px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 100;
}

.bga-header-account-open .bga-header-account-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.bga-header-account-menu a {
	display: block;
	padding: 9px 12px;
	border-radius: var(--bga-radius-sm);
	color: var(--bga-text);
	font-size: 13px;
	text-decoration: none;
}

.bga-header-account-menu a:hover {
	background: var(--bga-ivory);
	color: var(--bga-bg);
}

/* Compact header "sign in" button shown to logged-out visitors */
.bga-header-login {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 18px;
	border: none;
	border-radius: var(--bga-radius-pill);
	background: var(--bga-bg);
	color: var(--bga-white);
	font-family: var(--bga-font);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
	transition: background 0.2s ease;
}

.bga-header-login:hover {
	background: var(--bga-accent-1);
	color: var(--bga-bg-dark);
}

@media (max-width: 767px) {
	.bga-header-login {
		height: 32px;
		padding: 0 12px;
		font-size: 12px;
	}
}

/* Header language switcher (see bga_shortcode_lang_switch) */
.bga-lang-switch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--bga-border);
	border-radius: var(--bga-radius-pill);
	font-family: var(--bga-font);
	font-size: 13px;
	font-weight: 700;
	color: var(--bga-bg);
	text-decoration: none;
	line-height: 1;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bga-lang-switch:hover {
	background: var(--bga-bg);
	border-color: var(--bga-bg);
	color: var(--bga-white);
}

/*
 * On phones the header has to fit logo + menu toggle + language + account
 * in one row, so the account chip collapses to just its avatar. The name
 * is still one tap away inside the account menu.
 */
@media (max-width: 767px) {
	.bga-header-username {
		display: none;
	}

	.bga-header-account-trigger {
		padding: 4px;
	}

	.bga-lang-switch {
		min-width: 36px;
		height: 32px;
		padding: 0 9px;
		font-size: 12px;
	}
}
