/**
 * Editor styles for the SubtleForms block.
 *
 * The frontend form stylesheet is loaded into the editor canvas (see
 * SubtleFormsBlock::enqueue_canvas_styles), so the preview gets the real form
 * styling. This file only adds the minimal editor-only chrome around the
 * preview, a selection outline and a small "Preview" label, without
 * overriding any form colours, so the block canvas matches the frontend.
 */

/* The frame around the preview: the form itself is drawn by the front-end
   renderer with the front-end stylesheet, so nothing here sets colours. */
.subtleforms-block-preview-frame {
	position: relative;
}

/* The form cannot be used in the editor. */
.subtleforms-block-preview {
	position: relative;
	min-height: 120px;
	pointer-events: none;
	user-select: none;
}

/* Small "Preview" label, above the form and outside its flow. */
.subtleforms-block-preview__label {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 1;
	padding: 2px 8px;
	background: #f0f6fc;
	border: 1px solid #c4e0ec;
	border-radius: 0 0 0 4px;
	color: #1d2327;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 11px;
	line-height: 1.5;
	pointer-events: none;
}

/* Loading state inside the block canvas. */
.subtleforms-block__loading {
	padding: 40px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	justify-content: center;
	min-height: 160px;
}

/* When the block is selected, show a soft outline so the editor frame is
   visible without recolouring the form. */
.wp-block.is-selected .subtleforms-block-preview-frame,
.wp-block.is-highlighted .subtleforms-block-preview-frame {
	outline: 2px dashed #2271b1;
	outline-offset: 6px;
	border-radius: 4px;
}
