/* =========================================================
   Formulario de confirmación (RSVP)
   ========================================================= */
.br {
	--ink: #2a1a10;
	--text: #4a3d33;
	--muted: #7a6a5d;
	--gold: #a87410;
	--gold-dark: #885c09;
	--gold-soft: #c9a25a;
	--cream: #fbf6ef;
	--sand: #f4ebdf;
	--line: #e8dccd;
	--ease: cubic-bezier(.16, 1, .3, 1);
	--serif: "EB Garamond", Georgia, serif;
	--sans: "IBM Plex Sans", system-ui, sans-serif;

	position: fixed;
	inset: 0;
	z-index: 2000000000;
	display: grid;
	place-items: center;
	padding: 20px;
	font-family: var(--sans);
	color: var(--text);
}
.br[hidden] {
	display: none;
}
html.br-lock,
html.br-lock body {
	overflow: hidden;
}
.br *,
.br *::before,
.br *::after {
	box-sizing: border-box;
}
.br svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.br__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(29, 20, 14, .55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity .35s var(--ease);
}
.br__dialog {
	position: relative;
	width: min(600px, 100%);
	max-height: min(92vh, 900px);
	max-height: min(92dvh, 900px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border-radius: 26px;
	box-shadow: 0 40px 100px -30px rgba(29, 20, 14, .55);
	padding: 40px 44px 30px;
	opacity: 0;
	transform: translateY(26px) scale(.97);
	transition: opacity .45s var(--ease), transform .55s var(--ease);
	scrollbar-width: thin;
}
.br.is-open .br__backdrop {
	opacity: 1;
}
.br.is-open .br__dialog {
	opacity: 1;
	transform: none;
}

.br__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	background: var(--cream);
	color: var(--ink);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background-color .3s var(--ease), transform .4s var(--ease);
}
.br__close svg {
	width: 18px;
	height: 18px;
}
.br__close:hover {
	background: var(--sand);
	transform: rotate(90deg);
}

/* ---------- Cabecera ---------- */
.br__head {
	text-align: center;
	margin-bottom: 26px;
}
.br__eyebrow {
	margin: 0 0 10px !important;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .3em;
	color: var(--gold);
}
.br__title {
	font-family: var(--serif) !important;
	font-weight: 500 !important;
	font-size: clamp(32px, 6vw, 42px) !important;
	line-height: 1.05 !important;
	color: var(--ink) !important;
	margin: 0 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}
.br__steps {
	list-style: none;
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 18px 0 0 !important;
	padding: 0;
}
.br__steps li {
	width: 28px;
	height: 4px;
	border-radius: 4px;
	background: var(--line);
	transition: background-color .4s var(--ease), width .4s var(--ease);
}
.br__steps li.is-on {
	background: var(--gold);
	width: 40px;
}
.br__steps.is-single {
	visibility: hidden;
}

/* ---------- Pasos ---------- */
.br__step {
	display: none;
}
.br__step.is-active {
	display: block;
	animation: br-in .5s var(--ease);
}
.br__step.is-back {
	animation-name: br-in-back;
}
@keyframes br-in {
	from {
		opacity: 0;
		transform: translateX(18px);
	}
}
@keyframes br-in-back {
	from {
		opacity: 0;
		transform: translateX(-18px);
	}
}

