/* Blast Forms — estilos del formulario. Todo se controla con variables --bstfm-*. */
.bstfm {
	--bstfm-field-bg: #ffffff;
	--bstfm-field-text: #191919;
	--bstfm-label: #6b6b6b;
	--bstfm-border: #d0d0d0;
	--bstfm-border-focus: #01b4c5;
	--bstfm-check-border: #01b4c5;
	--bstfm-check-fill: #01b4c5;
	--bstfm-radius: 6px;
	--bstfm-border-width: 1px;
	--bstfm-btn-bg: #01b4c5;
	--bstfm-btn-text: #191919;
	--bstfm-btn-hover: #0199a8;
	--bstfm-btn-radius: 6px;
	--bstfm-error: #d93636;
	--bstfm-success: #0a7f5a;
	--bstfm-gap: 16px;
	--bstfm-h: 56px;
	font-size: 16px;
	line-height: 1.4;
	width: 100%;
}
.bstfm *, .bstfm *::before, .bstfm *::after { box-sizing: border-box; }
.bstfm [hidden] { display: none !important; }
.bstfm-form { margin: 0; }

/* Grilla de 12 columnas */
.bstfm .bstfm-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--bstfm-gap); }
.bstfm-col-12 { grid-column: span 12; }
.bstfm-col-9 { grid-column: span 9; }
.bstfm-col-8 { grid-column: span 8; }
.bstfm-col-6 { grid-column: span 6; }
.bstfm-col-4 { grid-column: span 4; }
.bstfm-col-3 { grid-column: span 3; }
@media (max-width: 640px) {
	.bstfm-grid > .bstfm-field { grid-column: span 12; }
}
.bstfm-field { min-width: 0; }
.bstfm-field--html, .bstfm-field--consent { align-self: center; }

/* Control con label flotante */
.bstfm-control { position: relative; }
.bstfm .bstfm-control input,
.bstfm .bstfm-control select,
.bstfm .bstfm-control textarea {
	display: block;
	width: 100%;
	min-height: var(--bstfm-h);
	margin: 0;
	padding: 24px 14px 8px;
	background: var(--bstfm-field-bg);
	color: var(--bstfm-field-text);
	border: var(--bstfm-border-width) solid var(--bstfm-border);
	border-radius: var(--bstfm-radius);
	font: inherit;
	font-size: 16px;
	line-height: 1.3;
	box-shadow: none;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.bstfm .bstfm-control textarea { min-height: 120px; resize: vertical; padding-top: 28px; }
.bstfm .bstfm-control select {
	padding-right: 40px;
	cursor: pointer;
	background-image: linear-gradient(45deg, transparent 50%, var(--bstfm-label) 50%), linear-gradient(135deg, var(--bstfm-label) 50%, transparent 50%);
	background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}
.bstfm-control select:disabled { cursor: not-allowed; opacity: .6; }
.bstfm-control input::placeholder,
.bstfm-control textarea::placeholder { color: transparent; }
.bstfm-control label {
	position: absolute;
	left: calc(14px + var(--bstfm-border-width));
	right: 40px;
	top: calc(var(--bstfm-h) / 2);
	transform: translateY(-50%);
	margin: 0;
	color: var(--bstfm-label);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
	transition: top .15s, font-size .15s, transform .15s, color .15s;
}
.bstfm-control.is-textarea label { top: 24px; }
.bstfm-control input:focus + label,
.bstfm-control textarea:focus + label,
.bstfm-control select:focus + label,
.bstfm-control input:not(:placeholder-shown) + label,
.bstfm-control textarea:not(:placeholder-shown) + label,
.bstfm-control.is-filled label,
.bstfm-control.is-static label {
	top: 8px;
	transform: none;
	font-size: 12px;
}
.bstfm .bstfm-control input:focus,
.bstfm .bstfm-control select:focus,
.bstfm .bstfm-control textarea:focus {
	border-color: var(--bstfm-border-focus);
	box-shadow: 0 0 0 1px var(--bstfm-border-focus);
}
.bstfm-control input:focus + label,
.bstfm-control select:focus + label,
.bstfm-control textarea:focus + label { color: var(--bstfm-border-focus); }
.bstfm-control input[type="date"] { min-height: var(--bstfm-h); }
.bstfm-control input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
.bstfm-control input[type="number"] { -moz-appearance: textfield; }
.bstfm-req { color: var(--bstfm-error); margin-left: 2px; }

/* Fecha: calendario propio con los colores del formulario */
.bstfm .bstfm-control.has-dp input { cursor: pointer; padding-right: 44px; caret-color: transparent; background-color: var(--bstfm-field-bg); color: var(--bstfm-field-text); opacity: 1; }
.bstfm-dp-icon { position: absolute; right: 14px; top: calc(var(--bstfm-h) / 2); transform: translateY(-50%); width: 20px; height: 20px; color: var(--bstfm-btn-bg); pointer-events: none; }
.bstfm-dp-icon svg { display: block; width: 100%; height: 100%; }
.bstfm-dp {
	position: absolute;
	z-index: 60;
	top: calc(100% + 6px);
	left: 0;
	width: 300px;
	max-width: calc(100vw - 32px);
	padding: 12px;
	background: var(--bstfm-field-bg);
	color: var(--bstfm-field-text);
	border: max(1px, var(--bstfm-border-width)) solid var(--bstfm-border);
	border-radius: var(--bstfm-radius);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
	font-size: 14px;
	line-height: 1.2;
	user-select: none;
}
.bstfm-dp.is-up { top: auto; bottom: calc(100% + 6px); }
.bstfm-dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.bstfm-dp-title { font-weight: 600; text-transform: capitalize; color: var(--bstfm-field-text); }
.bstfm-dp button {
	margin: 0; padding: 0; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer;
	box-shadow: none; text-transform: none; letter-spacing: normal; min-height: 0; line-height: 1;
}
.bstfm-dp-nav { display: grid; place-items: center; width: 34px; height: 34px; border-radius: min(var(--bstfm-radius), 8px); color: var(--bstfm-btn-bg) !important; }
.bstfm-dp-nav svg { width: 18px; height: 18px; }
.bstfm-dp-nav:hover, .bstfm-dp-nav:focus-visible { background: color-mix(in srgb, var(--bstfm-btn-bg) 12%, transparent) !important; outline: none; }
.bstfm-dp-nav[disabled] { opacity: .3; cursor: default; background: transparent !important; }
.bstfm-dp-week, .bstfm-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.bstfm-dp-week span { padding: 4px 0 6px; font-size: 12px; color: var(--bstfm-label); }
.bstfm-dp-day { height: 36px; border-radius: min(var(--bstfm-radius), 8px); font-size: 14px; }
.bstfm-dp-day:hover, .bstfm-dp-day:focus-visible { background: color-mix(in srgb, var(--bstfm-btn-bg) 12%, transparent) !important; outline: none; }
.bstfm-dp-day.is-today { box-shadow: inset 0 0 0 1px var(--bstfm-btn-bg) !important; }
.bstfm-dp-day.is-selected, .bstfm-dp-day.is-selected:hover { background: var(--bstfm-btn-bg) !important; color: var(--bstfm-btn-text) !important; font-weight: 600; }
.bstfm-dp-day[disabled] { opacity: .3; cursor: default; background: transparent !important; }
.bstfm-dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--bstfm-border); }
.bstfm-dp-link { padding: 6px 8px !important; border-radius: min(var(--bstfm-radius), 8px); color: var(--bstfm-btn-bg) !important; font-size: 13px !important; }
.bstfm-dp-link:hover, .bstfm-dp-link:focus-visible { background: color-mix(in srgb, var(--bstfm-btn-bg) 12%, transparent) !important; outline: none; }

