/*
 * Hingenia Forms — formularios públicos ([hg_form] / [fluentform]).
 * Estático (sin Tailwind/Vite). Scope: .hgf y .hgf-page
 * Misma estética que el Libro de Reclamaciones.
 */

.hgf,
.hgf-page {
	--hgf-blue: #2563eb;
	--hgf-blue-soft: #eff4ff;
	--hgf-ink: #0b0b12;
	--hgf-muted: #6b7280;
	--hgf-border: #e6e7eb;
	--hgf-bg: #f6f7f9;
	--hgf-surface: #ffffff;
	--hgf-field: #ffffff;
	--hgf-danger: #b91c1c;
	--hgf-danger-soft: #fee2e2;
	--hgf-success: #15803d;
	--hgf-success-soft: #dcfce7;
}

/* ---------- Página ---------- */
.hgf-page {
	background: var(--hgf-bg);
	color: var(--hgf-ink);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	padding: 36px 16px 80px;
	min-height: 70vh;
}
.hgf-wrap { max-width: 820px; margin: 0 auto; }

.hgf-hero { margin-bottom: 24px; }
.hgf-eyebrow {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hgf-blue);
	background: var(--hgf-blue-soft);
	padding: 5px 11px;
	border-radius: 999px;
	margin-bottom: 14px;
	font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.hgf-hero h1 {
	font-family: 'Poppins', 'Inter', sans-serif;
	font-size: clamp(28px, 4.2vw, 38px);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.08;
	margin: 0 0 10px;
	color: var(--hgf-ink);
}
.hgf-hero p {
	font-size: 15px;
	line-height: 1.55;
	color: var(--hgf-muted);
	max-width: 640px;
	margin: 0;
}

/* ---------- Tarjeta del formulario ---------- */
.hgf {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--hgf-ink);
	text-align: left;
}
.hgf-form {
	background: var(--hgf-surface);
	border: 1px solid var(--hgf-border);
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 1px 0 rgba(11, 11, 18, 0.02);
}
@media (max-width: 640px) {
	.hgf-form { padding: 18px 16px; border-radius: 14px; }
}

.hgf-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}
.hgf-grid > * { grid-column: 1 / -1; min-width: 0; }
.hgf-grid > .hgf-half { grid-column: auto; }
@media (max-width: 640px) {
	.hgf-grid > .hgf-half { grid-column: 1 / -1; }
}
.hgf-grid > [hidden] { display: none !important; }

/* Honeypot */
.hgf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Secciones */
.hgf-section { padding-top: 10px; }
.hgf-section:first-child { padding-top: 0; }
.hgf-grid > .hgf-section:not(:first-child) {
	border-top: 1px dashed var(--hgf-border);
	padding-top: 20px;
	margin-top: 6px;
}
.hgf-section h3 {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	color: var(--hgf-blue);
	letter-spacing: 0.02em;
	background: var(--hgf-blue-soft);
	padding: 4px 12px;
	border-radius: 999px;
	margin: 0;
}
.hgf-section p { margin: 8px 0 0; font-size: 13.5px; color: var(--hgf-muted); line-height: 1.5; }
.hgf-html { font-size: 14px; line-height: 1.6; color: var(--hgf-muted); }
.hgf-html p { margin: 0 0 8px; }

/* Campos */
.hgf-field { display: flex; flex-direction: column; gap: 6px; }
.hgf-label { font-size: 13px; font-weight: 600; color: var(--hgf-ink); }
.hgf-label em, .hgf-accept em { color: var(--hgf-blue); font-style: normal; font-weight: 700; margin-left: 2px; }

