/**
 * LegalForge app styles.
 *
 * Visual direction: a macOS-style workspace. Translucent toolbar, soft white
 * cards on Apple grey, segmented controls instead of tab bars, one blue accent,
 * Poppins throughout. Depth comes from layered light shadows, never borders
 * alone, and nothing shouts except the coverage dial.
 */

.lf-shell,
.lf-auth {
	--lf-font: "Poppins", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	--lf-ink: #1d1d1f;
	--lf-ink-soft: #6e6e73;
	--lf-ink-faint: #8e8e93;

	--lf-canvas: #f5f5f7;
	--lf-surface: #ffffff;
	--lf-fill: rgba(120, 120, 128, 0.12);
	--lf-fill-strong: rgba(120, 120, 128, 0.2);
	--lf-hairline: rgba(0, 0, 0, 0.08);

	--lf-accent: #0071e3;
	--lf-accent-hover: #0077ed;
	--lf-accent-soft: rgba(0, 113, 227, 0.1);
	--lf-accent-ring: rgba(0, 113, 227, 0.28);

	--lf-green: #248a3d;
	--lf-green-soft: rgba(36, 138, 61, 0.12);
	--lf-amber: #9a6a00;
	--lf-amber-soft: rgba(154, 106, 0, 0.12);
	--lf-red: #c1281f;
	--lf-red-soft: rgba(193, 40, 31, 0.1);

	--lf-radius: 18px;
	--lf-radius-sm: 12px;
	--lf-shadow: 0 1px 1px rgba(0, 0, 0, 0.03), 0 8px 28px rgba(0, 0, 0, 0.06);
	--lf-shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.08), 0 12px 36px rgba(0, 0, 0, 0.12);

	font-family: var(--lf-font);
	font-size: 15px;
	line-height: 1.55;
	color: var(--lf-ink);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.lf-shell {
	background: var(--lf-canvas);
	min-height: 100vh;
}

.lf-shell *,
.lf-auth * {
	box-sizing: border-box;
}

.is-hidden {
	display: none !important;
}

/* -------------------------------------------------------------- toolbar */

.lf-topbar {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 12px 22px;
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	border-bottom: 1px solid var(--lf-hairline);
	flex-wrap: wrap;
}

.lf-topbar__brand {
	font-weight: 600;
	font-size: 16px;
	letter-spacing: -0.02em;
}

/* Segmented control, the way macOS does navigation. */
.lf-topbar__nav {
	display: flex;
	gap: 2px;
	padding: 3px;
	border-radius: 11px;
	background: var(--lf-fill);
	flex: 0 1 auto;
}

.lf-topbar__nav a {
	padding: 5px 14px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--lf-ink-soft);
	font-size: 13.5px;
	font-weight: 500;
	transition: background 0.18s ease, color 0.18s ease;
}

.lf-topbar__nav a:hover {
	color: var(--lf-ink);
}

