/* =====================================================
   Medcare Form Shortcodes — Refer a Patient Form Styles
   Prefix: .msrf-*  (isolated from .msf-* and .mscf-*)
   ===================================================== */

/* ---------- Section wrapper ---------- */
.msrf-refer-section {
	font-family: 'Segoe UI', Arial, sans-serif;
}

.msrf-refer-inner {
	max-width: 100%;
	margin: 0 auto;
}

/* ---------- Form card ---------- */
.msrf-refer-card {
	background: #ffffff;
	border-radius: 0;
	padding: 20px 20px;
	box-shadow: 0 1px 3px rgb(15 16 17 / 10%);
}

/* ---------- Response messages ---------- */
.msrf-response {
	display: none;
	padding: 14px 18px;
	border-radius: 0;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 24px;
}

.msrf-response.msrf-success {
	background: #eaf7f0;
	color: #1a7a45;
	border: 1px solid #b3e6cc;
	display: block;
}

.msrf-response.msrf-error {
	background: #fff0f0;
	color: #c0392b;
	border: 1px solid #f5b7b1;
	display: block;
}

/* ---------- Fieldsets & legends ---------- */
.msrf-fieldset {
	border: 1.5px solid #d8e4f0;
	border-radius: 0;
	padding: 22px 20px 6px;
	margin: 0 0 26px;
	min-width: 0; /* allows the inner grid to shrink on mobile */
}

.msrf-fieldset:last-of-type {
	margin-bottom: 18px;
}

.msrf-legend {
	font-size: 16px;
	font-weight: 700;
	color: #000;
	text-transform: uppercase;
	letter-spacing: .6px;
	padding: 0 10px;
	margin: 0 0 0 -4px;
	width: auto;
	float: none; /* neutralizes themes that float legends */
	border: 0;
}

/* ---------- Form grid ----------
   One grid per fieldset. Half-width fields flow two per row,
   full-width fields span the whole row. */
.msrf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 6px;
}

.msrf-group {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.msrf-group--full {
	grid-column: 1 / -1;
}

/* ---------- Labels ---------- */
.msrf-group label {
	font-size: 15px;
	font-weight: 700;
	color: #000;
	margin-bottom: 8px;
	letter-spacing: .3px;
}

.msrf-required {
	color: #c0392b;
	font-weight: 700;
}

/* ---------- Inputs & textarea ---------- */
.msrf-refer-section input[type="text"],
.msrf-refer-section input[type="email"],
.msrf-refer-section input[type="tel"],
.msrf-refer-section input[type="date"],
.msrf-refer-section select,
.msrf-refer-section textarea {
	width: 100%;
	padding: 0 16px;
	height: 50px;
	border: 1.5px solid #d8e4f0;
	border-radius: 0;
	font-size: 14px;
	color: #1a1a2e;
	background: #f8fbff;
	transition: border-color .2s, box-shadow .2s;
	outline: none;
	box-sizing: border-box;
	font-family: 'Segoe UI', Arial, sans-serif;
}

.msrf-refer-section textarea {
	height: auto;
	min-height: 110px;
	padding: 14px 16px;
	line-height: 1.6;
	resize: vertical;
}

.msrf-group input::placeholder,
.msrf-group textarea::placeholder {
	color: #a8b8cc;
}

/* Native arrow, no custom appearance: keeps the theme's select behaviour */
.msrf-refer-section select {
	cursor: pointer;
	padding-right: 12px;
}

/* The placeholder entry reads as a placeholder until a real choice is picked */
.msrf-refer-section select:invalid,
.msrf-refer-section select option[value=""] {
	color: #a8b8cc;
}

.msrf-refer-section select option {
	color: #1a1a2e;
}

.msrf-group input:focus,
.msrf-group select:focus,
.msrf-group textarea:focus {
	border-color: #1a8cff;
	background: #fff;
	box-shadow: 0 0 0 4px rgba(26, 140, 255, .12);
}

.msrf-group input.msrf-invalid,
.msrf-group select.msrf-invalid,
.msrf-group textarea.msrf-invalid {
	border-color: #e74c3c;
	box-shadow: 0 0 0 4px rgba(231, 76, 60, .10);
}

/* ---------- Field-level error ---------- */
.msrf-field-error {
	display: block;
	font-size: 12px;
	color: #c0392b;
	margin-top: 5px;
	min-height: 16px;
}

/* ---------- Bottom row: reCAPTCHA + submit ---------- */
.msrf-form-bottom {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-top: 4px;
	flex-wrap: wrap;
}

.msrf-recaptcha-wrap .msrf-field-error {
	margin-top: 6px;
}

/* ---------- Submit button ----------
   Base look comes from .wpcf7-submit in msf-styles.css.
   Colors are overridden by the inline CSS built in
   MSF_Refer_Settings::get_button_css(). */
.msrf-refer-section .wpcf7-form-control.wpcf7-submit {
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	min-width: 200px;
	height: 50px;
	padding: 0 40px;
	cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
	.msrf-grid {
		grid-template-columns: 1fr;
	}

	.msrf-fieldset {
		padding: 18px 14px 4px;
	}
}
