.satrack-event-form,
.satrack-event-form * {
	box-sizing: border-box;
}

.satrack-event-form {
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	font-family: inherit;
	color: #071f3a;
}

.sef-card {
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid rgba(219, 229, 238, 0.9);
	border-radius: 28px;
	padding: 34px;
	box-shadow: 0 24px 70px rgba(7, 31, 58, 0.14);
	backdrop-filter: blur(10px);
}

.sef-topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	margin-bottom: 20px;
}

.sef-eyebrow {
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	border-radius: 999px;
	background: #eef6ff;
	color: #123e68;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sef-config-toggle {
	display: none;
	border: 1px solid #bddcff;
	background: #ffffff;
	color: #123e68;
	border-radius: 999px;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 800;
	cursor: pointer;
}

.satrack-event-form.is-configurable .sef-config-toggle {
	display: inline-flex;
}

.sef-title {
	margin: 0;
	color: #3c5f85;
	font-size: clamp(16px, 2.2vw, 26px);
	line-height: 1.1em;
	font-weight: 400;
}

.sef-title strong {
	color: #1a3752;
	font-weight: 800;
}

.sef-description {
	margin: 12px 0 0;
	color: #5b6f88;
	font-size: 16px;
	line-height: 1.6;
}

.sef-progress {
	width: 100%;
	height: 9px;
	margin: 24px 0 28px;
	background: #e8eef5;
	border-radius: 999px;
	overflow: hidden;
}

.sef-progress-bar {
	width: 0%;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #123e68, #4080f8);
	transition: width 0.28s ease;
}

.sef-step {
	display: none;
	animation: sefFade 0.22s ease;
}

.sef-step.is-active {
	display: block;
}