/* ---------- Campos ---------- */
.br__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.br__field {
	display: block;
	margin: 0 0 16px;
}
.br__field > span,
.br__fieldset legend {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink);
	margin-bottom: 8px;
	padding: 0;
}
.br__field em {
	font-weight: 400;
	color: var(--muted);
}
.br__field input,
.br__field textarea {
	width: 100%;
	border: 1px solid var(--line) !important;
	border-radius: 14px !important;
	background: #fff !important;
	padding: 14px 16px !important;
	font: 16px/1.5 var(--sans) !important;
	color: var(--ink) !important;
	box-shadow: none !important;
	transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.br__field input {
	height: 52px;
}
.br__field textarea {
	resize: vertical;
	min-height: 96px;
}
.br__field input:focus,
.br__field textarea:focus {
	outline: none !important;
	border-color: var(--gold) !important;
	box-shadow: 0 0 0 4px rgba(168, 116, 16, .12) !important;
}
.br__field textarea::placeholder {
	color: #b3a698;
}
.br__fieldset {
	border: 0;
	padding: 0;
	margin: 6px 0 18px;
	min-width: 0;
}

.br .is-invalid input,
.br .is-invalid textarea {
	border-color: #c4553f !important;
	box-shadow: 0 0 0 4px rgba(196, 85, 63, .1) !important;
}
.br .is-invalid .br__choice-card,
.br .is-invalid .br__pill span {
	border-color: #c4553f;
}
.br .is-invalid {
	animation: br-shake .4s;
}
@keyframes br-shake {
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

/* Opciones grandes (sí / no) */
.br__choices {
	display: grid;
	gap: 12px;
}
.br__choices--big {
	grid-template-columns: 1fr 1fr;
}
.br__choice,
.br__pill {
	position: relative;
	cursor: pointer;
	margin: 0;
}
.br__choice input,
.br__pill input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.br__choice-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 4px;
	height: 100%;
	padding: 22px 14px 18px;
	border: 1.5px solid var(--line);
	border-radius: 18px;
	background: #fff;
	transition: border-color .3s var(--ease), background-color .3s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.br__choice:hover .br__choice-card {
	transform: translateY(-3px);
	box-shadow: 0 16px 30px -22px rgba(42, 26, 16, .45);
}
.br__choice-icon {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--cream);
	color: var(--gold-dark);
	display: grid;
	place-items: center;
	margin-bottom: 6px;
	transition: background-color .3s var(--ease), color .3s var(--ease), transform .4s var(--ease);
}
.br__choice-icon svg {
	width: 22px;
	height: 22px;
}
.br__choice-card strong {
	font-family: var(--serif);
	font-size: 21px;
	font-weight: 500;
	color: var(--ink);
	line-height: 1.15;
}
.br__choice-card small {
	font-size: 13px;
	color: var(--muted);
}
.br__choice input:checked + .br__choice-card {
	border-color: var(--gold);
	background: var(--cream);
	box-shadow: 0 0 0 3px rgba(168, 116, 16, .14);
}
.br__choice input:checked + .br__choice-card .br__choice-icon {
	background: var(--gold);
	color: #fff;
	transform: scale(1.06);
}
.br__choice input:focus-visible + .br__choice-card,
.br__pill input:focus-visible + span {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

/* Opciones tipo píldora */
.br__choices--pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.br__pill span {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--line);
	border-radius: 999px;
	font-size: 14.5px;
	font-weight: 500;
	color: var(--ink);
	background: #fff;
	transition: border-color .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.br__pill:hover span {
	border-color: var(--gold-soft);
}
.br__pill input:checked + span {
	background: var(--gold);
	border-color: var(--gold);
	color: #fff;
}

.br__note {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 2px 0 6px !important;
	padding: 12px 14px;
	border-radius: 14px;
	background: var(--cream);
	font-size: 13px;
	line-height: 1.55;
	color: var(--muted);
}
.br__note svg {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	color: var(--gold);
}

.br__summary {
	display: grid;
	gap: 8px;
	padding: 16px 18px;
	border-radius: 16px;
	background: var(--cream);
	margin-top: 4px;
}
.br__summary:empty {
	display: none;
}
.br__summary div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-size: 14px;
}
.br__summary span {
	color: var(--muted);
}
.br__summary strong {
	color: var(--ink);
	font-weight: 600;
	text-align: right;
	white-space: pre-line;
}

.br__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.br__error {
	margin: 4px 0 0 !important;
	padding: 10px 14px;
	border-radius: 12px;
	background: #fbeeea;
	color: #a8402c;
	font-size: 13.5px;
}
.br__error[hidden] {
	display: none;
}

/* ---------- Botones ---------- */
.br__nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid #f1e8dc;
}
.br__nav[hidden] {
	display: none;
}
.br__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 0 26px;
	border-radius: 999px;
	border: 1px solid transparent;
	font: 600 13px/1 var(--sans);
	letter-spacing: .12em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease), opacity .3s;
}
.br__btn svg {
	width: 16px;
	height: 16px;
	transition: transform .4s var(--ease);
}
.br__btn[hidden] {
	display: none;
}
.br__btn:disabled {
	opacity: .6;
	cursor: progress;
}
.br__btn--gold {
	margin-left: auto;
	background: var(--gold);
	color: #fff;
	box-shadow: 0 10px 24px -10px rgba(136, 92, 9, .6);
}
.br__btn--gold:hover:not(:disabled) {
	background: var(--gold-dark);
	transform: translateY(-2px);
	box-shadow: 0 16px 30px -12px rgba(136, 92, 9, .7);
}
.br__btn--gold:hover:not(:disabled) svg {
	transform: translateX(3px);
}
.br__btn--gold.is-final svg {
	display: none;
}
.br__btn--ghost {
	background: transparent;
	color: var(--muted);
	padding: 0 14px 0 8px;
}
.br__btn--ghost:hover {
	color: var(--ink);
}
.br__btn--ghost:hover svg {
	transform: translateX(-3px);
}
.br__btn--line {
	background: transparent;
	color: var(--ink);
	border-color: var(--ink);
}
.br__btn--line:hover {
	background: var(--ink);
	color: #fff;
}

