/* Last Form - minimal, theme-friendly front styles. */
.lf-form {
	--lf-gap: 1rem;
	--lf-border: #cbd5e1;
	--lf-error: #dc2626;
	--lf-success: #16a34a;
	display: flex;
	flex-direction: column;
	gap: var(--lf-gap);
}

.lf-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.lf-field__label {
	font-weight: 600;
}

.lf-required {
	color: var(--lf-error);
	text-decoration: none;
}

.lf-control,
.lf-select {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--lf-border);
	border-radius: 0.4rem;
	font: inherit;
	box-sizing: border-box;
}

.lf-control:focus,
.lf-select:focus {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
}

.lf-field--error .lf-control,
.lf-field--error .lf-select {
	border-color: var(--lf-error);
}

.lf-choices {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.lf-choice {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 400;
}

.lf-choice input {
	width: auto;
}

.lf-field__help {
	display: block;
	color: #64748b;
	font-size: 0.85em;
	margin-top: 4px;
}

.lf-field__error {
	color: var(--lf-error);
	font-size: 0.85em;
	min-height: 1em;
}

.lf-field__error:empty {
	display: none;
}

.lf-submit {
	cursor: pointer;
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: 0.4rem;
	background: #2563eb;
	color: #fff;
	font: inherit;
	font-weight: 600;
}

.lf-submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.lf-form__message {
	margin: 0;
}

.lf-form__message:empty {
	display: none;
}

.lf-form__message--success {
	color: var(--lf-success);
}

.lf-form__message--error {
	color: var(--lf-error);
}

/* Multi-step */
.lf-step[hidden] {
	display: none;
}

.lf-steps-nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 4px;
}

.lf-progress {
	color: #64748b;
	font-size: 0.9em;
	margin-left: auto;
}

/* Progress bar ([progress] tag) */
.lf-progressbar {
	margin-bottom: 20px;
}

.lf-progressbar__steps {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.lf-progressbar__dot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	flex: 1;
	text-align: center;
	color: #94a3b8;
}

.lf-progressbar__num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #e2e8f0;
	color: #64748b;
	font-size: 0.85em;
	font-weight: 600;
	transition: background 0.2s ease, color 0.2s ease;
}

.lf-progressbar__text {
	font-size: 0.8em;
	line-height: 1.2;
}

.lf-progressbar__dot.is-current .lf-progressbar__num,
.lf-progressbar__dot.is-done .lf-progressbar__num {
	background: #2563eb;
	color: #fff;
}

.lf-progressbar__dot.is-current,
.lf-progressbar__dot.is-done {
	color: #1e293b;
}

.lf-progressbar__track {
	height: 6px;
	border-radius: 999px;
	background: #e2e8f0;
	overflow: hidden;
}

.lf-progressbar__fill {
	height: 100%;
	background: #2563eb;
	border-radius: 999px;
	transition: width 0.25s ease;
}

/* File upload dropzone (drag-and-drop + previews) */
.lf-dropzone {
	border: 1.5px dashed #c3c4c7;
	border-radius: 10px;
	padding: 16px;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.lf-dropzone.is-dragover {
	border-color: #2563eb;
	background: #f0f6ff;
}

.lf-dropzone input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.lf-dropzone__prompt {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #64748b;
	font-size: 0.92em;
}

.lf-dropzone__browse {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	padding: 5px 12px;
	cursor: pointer;
	font: inherit;
	color: #1e293b;
}

.lf-dropzone__browse:hover {
	border-color: #2563eb;
	color: #2563eb;
}

.lf-dropzone__list {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lf-file {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 6px 10px;
}

.lf-file__thumb {
	width: 38px;
	height: 38px;
	border-radius: 6px;
	object-fit: cover;
	flex: 0 0 38px;
	background: #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
}

.lf-file__thumb--doc {
	font-size: 22px;
}

.lf-file__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.9em;
}

.lf-file__size {
	color: #94a3b8;
	font-size: 0.82em;
	white-space: nowrap;
}

.lf-file__remove {
	background: none;
	border: 0;
	color: #b32d2e;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

/* Column layout (width: attribute / visual builder) */
.lf-form--grid,
.lf-form--grid .lf-step {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-start;
}

/* In grid mode, anything that is not a fractional column spans the full row
   (free text, 100% fields, submit, message area, steps nav). */
.lf-form--grid > *,
.lf-form--grid .lf-step > * {
	flex: 1 1 100%;
	min-width: 0;
}

.lf-form--grid .lf-col {
	margin: 0;
}

.lf-form--grid .lf-col--100 { flex: 1 1 100%; }
.lf-form--grid .lf-col--50  { flex: 1 1 calc(50% - 8px); }
.lf-form--grid .lf-col--33  { flex: 1 1 calc(33.333% - 11px); }
.lf-form--grid .lf-col--25  { flex: 1 1 calc(25% - 12px); }

.lf-field__label {
	display: block;
	font-weight: 600;
	font-size: 0.9em;
	margin-bottom: 4px;
}

.lf-field__req {
	color: var(--lf-error, #b32d2e);
}

/* On small screens every column becomes full width. */
@media (max-width: 600px) {
	.lf-form--grid .lf-col--50,
	.lf-form--grid .lf-col--33,
	.lf-form--grid .lf-col--25 {
		flex: 1 1 100%;
	}
}

/* ── List field (repeatable rows) ───────────────────────────────────────── */
.lf-list {
	display: block;
}

.lf-list__table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 8px;
}

.lf-list__table th {
	text-align: left;
	font-size: 0.85em;
	font-weight: 600;
	padding: 0 8px 4px 0;
}

.lf-list__table td {
	padding: 0 8px 6px 0;
	vertical-align: top;
}

.lf-list__table td:last-child,
.lf-list__table th:last-child {
	padding-right: 0;
	width: 1%;
	white-space: nowrap;
}

.lf-list__input {
	width: 100%;
}

.lf-list__remove {
	border: 1px solid var(--lf-border);
	background: #fff;
	border-radius: 0.4rem;
	width: 2.1rem;
	height: 2.1rem;
	line-height: 1;
	font-size: 1.1rem;
	cursor: pointer;
	color: var(--lf-error, #b32d2e);
}

.lf-list__remove:hover {
	background: #fef2f2;
}

.lf-list__add {
	border: 1px solid var(--lf-border);
	background: #fff;
	border-radius: 0.4rem;
	padding: 0.45rem 0.8rem;
	font: inherit;
	cursor: pointer;
}

.lf-list__add:hover {
	background: #f6f7f9;
}

.lf-list__add[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Stack columns on small screens. */
@media (max-width: 600px) {
	.lf-list__table,
	.lf-list__table thead,
	.lf-list__table tbody,
	.lf-list__table tr,
	.lf-list__table td {
		display: block;
		width: 100%;
	}
	.lf-list__table thead {
		display: none;
	}
	.lf-list__table td {
		padding: 0 0 6px 0;
	}
}