@keyframes sefFade {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.sef-step-label {
	display: block;
	margin-bottom: 4px;
	color: #667e94;
	font-size: 0.7rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.sef-step h3 {
	margin: 0 0 16px;
	color: #27394e;
	font-size: 1.3rem;
	line-height: 1.2;
	font-weight: 700;
}

.sef-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.sef-field {
	position: relative;
	margin-bottom: 16px;
}

.sef-field.is-hidden {
	display: none !important;
}

.sef-field label {
	display: block;
	margin: 0 0 8px;
	color: #071f3a;
	font-size: 14px;
	font-weight: 800;
}

.sef-field input,
.sef-field select,
.sef-field textarea {
	width: 100%;
	min-height: 52px;
	border: 1px solid #dbe5ee;
	border-radius: 16px;
	background: #ffffff;
	padding: 13px 44px 13px 15px;
	color: #1d2b3a;
	font-size: 15px;
	outline: none;
	transition:
		border-color 0.18s ease,
		box-shadow 0.18s ease,
		background 0.18s ease;
}

.sef-field textarea {
	min-height: 110px;
	resize: vertical;
}

.sef-field input:focus,
.sef-field select:focus,
.sef-field textarea:focus {
	border-color: #4080f8;
	box-shadow: 0 0 0 4px rgba(64, 128, 248, 0.12);
}

.sef-field.is-valid input,
.sef-field.is-valid select,
.sef-field.is-valid textarea {
	border-color: #028d94;
	background: #f8fffe;
}

.sef-field.is-error input,
.sef-field.is-error select,
.sef-field.is-error textarea {
	border-color: #b80505;
	background: #fffafa;
}

.sef-dot {
	position: absolute;
	right: 16px;
	top: 43px;
	width: 10px;
	height: 10px;
	border-radius: 999px;
	background: transparent;
}

.sef-field.is-valid .sef-dot {
	background: #028d94;
}

.sef-field.is-error .sef-dot {
	background: #b80505;
}

.sef-error-msg {
	display: none;
	position: absolute;
	right: 8px;
	top: -6px;
	max-width: 260px;
	padding: 8px 10px;
	border-radius: 10px;
	background: #b80505;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	z-index: 2;
	box-shadow: 0 8px 24px rgba(184, 5, 5, 0.18);
}

.sef-field.is-error .sef-error-msg {
	display: block;
}

.sef-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

.sef-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	border-radius: 999px;
	border: 0;
	padding: 13px 22px;
	font-size: 15px;
	font-weight: 850;
	cursor: pointer;
	text-decoration: none;
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		background 0.18s ease;
}

.sef-btn:hover {
	transform: translateY(-1px);
}

.sef-btn-primary {
	background: #123e68;
	color: #ffffff;
	box-shadow: 0 12px 28px rgba(18, 62, 104, 0.18);
}

.sef-btn-secondary {
	background: #ffffff;
	color: #123e68;
	border: 1px solid #bddcff;
}

.sef-btn-danger {
	background: #b80505;
	color: #ffffff;
}

.sef-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

.sef-feedback {
	display: none;
	margin-top: 18px;
	padding: 15px 18px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	font-weight: 700;
}

.sef-feedback.is-visible {
	display: block;
}

.sef-feedback.is-success {
	background: #d8f1ee;
	border: 1px solid #4eecda;
	color: #028d94;
}

.sef-feedback.is-error {
	background: #fcebeb;
	border: 1px solid #fad4c6;
	color: #b80505;
}

.sef-config-panel {
	display: none;
	margin-top: 24px;
	padding: 24px;
	border-radius: 24px;
	background: #eef6ff;
	border: 1px solid #bddcff;
}

.satrack-event-form.is-admin-mode .sef-form-view {
	display: none;
}

.satrack-event-form.is-admin-mode .sef-config-panel {
	display: block;
}

.sef-config-panel h3 {
	margin: 0 0 14px;
	color: #071f3a;
	font-size: 24px;
	font-weight: 850;
}

.sef-config-section {
	margin-top: 18px;
	padding: 18px;
	border-radius: 18px;
	background: #ffffff;
	border: 1px solid #dbe5ee;
}

.sef-config-section h4 {
	margin: 0 0 12px;
	color: #071f3a;
	font-size: 17px;
	font-weight: 850;
}

/* ================================
   Panel administrador mejorado
   ================================ */

.sef-config-panel {
	max-width: 100%;
}

.sef-config-section {
	margin-top: 18px;
	display: grid;
	gap: 10px;
	padding: 22px;
	border-radius: 22px;
	background: #ffffff;
	border: 1px solid #dbe5ee;
}

.sef-config-section h4 {
	margin: 0 0 16px;
	color: #071f3a;
	font-size: 19px;
	line-height: 1.25;
	font-weight: 850;
}

.sef-config-list {
	display: grid;
	gap: 0px;
	margin-bottom: 16px;
}

.sef-config-item-card {
	display: grid;
	gap: 12px;
	padding: 18px;
	border-radius: 18px;
	background: #f8fbfd;
	border: 1px solid #dbe5ee;
}

.sef-config-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.sef-config-label {
	display: block;
	margin: 4px 0 -4px;
	color: #071f3a;
	font-size: 13px;
	line-height: 1.4;
	font-weight: 850;
}

.sef-config-item-card input[type="text"],
.sef-config-item-card input[type="url"],
.sef-config-item-card textarea,
.sef-config-item-card select,
.sef-config-section > input,
.sef-config-section > textarea,
.sef-config-section > select,
.sef-config-section .sef-field input,
.sef-config-section .sef-field textarea,
.sef-config-section .sef-field select {
	width: 100%;
	min-height: 46px;
	border: 1px solid #dbe5ee;
	border-radius: 14px;
	padding: 11px 14px;
	color: #071f3a;
	background: #ffffff;
	font-size: 15px;
	outline: none;
}

.sef-config-item-card textarea {
	min-height: 92px;
	resize: vertical;
}

.sef-toggle-line {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: #071f3a;
	font-weight: 850;
}

.sef-toggle-line input[type="checkbox"] {
	width: 22px;
	height: 22px;
	accent-color: #123e68;
}

.sef-icon-danger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	border: 0;
	border-radius: 999px;
	padding: 9px 16px;
	background: #b80505;
	color: #ffffff;
	font-size: 13px;
	font-weight: 850;
	cursor: pointer;
}

.sef-icon-danger:hover {
	filter: brightness(0.95);
}

.sef-config-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	min-width: 24px;
	padding: 0;
	border-radius: 999px;
	border: 0;
	background: #c50404;
	color: #ffffff;
	font-size: 18px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition:
		filter 0.18s ease,
		transform 0.18s ease;
}

.sef-config-remove:hover {
	filter: brightness(0.9);
	transform: translateY(-1px);
}

.sef-config-item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 10px 20px;
	background: #f8fbfd;
	border: 1px solid #dbe5ee;
}

.sef-config-list .sef-config-item:first-child {
	border-radius: 16px 16px 0 0;
}

.sef-config-list .sef-config-item:last-child {
	border-radius: 0 0 16px 16px;
}

.sef-config-item label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: #071f3a;
	font-weight: 800;
	white-space: nowrap;
}

.sef-config-checkbox {
	display: inline-grid;
	position: relative;
	width: 24px;
	height: 24px;
	padding: 4px;
	border: 1px solid #dbe5ee;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	align-items: center;
	justify-items: center;
}