.hgf-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.hgf-field select,
.hgf-field textarea {
	width: 100%;
	min-height: 44px;
	background: var(--hgf-field);
	border: 1px solid var(--hgf-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 15px;
	font-family: inherit;
	color: var(--hgf-ink);
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.hgf-field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.hgf-field input:focus,
.hgf-field select:focus,
.hgf-field textarea:focus {
	outline: 0;
	border-color: var(--hgf-blue);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.hgf-field input::placeholder,
.hgf-field textarea::placeholder { color: #9ca3af; }

.hgf-field input[type="file"] {
	font-size: 14px;
	padding: 10px;
	border: 1px dashed #cbd5e1;
	border-radius: 10px;
	background: var(--hgf-field);
	color: var(--hgf-muted);
	width: 100%;
}
.hgf-field input[type="file"]::file-selector-button {
	border: 0;
	background: var(--hgf-blue-soft);
	color: var(--hgf-blue);
	font-weight: 600;
	padding: 7px 12px;
	border-radius: 8px;
	margin-right: 10px;
	cursor: pointer;
}

.hgf-help { font-size: 12.5px; color: var(--hgf-muted); line-height: 1.45; }
.hgf-error { font-size: 12.5px; color: var(--hgf-danger); font-weight: 500; }
.hgf-error:empty { display: none; }
.hgf-field.is-invalid input:not([type="checkbox"]):not([type="radio"]),
.hgf-field.is-invalid select,
.hgf-field.is-invalid textarea { border-color: var(--hgf-danger); }

/* Opciones (radio / checkbox) */
.hgf-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.hgf-choice {
	flex: 1 1 220px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--hgf-field);
	border: 1px solid var(--hgf-border);
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.hgf-choice:hover { border-color: #cbd5e1; }
.hgf-choice input { margin-top: 2px; accent-color: var(--hgf-blue); width: 16px; height: 16px; flex: 0 0 16px; }
.hgf-choice:has(input:checked) { border-color: var(--hgf-blue); background: var(--hgf-blue-soft); }

.hgf-accept {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13.5px;
	line-height: 1.5;
	cursor: pointer;
	background: var(--hgf-bg);
	border: 1px solid var(--hgf-border);
	border-radius: 12px;
	padding: 13px 15px;
}
.hgf-accept input { margin-top: 3px; accent-color: var(--hgf-blue); width: 16px; height: 16px; flex: 0 0 16px; }
.hgf-accept a { color: var(--hgf-blue); font-weight: 600; }

/* Turnstile */
.hgf .cf-turnstile { margin-top: 18px; }

/* Acciones */
.hgf-actions { margin-top: 22px; }
.hgf-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	background: var(--hgf-blue);
	color: #fff;
	border: 0;
	border-radius: 12px;
	padding: 13px 24px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s, transform 0.06s, box-shadow 0.15s;
	box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.6);
}
.hgf-submit:hover { background: #1d4ed8; }
.hgf-submit:active { transform: translateY(1px); }
.hgf-submit[disabled] { opacity: 0.65; cursor: progress; }
@media (max-width: 640px) {
	.hgf-submit { width: 100%; }
}

/* Alertas */
.hgf-alert {
	background: var(--hgf-danger-soft);
	color: var(--hgf-danger);
	border: 1px solid rgba(185, 28, 28, 0.22);
	border-radius: 12px;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 16px;
}
.hgf-closed {
	background: var(--hgf-surface);
	border: 1px solid var(--hgf-border);
	border-radius: 14px;
	padding: 20px;
	color: var(--hgf-muted);
}

/* Éxito */
.hgf-success {
	background: var(--hgf-surface);
	border: 1px solid var(--hgf-border);
	border-radius: 18px;
	padding: 40px 26px;
	text-align: center;
}
.hgf-success-ic {
	display: inline-grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--hgf-success-soft);
	color: var(--hgf-success);
	margin-bottom: 14px;
}
.hgf-success h2 {
	font-family: 'Poppins', 'Inter', sans-serif;
	font-size: 24px;
	font-weight: 800;
	margin: 0 0 8px;
	color: var(--hgf-ink);
}
.hgf-success p { font-size: 15px; line-height: 1.6; color: var(--hgf-muted); margin: 0 auto 8px; max-width: 520px; }
.hgf-success b { color: var(--hgf-ink); letter-spacing: 0.04em; }

/* ---------- Dark mode ---------- */
html.dark .hgf,
html.dark .hgf-page {
	--hgf-bg: #080809;
	--hgf-surface: #101012;
	--hgf-field: #18181b;
	--hgf-ink: #f3f4f6;
	--hgf-muted: #9aa1ac;
	--hgf-border: rgba(255, 255, 255, 0.08);
	--hgf-blue-soft: rgba(37, 99, 235, 0.18);
	--hgf-danger-soft: rgba(185, 28, 28, 0.16);
	--hgf-success-soft: rgba(22, 163, 74, 0.16);
}
html.dark .hgf-page { --hgf-bg: transparent; }
html.dark .hgf .hgf-section h3 { color: #93c5fd; }
html.dark .hgf .hgf-choice:has(input:checked) { border-color: #60a5fa; }
html.dark .hgf .hgf-accept { background: #18181b; }
html.dark .hgf .hgf-field input[type="file"] { border-color: rgba(255, 255, 255, 0.16); }
html.dark .hgf .hgf-accept a { color: #60a5fa; }

/* ---------- Radios y casillas propios (el tema les quita el estilo nativo) ---------- */
.hgf .hgf-choice input,
.hgf .hgf-accept input {
	-webkit-appearance: none;
	appearance: none;
	width: 18px !important;
	height: 18px !important;
	min-height: 0 !important;
	flex: 0 0 18px;
	margin: 1px 0 0;
	padding: 0 !important;
	border: 1.5px solid #94a3b8 !important;
	border-radius: 5px;
	background: var(--hgf-field) center / 12px no-repeat;
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}
.hgf .hgf-choice input[type="radio"] { border-radius: 50%; }
.hgf .hgf-choice input:checked,
.hgf .hgf-accept input:checked {
	border-color: var(--hgf-blue) !important;
	background-color: var(--hgf-blue);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.hgf .hgf-choice input[type="radio"]:checked {
	background-image: none;
	box-shadow: inset 0 0 0 3px var(--hgf-field);
}
.hgf .hgf-choice input:focus-visible,
.hgf .hgf-accept input:focus-visible { outline: 2px solid var(--hgf-blue); outline-offset: 2px; }
.hgf .hgf-choice input::before,
.hgf .hgf-accept input::before { content: none !important; }
html.dark .hgf .hgf-choice input,
html.dark .hgf .hgf-accept input { border-color: rgba(255, 255, 255, 0.28) !important; }
