/**
 * Fase G.4 — Modal de inscrição (design aprovado v1, escopo .velorun-g4-modal).
 */

body.velorun-g4-modal-open {
	overflow: hidden;
}

.velorun-g4-modal {
	--vr-g4-green: #33cc33;
	--vr-g4-dark: #05030d;
	--vr-g4-muted: #666;
	--vr-g4-line: #e1e1e1;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
}

.velorun-g4-modal[hidden] {
	display: none !important;
}

.velorun-g4-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(5, 3, 13, 0.62);
}

.velorun-g4-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(760px, calc(100vw - 28px));
	max-height: 88vh;
	overflow: auto;
	background: #fff;
	border-radius: 28px;
	box-shadow: 0 34px 120px rgba(0, 0, 0, 0.35);
}

.velorun-g4-modal__inner {
	padding: 30px;
}

.velorun-g4-modal__close {
	position: absolute;
	top: 18px;
	right: 20px;
	z-index: 2;
	border: 0;
	background: #f1f1f1;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	font-size: 27px;
	line-height: 1;
	cursor: pointer;
	color: var(--vr-g4-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.velorun-g4-modal-notices {
	margin: 0 50px 22px 0;
}

.velorun-g4-notice {
	display: grid;
	grid-template-columns: 30px 1fr;
	gap: 12px;
	border-radius: 18px;
	padding: 16px;
	color: var(--vr-g4-dark);
}

.velorun-g4-notice__ico {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 950;
	font-size: 14px;
	flex-shrink: 0;
}

.velorun-g4-notice__body strong,
.velorun-g4-notice__title {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
	font-weight: 950;
}

.velorun-g4-notice__content {
	display: block;
	min-width: 0;
}

.velorun-g4-notice__text,
.velorun-g4-notice__body > span {
	font-size: 14px;
	line-height: 1.45;
	display: block;
}

.velorun-g4-notice__lead {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.35;
}

.velorun-g4-notice__detail {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	opacity: 0.92;
}

.velorun-g4-notice__actions {
	display: grid;
	gap: 8px;
	margin-top: 14px;
}

.velorun-g4-notice--duplicate-cpf {
	border-radius: 14px;
	padding: 14px 16px;
}

.velorun-g4-notice--in-cart .velorun-g4-notice__actions,
.velorun-g4-notice--confirmed .velorun-g4-notice__actions {
	flex-wrap: wrap;
	gap: 10px;
}

.velorun-g4-notice--in-cart .velorun-g4-notice__link--ghost,
.velorun-g4-notice--confirmed .velorun-g4-notice__content a.velorun-g4-notice__link {
	background: transparent;
	border: 0;
	color: #1c4027;
	text-decoration: underline;
}

.velorun-g4-notice--in-cart .velorun-g4-notice__link--ghost {
	cursor: pointer;
}

.velorun-g4-notice--duplicate-cpf .velorun-g4-notice__actions {
	margin-top: 12px;
}

.velorun-g4-notice--duplicate-cpf .velorun-g4-notice__link {
	width: 100%;
	box-sizing: border-box;
	min-height: 42px;
	padding: 0 16px;
	font-size: 11px;
	font-weight: 950;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-align: center;
}

.velorun-g4-notice--duplicate-cpf .velorun-g4-notice__link--primary {
	box-shadow: 0 8px 20px rgba(5, 3, 13, 0.12);
}

.velorun-g4-notice--success {
	background: #e9faec;
	border: 1px solid rgba(51, 204, 51, 0.35);
	color: #164b21;
}

.velorun-g4-notice--success .velorun-g4-notice__ico {
	background: var(--vr-g4-green);
	color: #041005;
}

.velorun-g4-notice--error {
	background: #fdecea;
	border: 1px solid rgba(183, 28, 28, 0.25);
	color: #7f1d1d;
}

.velorun-g4-notice--error .velorun-g4-notice__ico {
	background: #e53935;
	color: #fff;
}

.velorun-g4-notice--warning {
	background: #fff8e6;
	border: 1px solid rgba(245, 158, 11, 0.35);
	color: #5c4a12;
}

.velorun-g4-notice--warning .velorun-g4-notice__ico {
	background: #f59e0b;
	color: #fff;
}

.velorun-g4-notice--info {
	background: #f3f4f6;
	border: 1px solid #ddd;
	color: #333;
}

.velorun-g4-notice--info .velorun-g4-notice__ico {
	background: #9ca3af;
	color: #fff;
}

.velorun-g4-notice__link {
	color: inherit;
	font-weight: 950;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.velorun-g4-notice__actions .velorun-g4-notice__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid currentColor;
	border-radius: 999px;
	text-decoration: none;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.velorun-g4-notice__actions .velorun-g4-notice__link--primary {
	background: #05030d;
	border-color: #05030d;
	color: #fff !important;
	text-decoration: none;
}

.velorun-g4-modal__kicker {
	display: inline-flex;
	gap: 9px;
	align-items: center;
	padding: 8px 14px;
	border: 1px solid #ddd;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 950;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--vr-g4-dark);
}

.velorun-g4-modal__kicker::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--vr-g4-green);
	box-shadow: 0 0 0 7px rgba(51, 204, 51, 0.16);
}

.velorun-g4-modal__title {
	font-size: clamp(32px, 4vw, 50px);
	line-height: 0.9;
	letter-spacing: -0.06em;
	text-transform: uppercase;
	margin: 18px 0 8px;
	color: var(--vr-g4-dark);
}

.velorun-g4-modal__subtitle,
.velorun-g4-modal__age {
	color: var(--vr-g4-muted);
	line-height: 1.5;
	margin: 0 0 20px;
	font-size: 15px;
}

.velorun-g4-modal__steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin: 22px 0;
}

