/**
 * Delphi RFP forms (indigo/proposal-form). The theme supplies the base .rfp-*
 * styles; these rules cover variant layout, section headings, the Wedding
 * Needs checkbox group and the custom date/validation controls.
 */

/* The inactive Delphi form must never render, even if a theme rule sets
   display on .rfp-form. */
.rfp-delphi-form[hidden] {
	display: none !important;
}

/* Radio selection state: the theme paints the checked dot via an .is-checked
   class on the label (its indigo.js initProposalForm() did this for the old
   single-form layout; indigo-rfp.js keeps the class in sync for this one).
   No CSS here on purpose — the ring/fill styling stays the theme's, so the
   selected state looks exactly like the rest of the site. */

/* Arrival date feedback: the mask keeps a typed value non-empty, so
   :invalid here only appears once there is something wrong to show. */
.rfp-delphi-form input[data-indigo-date-invalid] {
	border-color: #b3261e;
}

/* Arrival date calendar picker. The input stays the masked MM/DD/YYYY text
   field; the popup only writes into it. */
.rfp-date-pick {
	position: relative;
}

.rfp-delphi-form .rfp-date-pick input {
	padding-right: 40px;
}

.rfp-date-toggle {
	position: absolute;
	right: 2px;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	padding: 0;
	color: inherit;
	cursor: pointer;
}

.rfp-date-toggle svg {
	width: 16px;
	height: 16px;
}

.rfp-date-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.rfp-date-panel {
	position: absolute;
	z-index: 40;
	top: calc(100% + 6px);
	right: 0;
	min-width: 252px;
	padding: 10px;
	background: #fff;
	border: 1px solid #ccd3de;
	box-shadow: 0 14px 34px rgba(15, 30, 60, 0.14);
}

.rfp-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.rfp-cal-title {
	font-size: 14px;
	font-weight: 600;
}

.rfp-cal-nav {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	padding: 0;
	color: inherit;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.rfp-cal-nav:hover {
	background: #f3f5f9;
}

.rfp-cal-nav:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.rfp-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.rfp-cal-dow {
	font-size: 11px;
	letter-spacing: 0.02em;
	text-align: center;
	color: #8a93a6;
	padding: 4px 0;
}

.rfp-cal-spacer {
	min-height: 30px;
}

.rfp-cal-day {
	height: 30px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	padding: 0;
	font: inherit;
	font-size: 13px;
	color: inherit;
	cursor: pointer;
}

.rfp-cal-day:hover {
	background: #f3f5f9;
}

.rfp-cal-day:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.rfp-cal-day.is-today {
	font-weight: 700;
}

.rfp-cal-day.is-selected {
	box-shadow: inset 0 0 0 2px currentColor;
	font-weight: 600;
}

/* Variant sections and the three-column rows from the Salesforce forms. */
.rfp-delphi-form .rfp-section-title {
	margin: 0 0 1.7rem;
	color: var(--navy);
	font-family: Beausite Classic, Avenir Next, ui-sans-serif, system-ui, sans-serif;
	font-size: clamp(1.35rem, 2vw, 1.75rem);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
	/* Form headings must stay visible when a hidden variant is revealed after
	   the theme's IntersectionObserver has already run. */
	opacity: 1 !important;
	transform: none !important;
}

.rfp-delphi-form .rfp-section-title-event {
	margin-top: 0.4rem;
	padding-top: 2rem;
	border-top: 1px solid #14213d29;
}

.rfp-delphi-form .rfp-row-three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rfp-delphi-form .rfp-row-event-name {
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

.rfp-delphi-form .rfp-field[data-rfp-max-rooms][hidden] {
	display: none !important;
}

/* Wedding Needs: visible checkboxes posting one repeated Salesforce field. */
.rfp-delphi-form .rfp-checkbox-field {
	min-width: 0;
	padding: 0;
	border: 0;
}

.rfp-delphi-form .rfp-checkbox-field > .rfp-label {
	margin-bottom: 1rem;
	padding: 0;
}

.rfp-checkbox-group {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem 1.5rem;
}

.rfp-checkbox-option {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	color: var(--navy);
	font-size: 0.95rem;
	line-height: 1.4;
	cursor: pointer;
}

.rfp-checkbox-option input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--navy);
}

.rfp-checkbox-option:has(input:focus-visible) {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

/* Inline errors mirror the theme's existing validation language. */
.rfp-delphi-form .rfp-error {
	margin: 0.55rem 0 0;
	color: #9c2b1f;
	font-size: 0.85rem;
	line-height: 1.45;
	letter-spacing: 0.01em;
}

.rfp-delphi-form .rfp-field.has-error input,
.rfp-delphi-form .rfp-field.has-error textarea,
.rfp-delphi-form .rfp-field.has-error .rfp-select-wrap select {
	border-color: #9c2b1f;
}

@media (width <= 45em) {
	.rfp-delphi-form .rfp-row-three,
	.rfp-delphi-form .rfp-row-event-name,
	.rfp-checkbox-group {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.rfp-checkbox-group {
		gap: 0.85rem;
	}
}