.lf-topbar__nav a.is-active {
	background: var(--lf-surface);
	color: var(--lf-ink);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.lf-topbar__account {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-left: auto;
	font-size: 13.5px;
	color: var(--lf-ink-soft);
}

.lf-main {
	max-width: 1100px;
	margin: 0 auto;
	padding: 34px 22px 80px;
}

.lf-footer {
	padding: 20px 22px 48px;
	font-size: 12.5px;
	color: var(--lf-ink-faint);
	text-align: center;
	max-width: 760px;
	margin: 0 auto;
}

.lf-loading {
	padding: 70px 0;
	text-align: center;
	color: var(--lf-ink-soft);
}

/* ----------------------------------------------------------------- type */

.lf-h1 {
	font-size: 30px;
	font-weight: 600;
	letter-spacing: -0.025em;
	margin: 0 0 6px;
}

.lf-h2 {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.015em;
	margin: 0 0 14px;
}

.lf-sub {
	color: var(--lf-ink-soft);
	margin: 0 0 26px;
	max-width: 62ch;
}

.lf-muted {
	color: var(--lf-ink-soft);
	font-size: 13.5px;
}

/* --------------------------------------------------------------- panels */

.lf-panel {
	background: var(--lf-surface);
	border-radius: var(--lf-radius);
	box-shadow: var(--lf-shadow);
	padding: 24px;
	margin-bottom: 20px;
}

.lf-panel__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.lf-grid {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.lf-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.lf-split {
	display: grid;
	gap: 20px;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	align-items: start;
}

@media (max-width: 900px) {
	.lf-split {
		grid-template-columns: 1fr;
	}

	.lf-h1 {
		font-size: 25px;
	}
}

/* ----------------------------------------------------------------- dial */

.lf-seal {
	display: flex;
	align-items: center;
	gap: 20px;
}

.lf-seal__dial {
	--value: 0;
	width: 124px;
	height: 124px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: conic-gradient(from 180deg, var(--lf-accent) calc(var(--value) * 1%), var(--lf-fill) 0);
	flex: 0 0 auto;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.lf-seal__inner {
	width: 98px;
	height: 98px;
	border-radius: 50%;
	background: var(--lf-surface);
	display: grid;
	place-items: center;
	text-align: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.lf-seal__value {
	font-size: 34px;
	font-weight: 600;
	letter-spacing: -0.04em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.lf-seal__unit {
	font-size: 11px;
	font-weight: 500;
	color: var(--lf-ink-faint);
	letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- lists */

.lf-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lf-list > li {
	padding: 13px 0;
	border-bottom: 1px solid var(--lf-hairline);
	display: flex;
	justify-content: space-between;
	gap: 14px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.lf-list > li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.lf-list > li:first-child {
	padding-top: 0;
}

.lf-item__title {
	font-weight: 550;
	color: var(--lf-ink);
	text-decoration: none;
}

a.lf-item__title:hover {
	color: var(--lf-accent);
}

.lf-finding {
	padding: 12px 14px;
	border-radius: var(--lf-radius-sm);
	margin-bottom: 10px;
	font-size: 14px;
	background: var(--lf-fill);
}

.lf-finding--action {
	background: var(--lf-red-soft);
	color: #8d1d16;
}

.lf-finding--warning {
	background: var(--lf-amber-soft);
	color: #7a5400;
}

.lf-finding--info {
	background: var(--lf-accent-soft);
	color: #00509f;
}

/* ----------------------------------------------------------------- tags */

.lf-tag {
	display: inline-block;
	font-size: 11.5px;
	font-weight: 500;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--lf-fill);
	color: var(--lf-ink-soft);
}

.lf-tag--pro {
	background: var(--lf-amber-soft);
	color: var(--lf-amber);
}

.lf-tag--done {
	background: var(--lf-green-soft);
	color: var(--lf-green);
}

/* --------------------------------------------------------------- fields */

.lf-field {
	display: block;
	margin-bottom: 18px;
}

.lf-field--question {
	padding: 16px 18px;
	border-radius: var(--lf-radius-sm);
	background: rgba(120, 120, 128, 0.05);
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.lf-field--question + .lf-field--question {
	margin-top: 12px;
}

.lf-field__label {
	display: block;
	font-size: 14px;
	font-weight: 550;
	margin-bottom: 6px;
}

.lf-field__hint {
	display: block;
	font-size: 12.5px;
	color: var(--lf-ink-faint);
	margin-bottom: 8px;
}

.lf-required {
	color: var(--lf-accent);
	margin-left: 3px;
}

.lf-field__error {
	display: none;
	font-size: 12.5px;
	color: var(--lf-red);
	margin-top: 8px;
}

.lf-field.is-invalid {
	background: var(--lf-red-soft);
	box-shadow: inset 0 0 0 1px rgba(193, 40, 31, 0.35);
}

.lf-field.is-invalid .lf-field__error {
	display: block;
}

.lf-input,
.lf-select,
.lf-textarea {
	width: 100%;
	padding: 10px 13px;
	border: 1px solid var(--lf-hairline);
	border-radius: var(--lf-radius-sm);
	background: var(--lf-surface);
	font: inherit;
	font-size: 14.5px;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lf-select {
	appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236e6e73' d='M1.2 1.4 6 6.2l4.8-4.8'/></svg>");
	background-repeat: no-repeat;
	background-position: right 13px center;
	padding-right: 34px;
}

.lf-textarea {
	min-height: 96px;
	resize: vertical;
}

.lf-input:focus,
.lf-select:focus,
.lf-textarea:focus {
	outline: none;
	border-color: var(--lf-accent);
	box-shadow: 0 0 0 4px var(--lf-accent-ring);
}

.lf-checks {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.lf-check,
.lf-choice {
	display: flex;
	gap: 9px;
	align-items: center;
	font-size: 14px;
	padding: 9px 12px;
	border: 1px solid var(--lf-hairline);
	border-radius: var(--lf-radius-sm);
	background: var(--lf-surface);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.lf-check:hover,
.lf-choice:hover {
	border-color: rgba(0, 0, 0, 0.18);
}

.lf-check:active,
.lf-choice:active {
	transform: scale(0.985);
}

.lf-check input,
.lf-choice input {
	accent-color: var(--lf-accent);
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.lf-check.is-on,
.lf-choice.is-on {
	border-color: var(--lf-accent);
	background: var(--lf-accent-soft);
	color: #00509f;
	font-weight: 500;
}

.lf-choices {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.lf-choices .lf-choice {
	min-width: 92px;
	justify-content: flex-start;
}

/* -------------------------------------------------------------- buttons */

.lf-btn {
	appearance: none;
	border: 1px solid var(--lf-hairline);
	background: var(--lf-surface);
	color: var(--lf-ink);
	padding: 9px 18px;
	border-radius: var(--lf-radius-sm);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lf-btn:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lf-btn:active {
	transform: scale(0.98);
}

.lf-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--lf-accent-ring);
}

.lf-btn--primary {
	background: var(--lf-accent);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 1px 2px rgba(0, 113, 227, 0.35), 0 6px 16px rgba(0, 113, 227, 0.22);
}

.lf-btn--primary:hover {
	background: var(--lf-accent-hover);
}

.lf-btn--ghost {
	border-color: transparent;
	background: transparent;
	box-shadow: none;
	padding-inline: 8px;
}

.lf-btn--danger {
	color: var(--lf-red);
}

.lf-btn--block {
	width: 100%;
	justify-content: center;
}

.lf-btn--small {
	padding: 6px 12px;
	font-size: 13px;
	border-radius: 10px;
}

.lf-btn[disabled] {
	opacity: 0.5;
	cursor: default;
	box-shadow: none;
}

.lf-link {
	background: none;
	border: 0;
	padding: 0;
	color: var(--lf-accent);
	font: inherit;
	font-size: inherit;
	cursor: pointer;
	text-decoration: none;
	text-align: left;
}

.lf-link:hover {
	text-decoration: underline;
}

/* ----------------------------------------------------------------- tabs */

.lf-tabs {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: 12px;
	background: var(--lf-fill);
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.lf-tabs button {
	appearance: none;
	background: none;
	border: 0;
	border-radius: 9px;
	padding: 7px 16px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--lf-ink-soft);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}

.lf-tabs button:hover {
	color: var(--lf-ink);
}

.lf-tabs button.is-active {
	background: var(--lf-surface);
	color: var(--lf-ink);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------- questionnaire */

.lf-form {
	padding-bottom: 10px;
}

.lf-stickybar {
	position: sticky;
	bottom: 16px;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 16px;
	margin-top: 8px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	box-shadow: var(--lf-shadow-pop);
}

.lf-stickybar__progress {
	flex: 1 1 auto;
	min-width: 120px;
}

.lf-stickybar__count {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.lf-progress {
	height: 6px;
	border-radius: 999px;
	background: var(--lf-fill);
	overflow: hidden;
}

.lf-progress span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--lf-accent);
	transition: width 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lf-notice__list {
	margin: 8px 0 0;
	padding-left: 18px;
}

.lf-notice__list li {
	margin-bottom: 4px;
}

/* --------------------------------------------------------------- editor */

.lf-section {
	border-radius: var(--lf-radius);
	background: var(--lf-surface);
	box-shadow: var(--lf-shadow);
	margin-bottom: 16px;
	overflow: hidden;
}

.lf-section__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--lf-hairline);
	background: rgba(120, 120, 128, 0.04);
	flex-wrap: wrap;
}

.lf-section__body {
	padding: 8px 20px 20px;
}

.lf-editable {
	min-height: 84px;
	padding: 12px;
	border: 1px solid transparent;
	border-radius: var(--lf-radius-sm);
	font-size: 15px;
	line-height: 1.62;
}

.lf-editable:focus {
	outline: none;
	border-color: var(--lf-accent);
	box-shadow: 0 0 0 4px var(--lf-accent-ring);
}

.lf-editable p:first-child {
	margin-top: 0;
}

/* -------------------------------------------------------- notifications */

.lf-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	display: grid;
	gap: 10px;
}

.lf-toast__item {
	background: rgba(29, 29, 31, 0.9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: #fff;
	padding: 12px 16px;
	border-radius: 14px;
	font-size: 14px;
	max-width: 340px;
	box-shadow: var(--lf-shadow-pop);
	animation: lf-rise 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lf-toast__item--error {
	background: rgba(193, 40, 31, 0.94);
}

@keyframes lf-rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

.lf-notice {
	padding: 13px 16px;
	border-radius: var(--lf-radius-sm);
	margin-bottom: 18px;
	font-size: 14px;
}

.lf-notice--error {
	background: var(--lf-red-soft);
	color: #8d1d16;
}

.lf-notice--success {
	background: var(--lf-green-soft);
	color: var(--lf-green);
}

.lf-empty {
	padding: 34px 20px;
	text-align: center;
	color: var(--lf-ink-faint);
	border-radius: var(--lf-radius-sm);
	background: rgba(120, 120, 128, 0.06);
}

/* ------------------------------------------------------------------ auth */

.lf-auth {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
	gap: 40px;
	max-width: 980px;
	margin: 56px auto;
	padding: 0 22px;
	align-items: center;
}

@media (max-width: 820px) {
	.lf-auth {
		grid-template-columns: 1fr;
		margin: 28px auto;
	}
}

.lf-auth__panel {
	background: var(--lf-surface);
	border-radius: 22px;
	padding: 32px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 18px 50px rgba(0, 0, 0, 0.1);
}

.lf-auth__brand {
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.03em;
}

.lf-auth__tagline {
	color: var(--lf-ink-soft);
	margin: 8px 0 24px;
	font-size: 14.5px;
}

.lf-auth__tabs {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: 12px;
	background: var(--lf-fill);
	margin-bottom: 22px;
}

.lf-auth__tab {
	appearance: none;
	border: 0;
	background: none;
	padding: 7px 16px;
	border-radius: 9px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	color: var(--lf-ink-soft);
}

.lf-auth__tab.is-active {
	background: var(--lf-surface);
	color: var(--lf-ink);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.lf-auth__form.is-hidden {
	display: none;
}

.lf-auth__reset {
	margin-top: 16px;
	font-size: 13px;
}

.lf-auth__aside h2 {
	font-size: 17px;
	font-weight: 600;
	margin: 0 0 12px;
}

.lf-steps {
	padding-left: 20px;
	color: var(--lf-ink-soft);
	font-size: 14.5px;
}

.lf-steps li {
	margin-bottom: 10px;
}

.lf-auth__fineprint {
	font-size: 12.5px;
	color: var(--lf-ink-faint);
	border-top: 1px solid var(--lf-hairline);
	padding-top: 14px;
	margin-top: 20px;
}

/* Themes often constrain page width; the app manages its own layout. */
.legalforge-app-page .entry-content,
.legalforge-app-page .site-content {
	max-width: none;
}

@media (prefers-reduced-motion: reduce) {
	.lf-shell *,
	.lf-auth * {
		transition: none !important;
		animation: none !important;
	}
}

/* Brand lockup */

.lf-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.lf-brand__logo {
	display: block;
	height: 30px;
	width: auto;
	max-width: 190px;
	object-fit: contain;
}

.lf-brand--large .lf-brand__logo {
	height: 54px;
	max-width: 260px;
}

.lf-brand__name {
	font-weight: 600;
	letter-spacing: -0.02em;
}

.lf-auth--single {
	grid-template-columns: minmax(0, 520px);
	justify-content: center;
}

.lf-auth__switch {
	margin: 16px 0 0;
	font-size: 13.5px;
}