.velorun-g4-modal__step-pill {
	height: 48px;
	border-radius: 999px;
	background: #f1f1f1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 950;
	text-transform: uppercase;
	color: var(--vr-g4-dark);
}

.velorun-g4-modal__step-pill.is-active {
	background: var(--vr-g4-dark);
	color: #fff;
}

.velorun-g4-section-title {
	font-size: 18px;
	font-weight: 950;
	text-transform: uppercase;
	margin: 26px 0 12px;
	color: var(--vr-g4-dark);
}

.velorun-g4-tabs {
	display: flex;
	gap: 8px;
	margin: 18px 0 16px;
}

.velorun-g4-tabs__btn {
	flex: 1;
	height: 48px;
	border: 1px solid var(--vr-g4-line);
	background: #f1f1f1;
	border-radius: 999px;
	cursor: pointer;
	font-weight: 950;
	font-size: 12px;
	text-transform: uppercase;
	color: var(--vr-g4-dark);
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.velorun-g4-tabs__btn.is-active {
	background: var(--vr-g4-dark);
	color: #fff;
	border-color: var(--vr-g4-dark);
}

.velorun-g4-modal--complete-profile .velorun-g4-tabs,
.velorun-g4-modal--complete-profile [data-vr-g4-form="login"],
.velorun-g4-modal--complete-profile [data-vr-g4-form="register"] {
	display: none !important;
}

.velorun-g4-complete-profile__title {
	margin-top: 0;
}

.velorun-g4-form--complete-profile input[readonly] {
	background: #f5f5f5;
	cursor: default;
}

.velorun-g4-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 12px;
	font-size: 13px;
	font-weight: 700;
	color: var(--vr-g4-dark);
}

.velorun-g4-form input,
.velorun-g4-form select {
	padding: 12px 14px;
	border: 2px solid var(--vr-g4-line);
	border-radius: 14px;
	font: inherit;
	background: #fff;
}

.velorun-g4-form input:focus,
.velorun-g4-form select:focus {
	outline: none;
	border-color: var(--vr-g4-green);
}

.velorun-g4-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 12px;
}

.velorun-g4-form__full {
	grid-column: 1 / -1;
}

.velorun-g4-form__forgot {
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.45;
	text-align: center;
}

.velorun-g4-form__forgot a {
	color: #0a5f16;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.velorun-g4-form__forgot a:hover {
	color: #064410;
}

