/**
 * Homey Flow Bibliotheek Installer — modal styling (proof-of-concept).
 * Mobielvriendelijk: volle breedte, één kolom, geen horizontale scroll
 * (sectie 43).
 *
 * @package HomeyFlowLibrary
 */

.hfl-homey-installer-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 15, 20, 25, 0.6 );
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 100000;
}

.hfl-homey-installer {
	position: relative;
	background: #fff;
	color: #1a1a1a;
	border-radius: 12px;
	max-width: 560px;
	width: 100%;
	max-height: calc( 100vh - 32px );
	overflow-y: auto;
	padding: 24px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.35 );
}

.hfl-homey-installer h2 {
	margin: 0 0 4px;
	font-size: 1.25rem;
}

.hfl-homey-installer__subtitle {
	margin: 0 0 16px;
	color: #666;
	font-size: 0.9rem;
}

.hfl-homey-installer__close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: transparent;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	color: #555;
}

.hfl-homey-installer__step h3 {
	margin-top: 0;
	font-size: 1.05rem;
}

.hfl-homey-installer__hint {
	font-size: 0.85rem;
	color: #666;
}

.hfl-homey-installer__field {
	display: block;
	margin: 14px 0;
	font-weight: 600;
	font-size: 0.9rem;
}

.hfl-homey-installer__field input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 6px;
	padding: 10px 12px;
	font-size: 1rem;
	font-weight: 400;
	border: 1px solid #ccc;
	border-radius: 8px;
}

.hfl-homey-installer__error {
	background: #fdecea;
	color: #a4262c;
	border: 1px solid #f5c2c0;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 0.9rem;
	margin: 12px 0;
}

.hfl-homey-installer__connected {
	color: #1a7a2e;
	font-weight: 600;
	font-size: 0.9rem;
}

.hfl-homey-installer__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.hfl-homey-installer__button {
	appearance: none;
	border: 1px solid #ccc;
	background: #fff;
	color: #1a1a1a;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 0.95rem;
	cursor: pointer;
	min-height: 44px;
}

.hfl-homey-installer__button--primary {
	background: var( --hfl-color-accent, #e8720c );
	border-color: transparent;
	color: #fff;
	font-weight: 600;
}

.hfl-homey-installer__button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.hfl-homey-installer__mapping-row {
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 12px;
}

.hfl-homey-installer__mapping-source {
	margin-bottom: 8px;
}

.hfl-homey-installer__mapping-source strong {
	display: block;
}

.hfl-homey-installer__mapping-source small {
	color: #666;
}

.hfl-homey-installer__mapping-select {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	font-size: 1rem;
	border: 1px solid #ccc;
	border-radius: 8px;
}

.hfl-homey-installer__preview-list {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.hfl-homey-installer__preview-row {
	border-left: 4px solid #ccc;
	padding: 8px 10px;
	margin-bottom: 8px;
	border-radius: 4px;
	background: #f8f8f8;
}

.hfl-homey-installer__preview-row small {
	display: block;
	color: #666;
	margin-top: 2px;
}

.hfl-homey-installer__preview-row--ok {
	border-left-color: #1a7a2e;
}

.hfl-homey-installer__preview-row--warning {
	border-left-color: #b8860b;
}

.hfl-homey-installer__preview-row--blocked {
	border-left-color: #a4262c;
	background: #fdecea;
}

/* OAuth2 (voorkeursmethode) */

.hfl-homey-installer__oauth-primary {
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 16px;
	background: #fafafa;
}

.hfl-homey-installer__advanced {
	margin-top: 8px;
}

.hfl-homey-installer__advanced summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 0.9rem;
	color: #555;
	padding: 4px 0;
}

.hfl-homey-installer__oauth-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	background: #eef8ef;
	border: 1px solid #cfe8d1;
	border-radius: 8px;
	padding: 10px 12px;
	margin-bottom: 14px;
	font-size: 0.9rem;
	color: #1a7a2e;
}

.hfl-homey-installer__oauth-status-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.hfl-homey-installer__homey-choices {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0;
}

.hfl-homey-installer__homey-choice {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	text-align: left;
	padding: 12px 16px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	min-height: 44px;
}

.hfl-homey-installer__homey-choice:hover,
.hfl-homey-installer__homey-choice:focus-visible {
	border-color: var( --hfl-color-accent, #e8720c );
}

.hfl-homey-installer__homey-choice small {
	color: #666;
}

.hfl-homey-installer__link-button {
	appearance: none;
	background: none;
	border: none;
	padding: 0;
	color: #1a1a1a;
	text-decoration: underline;
	font-size: 0.85rem;
	cursor: pointer;
}

@media ( max-width: 480px ) {
	.hfl-homey-installer-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.hfl-homey-installer {
		max-width: none;
		width: 100%;
		border-radius: 16px 16px 0 0;
		max-height: 92vh;
	}

	.hfl-homey-installer__actions {
		flex-direction: column;
	}

	.hfl-homey-installer__button {
		width: 100%;
	}
}
