/*
 * Phase 03.2 AI-Foto-Konfigurator / Vorher-Nachher-Visualizer widget styles.
 *
 * Token deviation from 03.2-UI-SPEC.md (recorded in 03.2-01-PLAN.md's
 * <design_token_resolution>): the UI-SPEC's Color table inherits Phase 1's original
 * "quiet luxury" palette (a retired earthy-brown accent tone), which was superseded on
 * 2026-07-29 by the navy+red revision recorded in PROJECT.md Key Decisions. This file
 * consumes the LIVE `--pcg-*` custom properties by name instead - the same tokens
 * `price-calculator.css` already defines on `:root` and enqueues site-wide - because
 * `.planning/CONVENTIONS.md` states plainly that red is the only accent colour; the
 * retired earthy-brown tone must not reappear anywhere. No hex literal is written below,
 * and no `:root` block is declared here - price-calculator.css already owns that
 * definition (its `--pcg-color-ink` currently resolves to navy 142440); redeclaring it
 * here would create a second source of truth for the same palette.
 *
 * Retuned again for quick task 260809-wfx (Cowork's AUFTRAG_Claude_Code_Finale_Politur.md,
 * Teil B) to the LIVE PCG design system - white .pcg-box cards, .pcg-btn-red /
 * .pcg-btn-ghost-dark button geometry, CF7 input pattern. Still consumes the same
 * price-calculator.css :root tokens by name; only price-calculator.css's :root values
 * changed underneath this file.
 */

.pcg-ai-visualizer {
	background: transparent;
	color: var(--pcg-color-ink);
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--pcg-space-md);
	padding-right: var(--pcg-space-md);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--pcg-space-xl);
}

/* Second UI-SPEC token deviation, same file, same reasoning as the palette note above:
 * the spec's Heading role calls for Fraunces, but Fraunces is not loaded anywhere on this
 * site (no @font-face, no enqueue) - price-calculator.css's own .pcg-calc__title already
 * ships Inter in production instead. Matching that live precedent rather than a font this
 * site has never actually served. */
.pcg-aiviz__header {
	display: flex;
	flex-direction: column;
	gap: var(--pcg-space-xs);
}

.pcg-aiviz__title {
	font-family: 'Inter', sans-serif;
	font-weight: 800;
	font-size: 36px;
	line-height: 1.15;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__intro {
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 20px;
	line-height: 1.55;
	color: var(--pcg-color-lead);
}

.pcg-aiviz__step {
	background-color: var(--pcg-color-bg);
	border: 1px solid var(--pcg-color-hairline);
	border-radius: var(--pcg-radius-card);
	box-shadow: var(--pcg-shadow-card);
	padding: 32px 34px;
	display: flex;
	flex-direction: column;
	gap: var(--pcg-space-sm);
}

.pcg-aiviz__step-heading {
	font-family: 'Inter', sans-serif;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.3;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__hint {
	font-family: 'Inter', sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--pcg-color-body);
}

/* Guidance paragraph shown in a not-yet-computable step (e.g. material/finish before a
 * trade is chosen, 260809-wfx Task 3) - visually distinct from .pcg-aiviz__hint so it
 * reads as "waiting on you", not as a passive footnote. */
.pcg-aiviz__prompt {
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 17px;
	line-height: 1.55;
	color: var(--pcg-color-body);
}

/* Chip rows - flex-wrap, never horizontal scroll; long labels wrap inside a chip rather
 * than truncate (same rule 03.1's price calculator already established). */
.pcg-aiviz__chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--pcg-space-sm);
}

.pcg-aiviz__chip {
	background-color: var(--pcg-color-bg);
	color: var(--pcg-color-ink);
	border: 1px solid var(--pcg-color-field-border);
	border-radius: var(--pcg-radius-control);
	padding: var(--pcg-space-xs) var(--pcg-space-sm);
	font-family: 'Inter', sans-serif;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	white-space: normal;
	min-height: var(--pcg-touch-min);
	min-width: var(--pcg-touch-min);
}

.pcg-aiviz__chip--selected {
	border-color: var(--pcg-color-accent);
	color: var(--pcg-color-accent);
}

.pcg-aiviz__chip:hover {
	border-color: var(--pcg-color-accent-hover);
}

.pcg-aiviz__chip:active {
	border-color: var(--pcg-color-accent-active);
}

/* Innenausbau's conditional-disabled state (D-14/D-15) - visible, honest about its
 * presence, but not interactive: 50% opacity + not-allowed cursor per this plan's
 * <acceptance_criteria>, no hover/selected state. */
.pcg-aiviz__chip--disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pcg-aiviz__chip-wrap {
	display: inline-flex;
	align-items: center;
	gap: var(--pcg-space-xs);
}

