/**
 * HIPAA Vault Form Builder — Frontend Form Styles
 *
 * Styles for public-facing forms: layout, inputs, field types,
 * validation errors, multi-page navigation, PHI indicators.
 *
 * @package HVFB
 */

/* ──────────────────────────────────────────────
   Form Wrapper & Title
   ────────────────────────────────────────────── */

.hvfb-form-wrapper {
	max-width: 720px;
	margin: 0 auto;
	padding: 0;
}

.hvfb-form-title {
	font-size: 1.5em;
	margin: 0 0 1em;
	padding: 0;
}

.hvfb-form {
	position: relative;
}

/* ──────────────────────────────────────────────
   Field Layout
   ────────────────────────────────────────────── */

.hvfb-field {
	margin-bottom: 1.25em;
	position: relative;
}

.hvfb-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35em;
	font-size: 0.938em;
}

.hvfb-required {
	color: #d32f2f;
	font-weight: 700;
}

/* ──────────────────────────────────────────────
   Inputs
   ────────────────────────────────────────────── */

.hvfb-field input[type="text"],
.hvfb-field input[type="email"],
.hvfb-field input[type="tel"],
.hvfb-field input[type="number"],
.hvfb-field input[type="date"],
.hvfb-field input[type="url"],
.hvfb-field input[type="password"],
.hvfb-field textarea,
.hvfb-field select {
	display: block;
	width: 100%;
	padding: 0.5em 0.75em;
	font-size: 1em;
	line-height: 1.5;
	border: 1px solid #c4c4c4;
	border-radius: 4px;
	background: #fff;
	color: #333;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hvfb-field input:focus,
.hvfb-field textarea:focus,
.hvfb-field select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.hvfb-field textarea {
	resize: vertical;
	min-height: 100px;
}

.hvfb-field select {
	appearance: auto;
}

.hvfb-field input[type="file"] {
	display: block;
	width: 100%;
	padding: 0.4em 0;
	font-size: 0.938em;
}

/* ──────────────────────────────────────────────
   Help Text
   ────────────────────────────────────────────── */

.hvfb-field__help {
	display: block;
	margin-top: 0.3em;
	color: #666;
	font-size: 0.813em;
	line-height: 1.4;
}

/* ──────────────────────────────────────────────
   Checkbox & Radio Options
   ────────────────────────────────────────────── */

.hvfb-field__options {
	padding-top: 0.2em;
}

.hvfb-field__option {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 0.4em;
	font-weight: 400;
	cursor: pointer;
}

.hvfb-field__option input[type="checkbox"],
.hvfb-field__option input[type="radio"] {
	width: 1em;
	height: 1em;
	margin: 0;
	flex-shrink: 0;
}

/* ──────────────────────────────────────────────
   Compound Fields (Name)
   ────────────────────────────────────────────── */

.hvfb-field__compound {
	display: flex;
	gap: 0.75em;
}

.hvfb-field__compound .hvfb-field__part {
	flex: 1;
}

.hvfb-field__compound .hvfb-field__part input {
	width: 100%;
}

.hvfb-field__compound .hvfb-field__part small {
	display: block;
	margin-top: 0.2em;
	color: #888;
	font-size: 0.75em;
}

/* ──────────────────────────────────────────────
   Address Field
   ────────────────────────────────────────────── */

.hvfb-field__address .hvfb-field__row {
	margin-bottom: 0.6em;
}

.hvfb-field__address .hvfb-field__row input {
	width: 100%;
}

.hvfb-field__address .hvfb-field__row small {
	display: block;
	margin-top: 0.2em;
	color: #888;
	font-size: 0.75em;
}

.hvfb-field__row--three {
	display: flex;
	gap: 0.75em;
}

.hvfb-field__row--three .hvfb-field__part {
	flex: 1;
}

.hvfb-field__row--three .hvfb-field__part input {
	width: 100%;
}

.hvfb-field__row--three .hvfb-field__part small {
	display: block;
	margin-top: 0.2em;
	color: #888;
	font-size: 0.75em;
}

/* ──────────────────────────────────────────────
   Consent / HIPAA Acknowledgment
   ────────────────────────────────────────────── */

.hvfb-field__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	font-weight: 400;
	cursor: pointer;
	line-height: 1.5;
}

.hvfb-field__consent input[type="checkbox"] {
	width: 1.1em;
	height: 1.1em;
	margin-top: 0.2em;
	flex-shrink: 0;
}