.sef-config-checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	margin: 0;
	cursor: pointer;
}

.sef-config-checkbox span {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 3px;
	border: 1px solid #9db3c8;
	background: #fff;
	position: relative;
	transition: all 0.15s ease;
}

.sef-config-checkbox span::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	opacity: 0;
	transition:
		transform 0.15s ease,
		opacity 0.15s ease;
}

.sef-config-checkbox input[type="checkbox"]:checked + span {
	border-color: #123e68;
	background: #123e68;
}

.sef-config-checkbox input[type="checkbox"]:checked + span::after {
	transform: rotate(45deg) scale(1);
	opacity: 1;
}

.sef-config-item input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: #123e68;
}

.sef-config-item input[type="text"] {
	width: 100%;
	min-height: 44px;
	border: 1px solid #dbe5ee;
	border-radius: 12px;
	padding: 10px 12px;
}

.sef-config-item .sef-btn-danger {
	min-height: 40px;
	padding: 9px 14px;
	font-size: 13px;
	background: #b80505;
	color: #ffffff;
}

.sef-config-item input,
.sef-config-item textarea,
.sef-config-item select,
.sef-config-section input,
.sef-config-section textarea,
.sef-config-section select {
	width: 100%;
	min-height: 44px;
	border: 1px solid #dbe5ee;
	border-radius: 12px;
	padding: 10px 12px;
}

.sef-small-help {
	margin: 4px 0 0;
	color: #5b6f88;
	font-size: 12px;
	line-height: 1.5;
}

@media (max-width: 767px) {
	.sef-card {
		padding: 24px 18px;
		border-radius: 22px;
	}

	.sef-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.sef-nav {
		flex-direction: column;
	}

	.sef-btn {
		width: 100%;
	}

	.sef-topbar {
		align-items: flex-start;
		flex-direction: column;
	}

	.sef-config-item {
		grid-template-columns: 1fr;
	}
}

/* ================================
   Loader guardado administrador
   ================================ */

.sef-config-panel {
	position: relative;
}

.sef-config-loader {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 20;
	align-items: center;
	justify-content: center;
	padding: 24px;
	border-radius: 24px;
	background: rgba(238, 246, 255, 0.78);
	backdrop-filter: blur(5px);
}

.sef-config-panel.is-saving .sef-config-loader {
	display: flex;
}

.sef-config-panel.is-saving .sef-config-section,
.sef-config-panel.is-saving .sef-nav,
.sef-config-panel.is-saving > h3,
.sef-config-panel.is-saving > .sef-description {
	opacity: 0.45;
	pointer-events: none;
	user-select: none;
}

.sef-loader-card {
	width: min(100%, 360px);
	padding: 28px 24px;
	border-radius: 22px;
	background: #ffffff;
	border: 1px solid #bddcff;
	box-shadow: 0 24px 70px rgba(7, 31, 58, 0.18);
	text-align: center;
}

.sef-loader-card strong {
	display: block;
	margin-top: 14px;
	color: #071f3a;
	font-size: 18px;
	font-weight: 850;
}

.sef-loader-card small {
	display: block;
	margin-top: 8px;
	color: #5b6f88;
	font-size: 13px;
	line-height: 1.5;
	font-weight: 650;
}

.sef-loader-spinner {
	display: inline-block;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	border: 4px solid #dbeafe;
	border-top-color: #123e68;
	animation: sefSpin 0.75s linear infinite;
}

@keyframes sefSpin {
	to {
		transform: rotate(360deg);
	}
}

.sef-config-item-interest {
	grid-template-columns: auto 1.4fr 0.7fr auto;
}

@media (max-width: 767px) {
	.sef-config-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.sef-icon-danger {
		width: 100%;
	}

	.sef-config-item,
	.sef-config-item-interest {
		grid-template-columns: 1fr;
	}

	.sef-config-item .sef-btn-danger {
		width: 100%;
	}
}

.sef-field:not(.is-valid):not(.is-error) .sef-dot {
	background: transparent !important;
}

#cfgEventsList .sef-config-item {
	grid-template-columns: auto 1fr 120px auto;
}

#cfgEventsList [data-event-prefix] {
	text-transform: uppercase;
	text-align: center;
	font-weight: 850;
	letter-spacing: 0.08em;
}

@media (max-width: 767px) {
	#cfgEventsList .sef-config-item {
		grid-template-columns: 1fr;
	}

	#cfgEventsList [data-event-prefix] {
		text-align: left;
	}
}

.satrack-event-form {
	scroll-margin-top: 120px;
}

.sef-step {
	min-height: 260px;
}