/* Subcampos (dirección, región y comuna) */
.bstfm-sub { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--bstfm-gap); }
.bstfm-sub .bstfm-sub-line1 { grid-column: 1 / -1; }
.bstfm-group-label { display: block; margin: 0 0 8px; color: var(--bstfm-label); font-size: 14px; }

/* Radio y casillas: label dentro de la caja */
.bstfm-box {
	padding: 10px 14px 12px;
	background: var(--bstfm-field-bg);
	color: var(--bstfm-field-text);
	border: var(--bstfm-border-width) solid var(--bstfm-border);
	border-radius: var(--bstfm-radius);
}
.bstfm-legend { display: block; margin: 0 0 8px; color: var(--bstfm-label); font-size: 12px; }
.bstfm-options { display: grid; gap: 8px; }
/* Casillas: sin caja, solo el label y las opciones */
.bstfm-field--checkbox .bstfm-box { background: transparent; border: 0; padding: 0; border-radius: 0; }
.bstfm-field--checkbox .bstfm-legend { font-size: 14px; margin-bottom: 10px; }
.bstfm-options.is-inline { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.bstfm-option, .bstfm-consent { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; font-weight: 400; }
.bstfm-consent { color: var(--bstfm-field-text); font-size: 15px; }
.bstfm-consent a { color: inherit; text-decoration: underline; }
.bstfm-option input, .bstfm-consent input {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	background: var(--bstfm-field-bg);
	border: max(1px, var(--bstfm-border-width)) solid var(--bstfm-check-border);
	border-radius: 4px;
	display: grid;
	place-content: center;
	cursor: pointer;
}
.bstfm-option input[type="radio"] { border-radius: 50%; }
.bstfm-option input::before, .bstfm-consent input::before {
	content: "";
	width: 10px;
	height: 10px;
	transform: scale(0);
	transition: transform .12s;
	background: var(--bstfm-check-fill);
	border-radius: 2px;
}
.bstfm-option input[type="radio"]::before { border-radius: 50%; }
.bstfm-option input:checked, .bstfm-consent input:checked { border-color: var(--bstfm-check-border); }
.bstfm-option input:checked::before, .bstfm-consent input:checked::before { transform: scale(1); }
.bstfm-option input:focus-visible, .bstfm-consent input:focus-visible { outline: 2px solid var(--bstfm-check-border); outline-offset: 2px; }

/* Archivo */
.bstfm-drop {
	position: relative;
	background: var(--bstfm-field-bg);
	border: var(--bstfm-border-width) dashed var(--bstfm-border);
	border-radius: var(--bstfm-radius);
	transition: border-color .15s, background-color .15s;
}
.bstfm-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.bstfm-drop-inner { display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; margin: 0; cursor: pointer; }
.bstfm-drop-label { color: var(--bstfm-field-text); font-size: 16px; }
.bstfm-drop-hint { color: var(--bstfm-label); font-size: 13px; }
.bstfm-drop.is-over, .bstfm-drop:focus-within { border-color: var(--bstfm-border-focus); border-style: solid; }
.bstfm-file-list { list-style: none; margin: 0; padding: 0 14px; position: relative; z-index: 3; }
.bstfm-file-list:empty { display: none; }
.bstfm-file-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bstfm-border); color: var(--bstfm-field-text); font-size: 14px; }
.bstfm-file-list li span:last-child { color: var(--bstfm-label); white-space: nowrap; }