/* ---------- Gracias ---------- */
.br.is-done .br__steps {
	visibility: hidden;
}
.br__done {
	text-align: center;
	padding: 6px 0 4px;
}
.br__done-icon {
	width: 76px;
	height: 76px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: var(--gold);
	color: #fff;
	display: grid;
	place-items: center;
	animation: br-pop .7s var(--ease) .1s backwards;
	box-shadow: 0 0 0 10px rgba(168, 116, 16, .12);
}
.br__done-icon svg {
	width: 36px;
	height: 36px;
	stroke-width: 2.4;
	stroke-dasharray: 30;
	stroke-dashoffset: 30;
	animation: br-draw .6s var(--ease) .45s forwards;
}
@keyframes br-pop {
	from {
		transform: scale(.4);
		opacity: 0;
	}
}
@keyframes br-draw {
	to {
		stroke-dashoffset: 0;
	}
}
.br__done h3 {
	font-family: var(--serif) !important;
	font-weight: 500 !important;
	font-size: 32px !important;
	color: var(--ink) !important;
	margin: 0 0 8px !important;
	text-transform: none !important;
}
.br__done p {
	font-size: 15.5px;
	line-height: 1.65;
	max-width: 400px;
	margin: 0 auto !important;
}
.br__done-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 22px 0 6px;
}
.br__done-actions[hidden] {
	display: none;
}
.br__link {
	display: inline-flex;
	align-items: center;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px solid var(--line);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--gold-dark) !important;
	text-decoration: none !important;
	transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.br__link:hover {
	background: var(--gold);
	border-color: var(--gold);
	color: #fff !important;
}
.br__done .br__btn--line {
	margin-top: 18px;
}

/* ---------- Móvil: hoja que sube desde abajo ---------- */
@media (max-width: 600px) {
	.br {
		padding: 0;
		place-items: end stretch;
	}
	.br__dialog {
		width: 100%;
		max-height: 94dvh;
		border-radius: 24px 24px 0 0;
		padding: 30px 20px calc(18px + env(safe-area-inset-bottom));
		transform: translateY(40px);
	}
	.br__close {
		top: 12px;
		right: 12px;
	}
	.br__row {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.br__choice-card {
		padding: 18px 10px 14px;
	}
	.br__choice-card strong {
		font-size: 18px;
	}
	.br__nav {
		position: sticky;
		bottom: calc(-18px - env(safe-area-inset-bottom));
		background: #fff;
		margin: 18px -20px 0;
		padding: 14px 20px calc(4px + env(safe-area-inset-bottom));
	}
	.br__btn--gold {
		flex: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.br *,
	.br *::before,
	.br *::after {
		animation: none !important;
		transition: none !important;
	}
	.br__done-icon svg {
		stroke-dashoffset: 0;
	}
}
