/* Brainscooter birth form: dark, calm, easy to read. Uses the theme's palette variables with fallbacks. */
.bs-birth {
	--bf-bg: var(--wp--preset--color--base, #15142c);
	--bf-card: var(--wp--preset--color--dark-grey, #1f1d3d);
	--bf-hover: var(--wp--preset--color--hover, #2c2a58);
	--bf-line: var(--wp--preset--color--contrast-lightest, #4a4780);
	--bf-text: var(--wp--preset--color--contrast, #ece6d8);
	--bf-soft: var(--wp--preset--color--contrast-medium, #c9c4d8);
	--bf-muted: var(--wp--preset--color--contrast-lighter, #8b8fb8);
	--bf-head: var(--wp--preset--color--heading, #f3eee2);
	--bf-gold: var(--wp--preset--color--primary, #d9b36a);
	--bf-gold-deep: var(--wp--preset--color--tertiary-darker, #5a4a2a);
	--bf-rose: var(--wp--preset--color--error, #e38a8a);
	--bf-sage: var(--wp--preset--color--success, #7fc4a4);
	max-width: 760px;
	margin: 0 auto;
	color: var(--bf-text);
}

/* Steps */
.bs-birth .bs-step {
	background: var(--bf-card);
	border: 1px solid var(--bf-line);
	border-radius: 16px;
	padding: clamp(20px, 3.5vw, 32px);
	margin: 0 0 20px;
}
.bs-birth .bs-step__head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.bs-birth .bs-step__num {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--bf-gold-deep);
	border: 1px solid var(--bf-gold);
	color: var(--bf-gold);
	font-weight: 700;
}
.bs-birth .bs-step__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--cormorant, Georgia, serif);
	font-size: clamp(26px, 3vw, 32px);
	font-weight: 600;
	color: var(--bf-head);
	line-height: 1.15;
}
.bs-birth .bs-step__intro { margin: 4px 0 0; color: var(--bf-soft); font-size: 16px; }
.bs-birth .bs-step__intro strong { color: var(--bf-gold); }

/* ACF layout reset */
.bs-birth .acf-fields,
.bs-birth .acf-form-fields { background: transparent; border: 0; }
.bs-birth .acf-fields > .acf-field,
.bs-birth .bs-step > .acf-field { border: 0 !important; padding: 14px 0 !important; margin: 0; }
.bs-birth .acf-field .acf-label { margin-bottom: 8px; }
.bs-birth .acf-field .acf-label label { color: var(--bf-head); font-weight: 600; font-size: 17px; }
.bs-birth .acf-field .acf-label .description,
.bs-birth .acf-field .description { color: var(--bf-muted); font-size: 14px; margin-top: 2px; }
.bs-birth .acf-required { color: var(--bf-gold); }
.bs-birth .bs-optional { color: var(--bf-muted); font-weight: 400; }

/* Inputs */
.bs-birth input[type="text"],
.bs-birth input[type="password"],
.bs-birth input[type="email"],
.bs-birth .acf-date-time-picker input.input {
	width: 100%;
	min-height: 50px;
	padding: 12px 14px;
	background: var(--bf-bg);
	border: 1px solid var(--bf-line);
	border-radius: 10px;
	color: var(--bf-text);
	font-size: 16px; /* 16px prevents iOS zoom-on-focus */
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bs-birth input::placeholder { color: var(--bf-muted); opacity: 1; }
.bs-birth input:focus,
.bs-birth input:focus-visible {
	outline: none;
	border-color: var(--bf-gold);
	box-shadow: 0 0 0 3px rgba(217, 179, 106, 0.28);
}

/* Password show/hide */
.bs-birth .bs-password { position: relative; }
.bs-birth .bs-password input { padding-right: 84px; }
.bs-birth .bs-password__toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	min-height: 38px;
	padding: 6px 12px;
	background: transparent;
	border: 1px solid var(--bf-line);
	border-radius: 8px;
	color: var(--bf-soft);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.bs-birth .bs-password__toggle:hover { background: var(--bf-hover); }
.bs-birth .bs-password__toggle:focus-visible { outline: 2px solid var(--bf-gold); outline-offset: 2px; }

/* Select (ACF uses Select2) */
.bs-birth .select2-container { width: 100% !important; }
.bs-birth .select2-container--default .select2-selection--single {
	height: 50px;
	background: var(--bf-bg);
	border: 1px solid var(--bf-line);
	border-radius: 10px;
}
.bs-birth .select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 48px;
	padding-left: 14px;
	color: var(--bf-text);
	font-size: 16px;
}
.bs-birth .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--bf-muted); }
.bs-birth .select2-container--default .select2-selection--single .select2-selection__arrow { height: 48px; right: 8px; }
.bs-birth .select2-container--default .select2-selection--single .select2-selection__arrow b { border-top-color: var(--bf-gold); }
.bs-birth .select2-container--default .select2-selection--single .select2-selection__clear { color: var(--bf-muted); margin-right: 26px; }
.bs-birth .select2-container--focus .select2-selection--single,
.bs-birth .select2-container--open .select2-selection--single { border-color: var(--bf-gold); box-shadow: 0 0 0 3px rgba(217, 179, 106, 0.28); }
body.bs-birth-page .select2-dropdown {
	background: #1f1d3d;
	border: 1px solid #4a4780;
	border-radius: 10px;
	overflow: hidden;
	color: #ece6d8;
}
body.bs-birth-page .select2-search--dropdown .select2-search__field {
	min-height: 44px;
	background: #15142c;
	border: 1px solid #4a4780;
	border-radius: 8px;
	color: #ece6d8;
	font-size: 16px;
}
body.bs-birth-page .select2-results__option { padding: 10px 14px; }
body.bs-birth-page .select2-container--default .select2-results__option--highlighted[aria-selected],
body.bs-birth-page .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: #5a4a2a; color: #f3eee2; }
body.bs-birth-page .select2-container--default .select2-results__option[aria-selected="true"],
body.bs-birth-page .select2-container--default .select2-results__option--selected { background: #2c2a58; color: #f3eee2; }
.bs-birth .bs-tz-note { margin: 8px 0 0; color: var(--bf-gold); font-size: 14px; }
.bs-birth .bs-tz-note:empty { display: none; }

/* Date and time picker (jQuery UI, appended to the page body) */
body.bs-birth-page .acf-ui-datepicker .ui-datepicker,
body.bs-birth-page .ui-datepicker {
	background: #1f1d3d;
	border: 1px solid #4a4780;
	border-radius: 12px;
	padding: 8px;
	color: #ece6d8;
	box-shadow: 0 18px 40px rgba(8, 7, 22, 0.6);
	z-index: 100000 !important;
}
body.bs-birth-page .ui-datepicker .ui-widget-header,
body.bs-birth-page .ui-datepicker .ui-datepicker-header { background: #15142c; border: 0; border-radius: 8px; color: #f3eee2; }
body.bs-birth-page .ui-datepicker select { background: #15142c; color: #ece6d8; border: 1px solid #4a4780; border-radius: 6px; padding: 2px 4px; }
body.bs-birth-page .ui-datepicker th { color: #8b8fb8; font-weight: 600; }
body.bs-birth-page .ui-datepicker .ui-state-default { background: #15142c; border: 1px solid #2c2a58; color: #ece6d8; border-radius: 6px; text-align: center; }
body.bs-birth-page .ui-datepicker .ui-state-hover { background: #2c2a58; }
body.bs-birth-page .ui-datepicker .ui-state-highlight { border-color: #9fa6d9; }
body.bs-birth-page .ui-datepicker .ui-state-active { background: #d9b36a; border-color: #d9b36a; color: #15142c; }
body.bs-birth-page .ui-datepicker .ui-datepicker-prev,
body.bs-birth-page .ui-datepicker .ui-datepicker-next { filter: invert(1); cursor: pointer; }
body.bs-birth-page .ui-timepicker-div dl dt { color: #8b8fb8; }
body.bs-birth-page .ui-timepicker-div .ui-slider { background: #15142c; border: 1px solid #4a4780; }
body.bs-birth-page .ui-timepicker-div .ui-slider-handle { background: #d9b36a; border-color: #d9b36a; border-radius: 50%; }
body.bs-birth-page .ui-datepicker .ui-datepicker-buttonpane { border-top: 1px solid #4a4780; }
body.bs-birth-page .ui-datepicker .ui-datepicker-buttonpane button {
	background: #2c2a58;
	border: 1px solid #4a4780;
	color: #ece6d8;
	border-radius: 8px;
	padding: 6px 12px;
	opacity: 1;
}
body.bs-birth-page .ui-datepicker .ui-datepicker-buttonpane .ui-priority-primary { background: #d9b36a; border-color: #d9b36a; color: #15142c; font-weight: 700; }

/* Map (Leaflet) */
.bs-birth .leaflet-map,
.bs-birth .leaflet-container {
	border-radius: 12px;
	border: 1px solid var(--bf-line);
	overflow: hidden;
	background: #0f0e22;
}
.bs-birth .leaflet-tile-pane { filter: invert(0.92) hue-rotate(180deg) brightness(0.95) contrast(0.9); }
.bs-birth .leaflet-control-zoom a,
.bs-birth .leaflet-bar a { background: #1f1d3d; color: #ece6d8; border-color: #4a4780; }
.bs-birth .leaflet-bar a:hover { background: #2c2a58; }
.bs-birth .leaflet-control-geocoder {
	background: #1f1d3d;
	border: 1px solid #4a4780 !important;
	border-radius: 10px;
	color: #ece6d8;
}
.bs-birth .leaflet-control-geocoder-form input {
	min-height: 40px;
	background: #15142c;
	color: #ece6d8;
	border: 0;
	border-radius: 8px;
	font-size: 16px;
}
.bs-birth .leaflet-control-geocoder-alternatives { background: #1f1d3d; color: #ece6d8; }
.bs-birth .leaflet-control-geocoder-alternatives li:hover,
.bs-birth .leaflet-control-geocoder-selected { background: #2c2a58; }
.bs-birth .leaflet-control-attribution { background: rgba(21, 20, 44, 0.8) !important; color: #8b8fb8; }
.bs-birth .leaflet-control-attribution a { color: #c9c4d8; }
.bs-birth .markers-instruction .description { color: var(--bf-muted); }
.bs-birth .osm-markers input[type="text"] { min-height: 44px; margin-top: 10px; }
.bs-birth .osm-markers .tools .button,
.bs-birth .osm-markers button { background: transparent; border: 1px solid var(--bf-line); color: var(--bf-soft); border-radius: 8px; }

/* Errors */
.bs-birth .acf-notice,
.bs-birth .acf-error-message {
	background: rgba(227, 138, 138, 0.1);
	border: 1px solid rgba(227, 138, 138, 0.5);
	border-left: 4px solid var(--bf-rose);
	border-radius: 10px;
	color: var(--bf-text);
	margin: 0 0 12px;
	padding: 10px 14px;
}
.bs-birth .acf-notice p,
.bs-birth .acf-error-message p { margin: 0; color: var(--bf-text); }
.bs-birth .acf-notice .acf-notice-dismiss { color: var(--bf-muted); }
.bs-birth .acf-field.acf-error input,
.bs-birth .acf-field.acf-error .select2-selection { border-color: var(--bf-rose) !important; }

/* Submit */
.bs-birth .acf-form-submit { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.bs-birth .acf-form-submit .acf-button {
	min-height: 54px;
	padding: 14px 34px;
	font-size: 18px;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(217, 179, 106, 0.25);
}
.bs-birth .acf-form-submit .acf-button:focus-visible { outline: 2px solid var(--bf-head); outline-offset: 3px; }
.bs-birth .acf-spinner { filter: invert(1); }

/* Sign in (collapsed by default) */
.bs-birth .bs-signin {
	margin: 0 0 20px;
	background: transparent;
	border: 1px solid var(--bf-line);
	border-radius: 12px;
}
.bs-birth .bs-signin summary {
	cursor: pointer;
	padding: 14px 18px;
	color: var(--bf-soft);
	list-style: none;
	min-height: 48px;
}
.bs-birth .bs-signin summary::-webkit-details-marker { display: none; }
.bs-birth .bs-signin summary span { color: var(--bf-gold); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.bs-birth .bs-signin summary:focus-visible { outline: 2px solid var(--bf-gold); outline-offset: 2px; border-radius: 12px; }
.bs-birth .bs-signin__body { padding: 0 18px 18px; }
.bs-birth #bs-signin-form label { display: block; margin-bottom: 6px; color: var(--bf-head); font-weight: 600; }
.bs-birth #bs-signin-form p { margin: 0 0 14px; }
.bs-birth #bs-signin-form .login-remember label { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; color: var(--bf-soft); }
.bs-birth #bs-signin-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--bf-gold); }
.bs-birth #bs-signin-form .button-primary,
.bs-birth #bs-signin-form input[type="submit"] {
	min-height: 48px;
	padding: 10px 26px;
	background: var(--bf-gold);
	color: var(--bf-bg);
	border: 0;
	border-radius: 10px;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
}
.bs-birth .bs-signin__lost { margin: 0; font-size: 14px; }
.bs-birth .bs-signin__lost a { color: var(--bf-soft); }

/* Signed-in extras */
.bs-birth .bs-account-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 16px;
	color: var(--bf-soft);
}
.bs-birth .bs-account-bar strong { color: var(--bf-head); }
.bs-birth .bs-account-bar a { color: var(--bf-gold); }
.bs-birth .bs-notice {
	margin-bottom: 16px;
	padding: 12px 16px;
	background: rgba(127, 196, 164, 0.1);
	border: 1px solid rgba(127, 196, 164, 0.5);
	border-left: 4px solid var(--bf-sage);
	border-radius: 10px;
}
.bs-birth .bs-summary {
	margin-bottom: 20px;
	padding: 20px 24px;
	border: 1px solid rgba(217, 179, 106, 0.45);
	border-radius: 16px;
	background: linear-gradient(150deg, var(--bf-card), var(--wp--preset--color--dusk, #191836));
}
.bs-birth .bs-summary p { margin: 0; }
.bs-birth .bs-summary__label { color: var(--bf-gold); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px !important; }
.bs-birth .bs-summary__line { color: var(--bf-head); font-family: var(--wp--preset--font-family--cormorant, Georgia, serif); font-size: 24px; line-height: 1.25; }
.bs-birth .bs-summary__hint { color: var(--bf-muted); font-size: 14px; margin-top: 8px !important; }

.bs-birth .bs-privacy-note { margin-top: 14px; color: var(--bf-muted); font-size: 14px; }

@media (max-width: 600px) {
	.bs-birth .bs-step__head { gap: 12px; }
	.bs-birth .bs-step__num { width: 34px; height: 34px; }
	.bs-birth .acf-form-submit .acf-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.bs-birth * { transition: none !important; }
}