/* Ayuda y errores */
.bstfm-help { margin: 6px 2px 0; color: var(--bstfm-label); font-size: 13px; }
.bstfm-error { margin: 6px 2px 0; color: var(--bstfm-error); font-size: 13px; }
.bstfm .bstfm-field.has-error .bstfm-control input,
.bstfm .bstfm-field.has-error .bstfm-control select,
.bstfm .bstfm-field.has-error .bstfm-control textarea,
.bstfm-field.has-error .bstfm-box,
.bstfm-field.has-error .bstfm-drop { border-color: var(--bstfm-error); }
.bstfm-field.has-error .bstfm-consent input,
.bstfm-field--checkbox.has-error .bstfm-option input { border-color: var(--bstfm-error); }

/* Pasos */
.bstfm-progress { margin: 0 0 20px; }
.bstfm-progress-text { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; font-size: 14px; color: var(--bstfm-label); }
.bstfm-progress-title { color: var(--bstfm-field-text); }
.bstfm-progress-bar { height: 4px; background: var(--bstfm-border); border-radius: 4px; overflow: hidden; }
.bstfm-progress-bar span { display: block; height: 100%; background: var(--bstfm-btn-bg); transition: width .25s; }
.bstfm-step-title { margin: 0 0 14px; font-size: 1.15em; }

/* Acciones */
.bstfm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: calc(var(--bstfm-gap) + 4px); align-items: center; }
.bstfm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 12px 28px;
	margin: 0;
	background: var(--bstfm-btn-bg);
	color: var(--bstfm-btn-text);
	border: 1px solid var(--bstfm-btn-bg);
	border-radius: var(--bstfm-btn-radius);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, opacity .15s;
	text-transform: none;
}
.bstfm-btn:hover { background: var(--bstfm-btn-hover); border-color: var(--bstfm-btn-hover); color: var(--bstfm-btn-text); }
.bstfm-btn:focus-visible { outline: 2px solid var(--bstfm-border-focus); outline-offset: 2px; }
.bstfm-btn--ghost { background: transparent; color: var(--bstfm-field-text); border-color: var(--bstfm-border); font-weight: 400; }
.bstfm-btn--ghost:hover { background: transparent; color: var(--bstfm-field-text); border-color: var(--bstfm-border-focus); }
.bstfm-btn[disabled] { opacity: .6; cursor: progress; }
.bstfm-btn.is-loading::after {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: bstfm-spin .7s linear infinite;
}
@keyframes bstfm-spin { to { transform: rotate(360deg); } }
.bstfm-turnstile { margin-top: calc(var(--bstfm-gap) + 4px); min-height: 0; }

/* Mensaje final */
.bstfm-message { margin-top: 16px; padding: 14px 16px; border-radius: var(--bstfm-radius); border-left: 3px solid var(--bstfm-success); color: var(--bstfm-field-text); background: color-mix(in srgb, var(--bstfm-success) 8%, transparent); }
.bstfm-message.is-error { border-left-color: var(--bstfm-error); background: color-mix(in srgb, var(--bstfm-error) 8%, transparent); }
.bstfm.is-done .bstfm-message { margin-top: 0; }

/* Honeypot fuera de la vista */
.bstfm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.bstfm-html > :first-child { margin-top: 0; }
.bstfm-html > :last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
	.bstfm *, .bstfm *::before, .bstfm *::after { transition: none !important; animation: none !important; }
}
