/* ============ ESP32 Flasher — built on the main site theme ============ */

.fl-wrap {
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 90px 20px 60px;
}

.back-link {
	position: fixed;
	top: 24px;
	left: 24px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--text-dim);
	text-decoration: none;
	transition: color 0.25s ease, transform 0.25s ease;
	z-index: 50;
}

.back-link:hover { color: var(--accent); transform: translateX(-3px); }

.fl-card {
	width: min(600px, 100%);
	padding: 30px 30px 26px;
	box-shadow: 0 0 90px -24px var(--glow);
}

/* ---- Kopf ---- */
.fl-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }

.fl-icon {
	width: 58px; height: 58px;
	flex-shrink: 0;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(6, 182, 212, 0.12));
	border: 1px solid var(--border);
	color: var(--accent);
}

.fl-icon svg { width: 27px; height: 27px; }

.fl-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.fl-sub { margin-top: 4px; font-size: 12.5px; color: var(--text-dim); }

.fl-unsupported {
	margin-bottom: 20px;
	padding: 12px 14px;
	font-size: 13.5px;
	line-height: 1.6;
	color: #fecaca;
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.35);
	border-radius: 11px;
}

/* ---- Schritte ---- */
.fl-step { margin-bottom: 20px; }

.fl-step-label {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 9px;
	font-size: 13px;
	font-weight: 600;
}

.fl-num {
	width: 21px; height: 21px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	color: var(--accent);
	border: 1px solid rgba(139, 92, 246, 0.45);
	border-radius: 50%;
}

.fl-hint { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.55; color: var(--text-dim); }

/* Chip-Auswahl */
.fl-chips {
	display: flex;
	gap: 6px;
	padding: 5px;
	border-radius: 13px;
	background: var(--surface);
	border: 1px solid var(--border);
}

.fl-chip {
	flex: 1;
	padding: 9px 10px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-dim);
	background: transparent;
	border: 0;
	border-radius: 9px;
}

.fl-chip.active {
	color: #fff;
	background: linear-gradient(135deg, rgba(139, 92, 246, 0.32), rgba(6, 182, 212, 0.2));
	box-shadow: 0 6px 18px -8px var(--glow);
}

.fl-chip:disabled { opacity: 0.5; cursor: not-allowed; }
.fl-soon { margin-left: 3px; font-size: 10px; font-weight: 400; }

/* Firmware-Karten */
.fl-fw-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.fl-fw { position: relative; display: block; cursor: pointer; }
.fl-fw input { position: absolute; opacity: 0; pointer-events: none; }

.fl-fw-box {
	display: block;
	height: 100%;
	padding: 13px 14px;
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--border);
	border-radius: 12px;
	transition: border-color 0.25s ease, background 0.25s ease;
}

.fl-fw:hover .fl-fw-box { border-color: rgba(139, 92, 246, 0.4); }

.fl-fw input:checked + .fl-fw-box {
	background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(6, 182, 212, 0.08));
	border-color: rgba(139, 92, 246, 0.7);
}

.fl-fw input:focus-visible + .fl-fw-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.fl-fw input:disabled + .fl-fw-box { cursor: not-allowed; opacity: 0.7; }

.fl-fw-name { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 700; }
.fl-fw-desc { display: block; font-size: 12px; line-height: 1.55; color: var(--text-dim); }

/* Version */
.fl-select {
	width: 100%;
	padding: 11px 14px;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 14px;
	color: var(--text);
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid var(--border);
	border-radius: 11px;
}

.fl-select:focus { outline: none; border-color: rgba(139, 92, 246, 0.55); }
.fl-select option { color: #000; }

/* Anschluss */
.fl-wiring {
	margin-bottom: 18px;
	padding: 13px 15px;
	font-size: 12.5px;
	line-height: 1.6;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px dashed rgba(139, 92, 246, 0.35);
	border-radius: 12px;
}

.fl-wiring strong { color: var(--text); }

.fl-wiring table { width: 100%; margin: 8px 0; border-collapse: collapse; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.fl-wiring th { text-align: left; font-weight: 600; color: var(--text); }
.fl-wiring th, .fl-wiring td { padding: 4px 8px; border-bottom: 1px solid var(--border); }

/* Option */
.fl-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.fl-check input { flex: none; margin: 3px 0 0; accent-color: var(--accent); }
.fl-check .fl-hint { margin-top: 3px; font-weight: 400; }

/* ---- Knopf ---- */
.fl-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 13px;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(6, 182, 212, 0.85));
	border: none;
	border-radius: 12px;
	transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.fl-btn svg { width: 17px; height: 17px; }
.fl-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 32px -12px var(--glow); }
.fl-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- Fortschritt ---- */
.fl-status { margin-top: 18px; }

.fl-progress {
	height: 10px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--border);
	border-radius: 99px;
}

.fl-progress-fill {
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	border-radius: inherit;
	transition: width 0.2s ease;
}

.fl-status-text { margin-top: 9px; font-size: 13px; line-height: 1.55; color: var(--text); }
.fl-status.is-error .fl-status-text { color: #f87171; }
.fl-status.is-done .fl-status-text { color: #4ade80; }
.fl-status.is-done .fl-progress-fill { background: #22c55e; }
.fl-status.is-error .fl-progress-fill { background: #ef4444; }

/* ---- Aufklappbares ---- */
.fl-more { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.fl-more summary { font-size: 13px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.fl-more summary:hover { color: var(--text); }
.fl-more[open] summary { margin-bottom: 10px; color: var(--text); }

.fl-log {
	max-height: 220px;
	overflow: auto;
	padding: 10px 12px;
	font-size: 11.5px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
	color: var(--text-dim);
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--border);
	border-radius: 9px;
}

.fl-log:empty::before { content: "Noch nichts passiert."; }

.fl-help { padding-left: 18px; font-size: 12.5px; line-height: 1.65; color: var(--text-dim); }
.fl-help li + li { margin-top: 6px; }
.fl-help strong { color: var(--text); }

.fl-files { display: flex; flex-direction: column; gap: 8px; }

.fl-file {
	padding: 9px 11px;
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--border);
	border-radius: 9px;
}

.fl-file-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.fl-file-head a { color: var(--accent); font-weight: 600; text-decoration: none; }
.fl-file-head a:hover { text-decoration: underline; }
.fl-file-head .mono { font-size: 11.5px; white-space: nowrap; }
.fl-sum { display: block; margin-top: 4px; font-size: 10.5px; color: var(--text-dim); word-break: break-all; }

.fl-cmd {
	margin-top: 6px;
	padding: 10px 12px;
	font-size: 11.5px;
	white-space: pre-wrap;
	word-break: break-all;
	color: var(--text);
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--border);
	border-radius: 9px;
}

.fl-legal { margin-top: 18px; font-size: 11px; line-height: 1.6; }
.fl-legal a { color: inherit; }

@media (max-width: 520px) {
	.fl-card { padding: 24px 18px 22px; }
	.fl-fw-list { grid-template-columns: 1fr; }
	.fl-chip { font-size: 12px; padding: 9px 6px; }
}