.pcg-aiviz__badge {
	font-size: 12px;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__dropzone {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background-color: var(--pcg-color-card);
	border: 1px dashed var(--pcg-color-field-border);
	border-radius: var(--pcg-radius-control);
	padding: var(--pcg-space-lg);
	min-height: var(--pcg-touch-min);
	cursor: pointer;
	font-size: 14px;
}

.pcg-aiviz__dropzone:hover,
.pcg-aiviz__dropzone:focus-within,
.pcg-aiviz__dropzone--dragover {
	border-color: var(--pcg-color-accent);
}

/* Client bugfix (2026-08-10): the native <input type="file"> renders with its own browser
 * default border/background - a second, competing rectangle that visually floats instead of
 * sitting inside the dashed dropzone. Stripping the input's own chrome and letting it shrink
 * to its content (rather than stretching flex-wide) keeps only the ONE visible box - the
 * dropzone itself - and lets the native "Datei auswählen" button + filename text sit flush
 * within it, centred with the rest of the dropzone content. */
.pcg-aiviz__dropzone input[type="file"] {
	border: none;
	background: transparent;
	flex: 0 1 auto;
	max-width: 100%;
}

/* Inline pending state between file selection and the accepted-file row appearing
 * (planner assumption 3 - an 8MB photo on mobile data is not instant). */
.pcg-aiviz__dropzone--pending {
	cursor: default;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__file-row {
	display: flex;
	align-items: center;
	gap: var(--pcg-space-sm);
	min-width: 0;
}

.pcg-aiviz__thumb {
	width: var(--pcg-touch-min);
	height: var(--pcg-touch-min);
	max-width: 100%;
	object-fit: cover;
	border-radius: var(--pcg-radius-control);
	flex-shrink: 0;
}

.pcg-aiviz__filename {
	font-size: 14px;
	color: var(--pcg-color-ink);
	overflow-wrap: anywhere;
}

.pcg-aiviz__remove {
	background: transparent;
	border: 1px solid var(--pcg-color-field-border);
	border-radius: 50%;
	min-height: var(--pcg-touch-min);
	min-width: var(--pcg-touch-min);
	cursor: pointer;
}

.pcg-aiviz__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--pcg-touch-min);
	min-width: var(--pcg-touch-min);
	padding: 14px 30px;
	border-radius: var(--pcg-radius-control);
	font-family: 'Inter', sans-serif;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
	border: none;
	text-decoration: none;
}

.pcg-aiviz__cta--primary {
	background-color: var(--pcg-color-accent);
	color: var(--pcg-color-bg);
	transition: filter 150ms ease;
}

.pcg-aiviz__cta--primary:hover {
	filter: brightness(0.92);
}

.pcg-aiviz__cta--primary:active {
	background-color: var(--pcg-color-accent-active);
}

.pcg-aiviz__cta--primary:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.pcg-aiviz__cta--secondary {
	background-color: transparent;
	color: var(--pcg-color-ink);
	border: 1px solid rgba(20, 36, 64, 0.35);
}

.pcg-aiviz__cta--secondary:hover {
	border-color: var(--pcg-color-ink);
	background-color: rgba(20, 36, 64, 0.05);
}

.pcg-aiviz__loading-message {
	font-size: 16px;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__loading-photo-wrap,
.pcg-aiviz__gate-frame {
	position: relative;
}

.pcg-aiviz__loading-photo {
	width: 100%;
	max-width: 100%;
	display: block;
	filter: blur(14px);
}

/* Slow opacity/background-position shimmer loop over the visitor's own blurred photo -
 * reassurance the tool is working, not frozen (UI-SPEC Step 6). Disabled under
 * prefers-reduced-motion below, keeping the static blur. */
.pcg-aiviz__shimmer {
	position: absolute;
	inset: 0;
	background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
	background-size: 200% 100%;
	animation: pcg-aiviz-shimmer 1.6s ease-in-out infinite;
}

@keyframes pcg-aiviz-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcg-aiviz__shimmer {
		animation: none;
	}
}

.pcg-aiviz__icon {
	display: inline-block;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__icon--destructive {
	color: var(--pcg-color-destructive);
}

.pcg-aiviz__scrim {
	position: absolute;
	inset: 0;
	background-color: var(--pcg-color-ink);
	opacity: 0.35;
}

.pcg-aiviz__preview--blurred {
	filter: blur(14px);
	width: 100%;
	max-width: 100%;
	display: block;
}

.pcg-aiviz__gate-heading {
	font-size: 14px;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__email-input {
	min-height: var(--pcg-touch-min);
	padding: 12px 14px;
	border: 1px solid var(--pcg-color-field-border);
	border-radius: var(--pcg-radius-control);
	color: var(--pcg-color-ink);
	background-color: var(--pcg-color-bg);
}

.pcg-aiviz__email-input:focus {
	outline: 2px solid var(--pcg-color-accent);
	border-color: var(--pcg-color-ink);
}

.pcg-aiviz__consent {
	display: flex;
	align-items: flex-start;
	gap: var(--pcg-space-xs);
	font-size: 14px;
}

.pcg-aiviz__result {
	width: 100%;
	max-width: 100%;
	display: block;
}

.pcg-aiviz__disclaimer {
	font-size: 14px;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__rate-limit-message {
	font-size: 16px;
	color: var(--pcg-color-ink);
}

.pcg-aiviz__error {
	font-size: 14px;
	color: var(--pcg-color-destructive);
}

/* ---------------------------------------------------------------------------
 * Mobile - mirrors the global .pcg-wrap/.pcg-box/.pcg-h2 breakpoints
 * (design-exports/PCG_GlobalCSS_bereinigt.css) so the widget shrinks in
 * lockstep with the rest of the site (260809-wfx).
 * ------------------------------------------------------------------------- */

@media (max-width: 820px) {
	.pcg-ai-visualizer {
		padding-left: 20px;
		padding-right: 20px;
	}

	.pcg-aiviz__step {
		padding: 26px 22px;
	}

	.pcg-aiviz__title {
		font-size: 28px;
	}
}

@media (max-width: 520px) {
	.pcg-aiviz__title {
		font-size: 24px;
	}
}