.velorun-g4-form__remember {
	flex-direction: row;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.velorun-g4-routes,
.velorun-g4-categories__list {
	display: grid;
	gap: 12px;
}

.velorun-g4-categories__route {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 800;
	color: var(--vr-g4-green);
	line-height: 1.4;
}

.velorun-g4-categories__summary {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 900;
	color: var(--vr-g4-dark);
	line-height: 1.4;
}

.velorun-g4-categories__hint {
	margin: 0 0 14px;
	font-size: 13px;
	color: #666;
	line-height: 1.45;
}

.velorun-g4-categories__scroll {
	max-height: min(320px, 42vh);
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 4px;
	margin-bottom: 4px;
	scrollbar-gutter: stable;
}

.velorun-g4-categories__scroll.is-scrollable {
	box-shadow: inset 0 -18px 16px -14px rgba(5, 3, 13, 0.08);
}

.velorun-g4-categories__scroll-hint {
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 800;
	color: #555;
	text-align: center;
}

.velorun-g4-categories.has-categories .velorun-g4-modal__actions {
	margin-top: 16px;
}

.velorun-g4-route-card {
	display: block;
	width: 100%;
	text-align: left;
	border: 2px solid var(--vr-g4-line);
	border-radius: 18px;
	padding: 17px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.velorun-g4-route-card:hover:not(:disabled):not(.is-selected) {
	border-color: var(--vr-g4-green);
	transform: translateY(-2px);
}

.velorun-g4-route-card.is-selected {
	border-color: var(--vr-g4-dark);
	background: linear-gradient(90deg, rgba(51, 204, 51, 0.1), #fff 45%);
}

.velorun-g4-route-card.is-selected:hover {
	border-color: var(--vr-g4-dark);
	transform: none;
}

.velorun-g4-route-card:focus {
	outline: none;
}

.velorun-g4-route-card:focus-visible {
	outline: 2px solid var(--vr-g4-green);
	outline-offset: 2px;
}

.velorun-g4-route-card:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

.velorun-g4-route-card__name {
	display: block;
	font-size: 22px;
	font-weight: 950;
	margin: 0 0 8px;
	color: var(--vr-g4-dark);
}

.velorun-g4-route-card__chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.velorun-g4-route-card__chip {
	background: #f1f1f1;
	border-radius: 999px;
	padding: 7px 10px;
	font-size: 12px;
	font-weight: 800;
	color: var(--vr-g4-dark);
}

.velorun-g4-route-card__desc {
	display: block;
	font-size: 14px;
	color: #444;
	margin: 10px 0 0;
}

.velorun-g4-category-card {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	text-align: left;
	border: 2px solid var(--vr-g4-line);
	border-radius: 16px;
	padding: 15px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.velorun-g4-category-card:hover:not(:disabled) {
	border-color: var(--vr-g4-green);
	transform: translateY(-1px);
}

.velorun-g4-category-card.is-selected {
	border-color: var(--vr-g4-dark);
}

.velorun-g4-category-card:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.velorun-g4-category-card__name {
	font-weight: 950;
	color: var(--vr-g4-dark);
}

.velorun-g4-category-card__age {
	color: #666;
	font-size: 12px;
	font-weight: 800;
}

.velorun-g4-modal__actions {
	display: grid;
	gap: 10px;
	margin-top: 24px;
}

.velorun-g4-btn {
	height: 56px;
	border-radius: 999px;
	border: 1px solid var(--vr-g4-dark);
	background: #fff;
	font-weight: 950;
	text-transform: uppercase;
	cursor: pointer;
	width: 100%;
	font-size: 13px;
	letter-spacing: 0.02em;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.velorun-g4-btn--primary {
	background: var(--vr-g4-dark);
	color: #fff;
	box-shadow: 0 18px 42px rgba(5, 3, 13, 0.22);
}

.velorun-g4-btn--primary:hover:not(:disabled) {
	background: var(--vr-g4-green);
	color: #041005;
	border-color: var(--vr-g4-green);
}

.velorun-g4-btn--primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

.velorun-g4-btn--ghost:hover:not(:disabled) {
	border-color: var(--vr-g4-green);
	color: var(--vr-g4-dark);
}

.velorun-g4-modal__note {
	font-size: 13px;
	color: #777;
	line-height: 1.45;
	margin: 14px 0 0;
}

.velorun-g4-empty {
	margin: 0;
	color: #666;
	font-size: 14px;
}

.velorun-g4-modal.is-flow-blocked .velorun-g4-modal__steps,
.velorun-g4-modal.is-flow-blocked .velorun-g4-section-title,
.velorun-g4-modal.is-flow-blocked .velorun-g4-routes,
.velorun-g4-modal.is-flow-blocked .velorun-g4-categories {
	display: none !important;
}

.velorun-g4-category-card__age {
	display: block;
	margin-top: 6px;
}

.velorun-g4-meal {
	margin: 18px 0 8px;
	padding: 16px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 12px;
	background: rgba(248, 250, 252, 0.9);
}

.velorun-g4-meal__included {
	margin: 0 0 12px;
	font-size: 0.95rem;
	color: #0f172a;
}

.velorun-g4-meal__title {
	margin: 0 0 8px;
	font-size: 1rem;
	font-weight: 600;
}

.velorun-g4-meal__price,
.velorun-g4-meal__subtotal {
	margin: 0 0 10px;
	font-size: 0.95rem;
}

.velorun-g4-meal__qty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
	font-size: 0.95rem;
}

.velorun-g4-meal__qty select {
	min-width: 72px;
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px solid rgba(15, 23, 42, 0.15);
}

@media (max-width: 640px) {
	.velorun-g4-modal {
		align-items: flex-start;
		padding: 12px;
	}

	.velorun-g4-modal__dialog {
		margin-top: 18px;
		max-height: calc(100vh - 36px);
	}

	.velorun-g4-modal__inner {
		padding: 22px;
	}

	.velorun-g4-modal-notices {
		margin-right: 44px;
	}

	.velorun-g4-modal__steps {
		grid-template-columns: 1fr;
	}

	.velorun-g4-form__grid {
		grid-template-columns: 1fr;
	}

	.velorun-g4-category-card {
		display: block;
	}

	.velorun-g4-category-card__age {
		display: block;
		margin-top: 6px;
	}

	.velorun-g4-categories__scroll {
		max-height: min(260px, 38vh);
	}
}

/* Esconde modal legado do plugin quando G.4 está ativo na mesma página */
.vr-event-actions .vr-modal {
	display: none !important;
}

.velorun-g4-acceptance {
	margin-top: 18px;
	padding: 14px 16px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	background: rgba(70, 232, 90, 0.06);
}

.velorun-g4-acceptance__lead {
	margin: 0 0 10px;
	font-size: 14px;
	line-height: 1.45;
	color: #3d463f;
}

.velorun-g4-acceptance__label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 13.5px;
	line-height: 1.45;
	color: #1f2922;
	cursor: pointer;
}

.velorun-g4-acceptance__label input {
	margin-top: 3px;
	flex: 0 0 auto;
}

.velorun-g4-acceptance__label a {
	color: #0f6b2d;
	text-decoration: underline;
}

.velorun-g4-location__city-wrap {
	position: relative;
}

.velorun-g4-city-suggestions {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	top: calc(100% - 4px);
	margin: 0;
	padding: 6px 0;
	list-style: none;
	max-height: 220px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #d5dfd8;
	border-radius: 10px;
	box-shadow: 0 10px 24px rgba(20, 35, 25, 0.12);
}

.velorun-g4-city-suggestions li {
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.35;
	color: #1f2922;
	cursor: pointer;
}

.velorun-g4-city-suggestions li:hover,
.velorun-g4-city-suggestions li:focus {
	background: rgba(70, 232, 90, 0.12);
}

.velorun-g4-location__hint {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.35;
	color: #5f6b63;
}

.velorun-g4-location__hint--error,
.velorun-g4-location__hint.is-error {
	color: #b42318;
}

.velorun-g4-location.is-cep-loading [name="vr_cep"] {
	background-image: linear-gradient(90deg, rgba(0,0,0,0.03) 25%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.03) 75%);
	background-size: 200% 100%;
	animation: velorun-g4-cep-loading 1.2s ease-in-out infinite;
}

@keyframes velorun-g4-cep-loading {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
