/* OpenForms frontend */
.of-wrap {
	--of-accent: #2271b1;
	--of-accent-hover: #135e96;
	--of-border: #c3c4c7;
	--of-error: #d63638;
	--of-success: #00a32a;
	--of-radius: 4px;
	--of-text: #1d2327;
	--of-muted: #646970;
	max-width: 100%;
	color: var(--of-text);
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}
.of-wrap *, .of-wrap *::before, .of-wrap *::after { box-sizing: inherit; }

.of-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.of-hidden { display: none !important; }

/* Fields */
.of-field { margin: 0 0 18px; }
.of-label { display: block; font-weight: 600; margin-bottom: 6px; }
.of-req { color: var(--of-error); }
.of-help { margin: 6px 0 0; font-size: 0.875em; color: var(--of-muted); }
.of-section-title { margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--of-border); font-size: 1.15em; }
.of-file-hint { display: block; margin-top: 4px; font-size: 0.8em; color: var(--of-muted); }

.of-field input[type="text"], .of-field input[type="email"], .of-field input[type="url"],
.of-field input[type="tel"], .of-field input[type="number"], .of-field input[type="date"],
.of-field input[type="time"], .of-field select, .of-field textarea {
	width: 100%; padding: 10px 12px; font: inherit; color: inherit;
	border: 1px solid var(--of-border); border-radius: var(--of-radius); background: #fff;
}
.of-field textarea { min-height: 110px; resize: vertical; }
.of-field input:focus, .of-field select:focus, .of-field textarea:focus {
	outline: 2px solid var(--of-accent); outline-offset: 0; border-color: var(--of-accent);
}
.of-field input[type="file"] { display: block; max-width: 100%; }

/* Choices */
.of-choices { display: flex; flex-direction: column; gap: 6px; }
.of-choice { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.of-choice input { margin: 0; width: auto; }

/* Label positions */
.of-label-left .of-field:not(.of-field-section):not(.of-field-html) { display: grid; grid-template-columns: 30% 1fr; column-gap: 16px; align-items: start; }
.of-label-left .of-label { padding-top: 10px; margin: 0; }
.of-label-left .of-help, .of-label-left .of-field-err, .of-label-left .of-file-hint { grid-column: 2; }
.of-label-hidden .of-label { position: absolute; left: -9999px; }

/* Errors */
.of-field-err { display: block; margin-top: 4px; font-size: 0.85em; color: var(--of-error); }
.of-field.has-error input, .of-field.has-error select, .of-field.has-error textarea { border-color: var(--of-error); }
.of-form-msg { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--of-radius); }
.of-msg-error { background: #fcf0f1; color: var(--of-error); border: 1px solid #f1c3c5; }
.of-msg-success, .of-confirmation { background: #edfaef; color: #0a4a19; border: 1px solid #b8e6c1; padding: 16px; border-radius: var(--of-radius); }
.of-error { color: var(--of-error); }

/* Rating */
.of-rating { display: inline-flex; gap: 4px; direction: ltr; }
.of-star { cursor: pointer; }
.of-star input { position: absolute; opacity: 0; width: 0; height: 0; }
.of-star-icon { font-size: 28px; color: #c3c4c7; transition: color .15s; }
.of-star-icon.is-active { color: #f0b429; }
.of-star input:focus-visible + .of-star-icon { outline: 2px solid var(--of-accent); border-radius: 3px; }

/* Buttons */
.of-btn {
	display: inline-block; padding: 10px 22px; font: inherit; font-weight: 600; cursor: pointer;
	border: 1px solid var(--of-accent); border-radius: var(--of-radius);
	background: var(--of-accent); color: #fff; transition: background .15s;
}
.of-btn:hover, .of-btn:focus { background: var(--of-accent-hover); border-color: var(--of-accent-hover); color: #fff; }
.of-btn:disabled { opacity: .6; cursor: default; }
.of-btn-prev { background: transparent; color: var(--of-accent); }
.of-btn-prev:hover { background: #f0f6fc; color: var(--of-accent-hover); }
.of-btn-submit.is-loading { position: relative; color: transparent; }
.of-btn-submit.is-loading::after {
	content: ""; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
	border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: of-spin .7s linear infinite;
}
@keyframes of-spin { to { transform: rotate(360deg); } }
.of-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.of-nav .of-btn-next { margin-left: auto; }
.of-submit-row { margin-top: 12px; }

/* Progress */
.of-progress { margin: 0 0 20px; }
.of-progress-track { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; }
.of-progress-fill { height: 100%; background: var(--of-accent); transition: width .3s; }
.of-progress-steps { display: flex; list-style: none; margin: 0; padding: 0; gap: 8px; }
.of-progress-steps li {
	flex: 1; text-align: center; padding: 6px 4px; font-size: 0.85em; color: var(--of-muted);
	border-bottom: 3px solid #e0e0e0;
}
.of-progress-steps li.is-active { color: var(--of-accent); border-color: var(--of-accent); font-weight: 600; }
.of-progress-steps li.is-done { border-color: var(--of-success); }

/* Responsive */
@media (max-width: 600px) {
	.of-label-left .of-field:not(.of-field-section):not(.of-field-html) { display: block; }
	.of-label-left .of-label { padding-top: 0; margin-bottom: 6px; }
	.of-btn { width: 100%; }
	.of-nav { flex-direction: column-reverse; }
}

/* Pro widgets */
.of-sig-wrap { position: relative; }
.of-sig-pad { width: 100%; max-width: 600px; height: 180px; border: 1px dashed var(--of-border); border-radius: var(--of-radius); background: #fff; touch-action: none; display: block; }
.of-sig-clear { margin-top: 6px; background: none; border: 1px solid var(--of-border); border-radius: var(--of-radius); padding: 4px 10px; font-size: 0.85em; cursor: pointer; }
.of-range-wrap { display: flex; align-items: center; gap: 12px; }
.of-range-wrap input[type="range"] { flex: 1; }
.of-range-out { min-width: 40px; font-weight: 600; text-align: right; }
.of-calc-wrap { font-size: 1.15em; font-weight: 600; padding: 8px 0; }
.of-nps { display: flex; gap: 6px; flex-wrap: wrap; }
.of-nps-item { cursor: pointer; }
.of-nps-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.of-nps-item span { display: inline-block; min-width: 36px; padding: 8px 0; text-align: center; border: 1px solid var(--of-border); border-radius: var(--of-radius); background: #fff; }
.of-nps-item.is-active span, .of-nps-item input:checked + span { background: var(--of-accent); color: #fff; border-color: var(--of-accent); }
.of-nps-legend { display: flex; justify-content: space-between; font-size: 0.8em; color: var(--of-muted); margin-top: 4px; }
.of-pay-fixed { font-size: 1.15em; padding: 6px 0; }
.of-pay-summary { margin: 8px 0 16px; padding: 10px 14px; background: #f6f7f7; border-radius: var(--of-radius); font-size: 1.05em; }
.of-pay-banner { margin-bottom: 20px; }
.of-field input[type="color"] { width: 60px; height: 40px; padding: 2px; border: 1px solid var(--of-border); border-radius: var(--of-radius); background: #fff; }