.hvfb-field__consent span {
	flex: 1;
}

/* ──────────────────────────────────────────────
   Section Divider
   ────────────────────────────────────────────── */

.hvfb-field--section-divider {
	margin-top: 1.5em;
	margin-bottom: 1.5em;
}

.hvfb-section-title {
	font-size: 1.15em;
	margin: 0 0 0.3em;
	color: #333;
}

.hvfb-section-desc {
	margin: 0 0 0.6em;
	color: #666;
	font-size: 0.875em;
}

.hvfb-section-hr {
	border: none;
	border-top: 1px solid #ddd;
	margin: 0;
}

/* ──────────────────────────────────────────────
   HTML Block
   ────────────────────────────────────────────── */

.hvfb-field--html {
	margin-bottom: 1em;
}

.hvfb-field--html p:last-child {
	margin-bottom: 0;
}

/* ──────────────────────────────────────────────
   Multi-Page Navigation
   ────────────────────────────────────────────── */

.hvfb-page {
	display: none;
}

.hvfb-page--active {
	display: block;
}

.hvfb-page-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1em 0;
	gap: 0.75em;
}

/* ──────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────── */

.hvfb-btn {
	display: inline-block;
	padding: 0.6em 1.5em;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.hvfb-btn--submit {
	background: #0073aa;
	color: #fff;
	border-color: #005f8c;
	min-width: 140px;
}

.hvfb-btn--submit:hover {
	background: #005f8c;
}

.hvfb-btn--submit:disabled,
.hvfb-btn--loading {
	opacity: 0.7;
	cursor: not-allowed;
}

.hvfb-btn--prev,
.hvfb-btn--next {
	background: #f0f0f0;
	color: #333;
	border-color: #c4c4c4;
}

.hvfb-btn--prev:hover,
.hvfb-btn--next:hover {
	background: #e0e0e0;
}

/* ──────────────────────────────────────────────
   Submit Area
   ────────────────────────────────────────────── */

.hvfb-form__submit {
	padding-top: 1em;
}

/* ──────────────────────────────────────────────
   Status Messages
   ────────────────────────────────────────────── */

.hvfb-form__status {
	margin-top: 0.75em;
	padding: 0.6em 0.75em;
	border-radius: 4px;
	font-size: 0.875em;
	line-height: 1.5;
}

.hvfb-form__status--error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.hvfb-form__status--info {
	background: #eff6ff;
	color: #1e40af;
	border: 1px solid #bfdbfe;
}

.hvfb-form__status--success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* ──────────────────────────────────────────────
   Field Errors
   ────────────────────────────────────────────── */

.hvfb-field__error {
	color: #d32f2f;
	font-size: 0.813em;
	margin-top: 0.3em;
	line-height: 1.4;
}

.hvfb-field--has-error input,
.hvfb-field--has-error textarea,
.hvfb-field--has-error select {
	border-color: #d32f2f;
}

.hvfb-field--has-error input:focus,
.hvfb-field--has-error textarea:focus,
.hvfb-field--has-error select:focus {
	box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.15);
}

/* ──────────────────────────────────────────────
   Confirmation
   ────────────────────────────────────────────── */

.hvfb-confirmation__message {
	padding: 1.5em;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 6px;
	color: #166534;
	font-size: 1em;
	line-height: 1.6;
	text-align: center;
}

/* ──────────────────────────────────────────────
   PHI Field Indicator
   ────────────────────────────────────────────── */

.hvfb-field--phi {
	border-left: 3px solid #d32f2f;
	padding-left: 0.75em;
}

/* ──────────────────────────────────────────────
   Hidden Fields
   ────────────────────────────────────────────── */

.hvfb-field--hidden {
	display: none;
}

/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */

@media (max-width: 600px) {
	.hvfb-form-wrapper {
		padding: 0 0.75em;
	}

	.hvfb-field__compound {
		flex-direction: column;
		gap: 0.5em;
	}

	.hvfb-field__row--three {
		flex-direction: column;
		gap: 0.5em;
	}

	.hvfb-page-nav {
		flex-direction: column;
	}

	.hvfb-btn {
		width: 100%;
	}
}

/* ──────────────────────────────────────────────
   CAPTCHA Widget
   ────────────────────────────────────────────── */

.hvfb-captcha-wrap {
	margin: 1em 0;
}

.hvfb-captcha-wrap .g-recaptcha,
.hvfb-captcha-wrap .h-captcha {
	margin: 0 auto;
}
