/* =========================================================
   Bitelo Onboarding / Location Discovery Flow
   ========================================================= */

.bit-onboarding-overlay,
.bit-onboarding-overlay * {
	box-sizing: border-box;
}

.bit-onboarding-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--bit-font);
	color: var(--bit-text);
	overflow: hidden;
}

.bit-onboarding-overlay.is-exiting {
	animation: bit-fade-out 0.35s ease forwards;
}

.bit-onboarding-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 13, 17, 0.45);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 0;
}

.bit-onboarding-container {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	max-width: 100%;
	overflow: hidden;
}

.bit-onboarding-container > div {
	width: 100%;
	height: 100%;
}

/* Splash screen */
.bit-splash {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: #00C2FF;
	color: #ffffff;
	overflow: hidden;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
	animation: bit-splash-in 0.6s ease forwards;
}

.bit-splash.is-reduced {
	animation: none;
}

.bit-splash-content {
	position: relative;
	z-index: 2;
	text-align: center;
	animation: bit-splash-logo 1.8s ease forwards;
}

.bit-splash.is-reduced .bit-splash-content {
	animation: none;
}

.bit-splash-logo-img {
	max-width: 180px;
	max-height: 72px;
	height: auto;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

.bit-splash-logo-text {
	font-size: 4rem;
	font-weight: var(--bit-weight-extrabold);
	letter-spacing: -0.03em;
	text-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.bit-splash-logo-text span {
	color: #0b0d11;
}

.bit-splash-bubble {
	position: absolute;
	opacity: 0.85;
	z-index: 1;
	pointer-events: none;
	transform-origin: center;
	animation: bit-float 3.5s ease-in-out infinite;
}

.bit-splash.is-reduced .bit-splash-bubble,
.bit-splash.is-reduced .bit-splash-orb {
	animation: none;
}

.bit-splash-orb {
	position: absolute;
	width: 120px;
	height: 120px;
	background: rgba(255, 255, 255, 0.16);
	border-radius: 50%;
	z-index: 0;
	animation: bit-pulse 4s ease-in-out infinite;
}

/* Shared screens */
.bit-location-screen,
.bit-location-confirmation,
.bit-location-denied,
.bit-manual-address,
.bit-onboarding-complete,
.bit-city-explorer {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	background: var(--bit-bg);
	padding: env(safe-area-inset-top) var(--bit-space-5) env(safe-area-inset-bottom) var(--bit-space-5);
	overflow-y: auto;
	animation: bit-slide-up 0.35s ease forwards;
}

.bit-onboarding-title {
	font-size: var(--bit-text-2xl);
	font-weight: var(--bit-weight-bold);
	line-height: var(--bit-line-tight);
	margin: 0 0 var(--bit-space-2);
	color: var(--bit-text);
}

.bit-onboarding-text {
	font-size: var(--bit-text-base);
	line-height: var(--bit-line-normal);
	color: var(--bit-text-muted);
	margin: 0 0 var(--bit-space-6);
}

.bit-onboarding-error {
	background: var(--bit-error-100);
	color: var(--bit-error);
	border-radius: var(--bit-radius-md);
	padding: var(--bit-space-3) var(--bit-space-4);
	font-size: var(--bit-text-sm);
	font-weight: var(--bit-weight-medium);
	margin-bottom: var(--bit-space-4);
}

.bit-location-illustration {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
}

.bit-location-icon {
	font-size: 6rem;
	line-height: 1;
	filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
}

.bit-onboarding-actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: var(--bit-space-3);
	padding-bottom: var(--bit-space-4);
}

.bit-btn {
	border: none;
	font-family: inherit;
	font-size: var(--bit-text-base);
	font-weight: var(--bit-weight-semibold);
	line-height: 1.35;
	border-radius: var(--bit-radius-pill);
	padding: var(--bit-space-3) var(--bit-space-5);
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
	min-height: 48px;
	min-width: 48px;
}

.bit-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.bit-btn-primary {
	background: var(--bit-primary);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(255, 101, 69, 0.25);
}

.bit-btn-primary:hover:not(:disabled),
.bit-btn-primary:focus {
	background: var(--bit-primary-600);
	transform: translateY(-1px);
}

.bit-btn-secondary {
	background: #ffffff;
	color: var(--bit-text);
	border: 1px solid var(--bit-border-strong);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bit-btn-secondary:hover:not(:disabled),
.bit-btn-secondary:focus {
	background: var(--bit-gray-50);
	transform: translateY(-1px);
}

.bit-btn-block {
	width: 100%;
}

/* Confirmation / denied */
.bit-location-confirmation,
.bit-location-denied,
.bit-onboarding-complete {
	align-items: center;
	justify-content: center;
	text-align: center;
}

.bit-confirmation-icon {
	width: 72px;
	height: 72px;
	font-size: 2.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bit-success-100);
	color: var(--bit-success);
	border-radius: 50%;
	margin-bottom: var(--bit-space-5);
	box-shadow: 0 4px 16px rgba(34, 160, 107, 0.18);
}

/* Manual address */
.bit-manual-address {
	padding-top: var(--bit-space-6);
}

.bit-onboarding-back {
	align-self: flex-start;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: var(--bit-gray-100);
	color: var(--bit-text);
	font-size: 1.25rem;
	cursor: pointer;
	margin-bottom: var(--bit-space-4);
	transition: background 0.15s ease;
}

.bit-onboarding-back:hover,
.bit-onboarding-back:focus {
	background: var(--bit-gray-200);
}

.bit-manual-form {
	display: flex;
	flex-direction: column;
	gap: var(--bit-space-4);
	padding-bottom: var(--bit-space-6);
}

.bit-form-row {
	display: flex;
	flex-direction: column;
	gap: var(--bit-space-1);
}

.bit-form-row label {
	font-size: var(--bit-text-sm);
	font-weight: var(--bit-weight-semibold);
	color: var(--bit-text);
}

.bit-input {
	width: 100%;
	min-height: 48px;
	padding: var(--bit-space-3) var(--bit-space-4);
	font-family: inherit;
	font-size: var(--bit-text-base);
	color: var(--bit-text);
	background: #ffffff;
	border: 1px solid var(--bit-border-strong);
	border-radius: var(--bit-radius-md);
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bit-input:focus {
	border-color: var(--bit-primary);
	box-shadow: 0 0 0 3px rgba(255, 101, 69, 0.12);
}

.bit-input-error {
	font-size: var(--bit-text-xs);
	color: var(--bit-error);
	min-height: 1.2em;
}

/* City explorer */
.bit-city-explorer {
	padding: 0;
	background: var(--bit-bg);
}

.bit-map {
	flex: 1 1 35%;
	min-height: 160px;
	background: var(--bit-gray-200);
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: var(--bit-space-2);
}

.bit-map--placeholder {
	background: linear-gradient(135deg, #e5f8fc 0%, #e9f8e1 100%);
}

.bit-map-pin {
	font-size: 2.5rem;
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.bit-map-note {
	font-size: var(--bit-text-sm);
	color: var(--bit-text-muted);
}

.bit-city-sheet {
	flex: 1 1 65%;
	background: #ffffff;
	border-radius: var(--bit-radius-xl) var(--bit-radius-xl) 0 0;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
	padding: var(--bit-space-4) var(--bit-space-5) env(safe-area-inset-bottom) var(--bit-space-5);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.bit-city-sheet-handle {
	width: 48px;
	height: 5px;
	background: var(--bit-gray-300);
	border-radius: var(--bit-radius-pill);
	margin: 0 auto var(--bit-space-4);
}

.bit-city-search {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: var(--bit-space-3);
}

.bit-city-search .bit-icon {
	position: absolute;
	left: var(--bit-space-3);
	width: 20px;
	height: 20px;
	color: var(--bit-text-subtle);
	pointer-events: none;
}

.bit-city-search input {
	width: 100%;
	padding-left: var(--bit-space-8);
}

.bit-city-list {
	flex: 1;
	overflow-y: auto;
	margin: 0 calc(var(--bit-space-5) * -1);
	padding: 0 var(--bit-space-5);
	padding-bottom: var(--bit-space-4);
}

.bit-city-item {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--bit-space-2);
	padding: var(--bit-space-3) var(--bit-space-4);
	background: #ffffff;
	border: 1px solid var(--bit-border);
	border-radius: var(--bit-radius-md);
	margin-bottom: var(--bit-space-2);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.bit-city-item:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.bit-city-item:hover:not(:disabled),
.bit-city-item:focus {
	background: var(--bit-gray-50);
	border-color: var(--bit-border-strong);
	outline: none;
}

.bit-city-item.is-selected {
	border-color: var(--bit-primary);
	background: var(--bit-primary-100);
	box-shadow: 0 0 0 1px var(--bit-primary);
}

.bit-city-name {
	font-weight: var(--bit-weight-semibold);
	color: var(--bit-text);
}

.bit-city-meta {
	font-size: var(--bit-text-sm);
	color: var(--bit-text-muted);
}

.bit-city-status {
	display: inline-block;
	margin-left: var(--bit-space-2);
	font-size: var(--bit-text-xs);
	color: var(--bit-warning);
}

.bit-city-chevron {
	font-size: 1.25rem;
	color: var(--bit-text-subtle);
}

/* Animations */
@keyframes bit-splash-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes bit-splash-logo {
	0% { opacity: 0; transform: scale(0.92); }
	40% { opacity: 1; transform: scale(1); }
	100% { opacity: 1; transform: scale(1); }
}

@keyframes bit-float {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-14px) rotate(4deg); }
}

@keyframes bit-pulse {
	0%, 100% { transform: scale(1); opacity: 0.7; }
	50% { transform: scale(1.08); opacity: 0.4; }
}

@keyframes bit-slide-up {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes bit-fade-out {
	from { opacity: 1; }
	to { opacity: 0; visibility: hidden; }
}

/* Desktop */
@media (min-width: 768px) {
	.bit-onboarding-container {
		height: auto;
		max-height: calc(100vh - var(--bit-space-8) * 2);
		max-width: 560px;
		border-radius: var(--bit-radius-xl);
		box-shadow: var(--bit-shadow-xl);
		overflow: hidden;
	}

	.bit-splash,
	.bit-location-screen,
	.bit-location-confirmation,
	.bit-location-denied,
	.bit-manual-address,
	.bit-onboarding-complete,
	.bit-city-explorer {
		min-height: 620px;
		border-radius: var(--bit-radius-xl);
	}

	.bit-city-explorer {
		flex-direction: row;
		min-height: 540px;
	}

	.bit-city-sheet {
		border-radius: 0 var(--bit-radius-xl) var(--bit-radius-xl) 0;
		box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
		padding: var(--bit-space-6);
	}

	.bit-city-list {
		margin: 0 calc(var(--bit-space-6) * -1);
		padding: 0 var(--bit-space-6);
	}

	.bit-map {
		border-radius: var(--bit-radius-xl) 0 0 var(--bit-radius-xl);
	}
}
