/**
 * Booking form styles.
 *
 * The YesTourBD theme already defines the tokens and the .field / .btn
 * components, so this file only fills the gaps and provides a plain fallback
 * for any other theme the plugin is used with.
 */

.ytbd-form-wrap {
	--ytbd-fallback-navy: #0B315F;
	--ytbd-fallback-teal: #00A99D;
	--ytbd-fallback-border: #E2E8F0;
	--ytbd-fallback-muted: #64748B;
	max-width: 720px;
	scroll-margin-top: 100px;
}

.ytbd-form__foot {
	margin-top: 1.5rem;
}

.ytbd-form__result:empty {
	display: none;
}

.ytbd-form__result {
	margin-top: 1rem;
}

/* Fallbacks for non-YesTourBD themes: only applied when the theme has not
   defined the shared components. */
.ytbd-form-wrap .field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.ytbd-form-wrap .field__label {
	font-weight: 700;
	color: var(--ytbd-navy, var(--ytbd-fallback-navy));
}

.ytbd-form-wrap .field__hint {
	font-size: 0.8125rem;
	color: var(--ytbd-muted, var(--ytbd-fallback-muted));
}

.ytbd-form-wrap .req {
	color: #DC2626;
}

.ytbd-form-wrap input[type='text'],
.ytbd-form-wrap input[type='tel'],
.ytbd-form-wrap input[type='email'],
.ytbd-form-wrap input[type='date'],
.ytbd-form-wrap input[type='number'],
.ytbd-form-wrap select,
.ytbd-form-wrap textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--ytbd-border, var(--ytbd-fallback-border));
	border-radius: 8px;
	background: #fff;
	font: inherit;
}

.ytbd-form-wrap .ytbd-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ytbd-form-wrap .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--ytbd-teal, var(--ytbd-fallback-teal));
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
}

.ytbd-form-wrap .btn--block {
	width: 100%;
}

.ytbd-form-wrap .btn.is-busy {
	opacity: 0.62;
	pointer-events: none;
}

.ytbd-success .cta-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* --------------------------------------------------------------- *
 * Number verification
 * --------------------------------------------------------------- */

/*
 * .btn sets display:inline-flex, which beats the browser's own
 * [hidden] { display:none } on specificity — so the verify button sat there
 * from the start, before any code had been sent. Anything hidden inside the
 * form stays hidden.
 */
.ytbd-form [hidden] {
	display: none !important;
}

.ytbd-verify {
	border: 1px solid var(--ytbd-border, var(--ytbd-fallback-border));
	border-radius: var(--ytbd-radius-md, 12px);
	background: var(--ytbd-bg, #F7F9FC);
	padding: 1rem 1.1rem 1.15rem;
	margin-bottom: 1rem;
}

.ytbd-verify__head {
	display: flex;
	gap: 0.7rem;
	align-items: flex-start;
	margin-bottom: 0.85rem;
}

.ytbd-verify__badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--ytbd-border, var(--ytbd-fallback-border));
	color: var(--ytbd-muted, var(--ytbd-fallback-muted));
}

/* The tick only appears once the number is proven. */
.ytbd-verify__tick {
	opacity: 0;
	transition: opacity 0.15s ease;
}

.ytbd-verify__title {
	margin: 0 0 0.15rem;
	font-weight: 700;
	line-height: 1.3;
}

.ytbd-verify__note {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--ytbd-muted, var(--ytbd-fallback-muted));
}

.ytbd-verify__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
}

.ytbd-verify__code {
	flex: 0 1 11rem;
	min-width: 0;
	text-align: center;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.4em;
	text-indent: 0.4em; /* balance the trailing letter-space */
	font-variant-numeric: tabular-nums;
}

.ytbd-verify__code:disabled {
	background: #fff;
	opacity: 0.55;
	cursor: not-allowed;
}

.ytbd-verify__btn {
	flex: 0 0 auto;
}

/* Sent: the panel is live and waiting for the code. */
.ytbd-verify.is-sent {
	border-color: var(--ytbd-teal, var(--ytbd-fallback-teal));
	background: var(--ytbd-teal-light, #E8F8F6);
}

.ytbd-verify.is-sent .ytbd-verify__badge {
	border-color: var(--ytbd-teal, var(--ytbd-fallback-teal));
	color: var(--ytbd-teal, var(--ytbd-fallback-teal));
}

/* Once a code is out, sending again is the lesser action of the two. */
.ytbd-verify.is-sent [data-ytbd-otp-send] {
	background: transparent;
	color: var(--ytbd-navy, var(--ytbd-fallback-navy));
	border: 1px solid var(--ytbd-border, var(--ytbd-fallback-border));
	box-shadow: none;
}

.ytbd-verify.is-sent [data-ytbd-otp-send]:hover {
	border-color: var(--ytbd-teal, var(--ytbd-fallback-teal));
	color: var(--ytbd-teal, var(--ytbd-fallback-teal));
}

/* Proven: the row collapses, because there is nothing left to do. */
.ytbd-verify.is-verified {
	border-color: #067647;
	background: #ECFDF3;
}

.ytbd-verify.is-verified .ytbd-verify__row {
	display: none;
}

.ytbd-verify.is-verified .ytbd-verify__badge {
	border-color: #067647;
	background: #067647;
	color: #fff;
}

.ytbd-verify.is-verified .ytbd-verify__tick {
	opacity: 1;
}

/* Nothing is required of them any more. */
.ytbd-verify.is-verified .req {
	display: none;
}

.ytbd-verify.is-verified .ytbd-verify__note {
	color: #067647;
	font-weight: 600;
}

.ytbd-verify.has-error {
	border-color: #b42318;
	background: #FEF3F2;
}

.ytbd-verify.has-error .ytbd-verify__note {
	color: #b42318;
}

.ytbd-verify.has-error .ytbd-verify__badge {
	border-color: #b42318;
	color: #b42318;
}

@media (max-width: 480px) {
	.ytbd-verify__code {
		flex: 1 1 100%;
	}

	.ytbd-verify__btn {
		flex: 1 1 auto;
	}
}
