/**
 * BreedFix Tools — frontend styles.
 *
 * Mobile-first, scoped under .bf-tools (+ .bf-tools-landing for the grid).
 * No external fonts, no external assets. Vanilla CSS.
 */

/* ------------------------------------------------------------------ */
/* Base                                                               */
/* ------------------------------------------------------------------ */

.bf-tools {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 0.25rem;
	color: #111827;
	font-size: 1rem;
	line-height: 1.6;
}

.bf-tools *,
.bf-tools *::before,
.bf-tools *::after {
	box-sizing: border-box;
}

.bf-tools-notice {
	background: #fef3c7;
	border: 1px solid #f59e0b;
	border-radius: 10px;
	padding: 1rem 1.25rem;
	color: #92400e;
}

.bf-tools :focus-visible {
	outline: 3px solid #1d4ed8;
	outline-offset: 2px;
	border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Cards + buttons                                                    */
/* ------------------------------------------------------------------ */

.bf-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 1.25rem;
	box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}

.bf-intro-title {
	font-size: 1.5rem;
	line-height: 1.3;
	margin: 0 0 0.75rem;
}

.bf-intro-desc {
	font-size: 1.05rem;
	color: #374151;
	margin: 0 0 0.75rem;
}

.bf-intro-text {
	color: #4b5563;
	margin: 0 0 1.25rem;
}

.bf-btn {
	display: inline-block;
	font: inherit;
	font-weight: 600;
	border-radius: 10px;
	padding: 0.8rem 1.4rem;
	cursor: pointer;
	border: 2px solid transparent;
	text-decoration: none;
	text-align: center;
	min-height: 52px;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.bf-btn-primary {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #ffffff;
}

.bf-btn-primary:hover {
	background: #1e40af;
	border-color: #1e40af;
}

.bf-btn-secondary {
	background: #ffffff;
	border-color: #9ca3af;
	color: #111827;
}

.bf-btn-secondary:hover {
	border-color: #1d4ed8;
	color: #1d4ed8;
}

.bf-btn-large {
	width: 100%;
	font-size: 1.1rem;
	padding: 1rem 1.4rem;
}

/* ------------------------------------------------------------------ */
/* Progress                                                           */
/* ------------------------------------------------------------------ */

.bf-progress-wrap {
	margin-bottom: 1rem;
}

.bf-step-label {
	margin: 0 0 0.4rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: #4b5563;
}

.bf-progress {
	height: 10px;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
}

.bf-progress-fill {
	height: 100%;
	width: 0;
	background: #1d4ed8;
	border-radius: 999px;
	transition: width 0.3s ease;
}

/* ------------------------------------------------------------------ */
/* Questions                                                          */
/* ------------------------------------------------------------------ */

.bf-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}

.bf-legend {
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.4;
	padding: 0;
	margin-bottom: 1rem;
}

.bf-required {
	color: #b91c1c;
}

.bf-options {
	display: grid;
	gap: 0.65rem;
}

.bf-option {
	display: block;
	width: 100%;
	min-height: 58px;
	padding: 0.9rem 1rem;
	font: inherit;
	font-size: 1rem;
	text-align: left;
	background: #ffffff;
	border: 2px solid #d1d5db;
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.bf-option:hover {
	border-color: #93c5fd;
	background: #f8fafc;
}

.bf-option.is-selected {
	border-color: #1d4ed8;
	background: #eff6ff;
	box-shadow: 0 0 0 1px #1d4ed8;
}

.bf-option-label {
	display: block;
	font-weight: 500;
	color: #111827;
}

/* Scale (1–5) questions sit side by side. */
.bf-options.bf-scale {
	grid-template-columns: repeat(5, 1fr);
	gap: 0.5rem;
}

.bf-options.bf-scale .bf-option {
	text-align: center;
	padding: 0.9rem 0.25rem;
	font-weight: 700;
	font-size: 1.1rem;
}

.bf-text {
	width: 100%;
	font: inherit;
	padding: 0.85rem 1rem;
	border: 2px solid #d1d5db;
	border-radius: 10px;
	background: #ffffff;
	color: #111827;
}

.bf-text:focus {
	border-color: #1d4ed8;
	outline: none;
	box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.bf-field-error {
	color: #b91c1c;
	font-weight: 600;
	margin: 0.75rem 0 0;
}

.bf-nav {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.bf-nav .bf-btn {
	flex: 1;
}

/* ------------------------------------------------------------------ */
/* Loading / error                                                    */
/* ------------------------------------------------------------------ */

.bf-loading {
	text-align: center;
	padding: 2.5rem 1.25rem;
}

.bf-spinner {
	width: 44px;
	height: 44px;
	margin: 0 auto 1rem;
	border: 4px solid #dbeafe;
	border-top-color: #1d4ed8;
	border-radius: 50%;
	animation: bf-spin 0.9s linear infinite;
}

@keyframes bf-spin {
	to {
		transform: rotate(360deg);
	}
}

.bf-error-card {
	border-color: #fca5a5;
}

.bf-error-title {
	margin-top: 0;
	color: #b91c1c;
}

/* ------------------------------------------------------------------ */
/* Results                                                            */
/* ------------------------------------------------------------------ */

.bf-result-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.bf-result-title {
	font-size: 1.4rem;
	line-height: 1.3;
	margin: 0;
}

.bf-result-section {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-left: 4px solid #1d4ed8;
	border-radius: 10px;
	padding: 1.1rem 1.2rem;
	margin-bottom: 1rem;
	box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.bf-section-title {
	font-size: 1.1rem;
	margin: 0 0 0.6rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.bf-section-icon {
	flex-shrink: 0;
}

.bf-result-section p {
	margin: 0 0 0.6rem;
}

.bf-result-section p:last-child {
	margin-bottom: 0;
}

.bf-list {
	margin: 0;
	padding-left: 1.35rem;
}

.bf-list li {
	margin-bottom: 0.45rem;
}

.bf-list li:last-child {
	margin-bottom: 0;
}

/* Situation definition list. */
.bf-dl {
	margin: 0;
	display: grid;
	gap: 0.4rem;
}

.bf-dl-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.1rem;
	padding: 0.45rem 0;
	border-bottom: 1px dashed #e5e7eb;
}

.bf-dl-row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.bf-dl-row dt {
	font-weight: 600;
	color: #4b5563;
	font-size: 0.9rem;
}

.bf-dl-row dd {
	margin: 0;
	font-weight: 500;
}

/* Builder output blocks. */
.bf-builder {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #e5e7eb;
}

.bf-builder-title {
	font-size: 1.05rem;
	margin: 0 0 0.6rem;
}

.bf-builder-sub {
	font-size: 0.95rem;
	margin: 0.9rem 0 0.35rem;
	color: #1e40af;
}

/* Callout boxes. */
.bf-callout {
	border-radius: 10px;
	padding: 1rem 1.15rem;
	border: 1px solid;
}

.bf-callout-warning {
	background: #fffbeb;
	border-color: #f59e0b;
}

.bf-callout-info {
	background: #eff6ff;
	border-color: #93c5fd;
}

.bf-pro-help {
	margin-bottom: 1rem;
}

.bf-disclaimer {
	font-size: 0.85rem;
	color: #4b5563;
	border-top: 1px solid #e5e7eb;
	padding-top: 1rem;
	margin-top: 1.25rem;
}

/* Link cards. */
.bf-link-grid {
	display: grid;
	gap: 0.75rem;
}

.bf-link-card {
	display: block;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 0.9rem 1rem;
	text-decoration: none;
	color: inherit;
	background: #ffffff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bf-link-card:hover {
	border-color: #1d4ed8;
	box-shadow: 0 2px 6px rgba(29, 78, 216, 0.12);
}

.bf-link-card-title {
	display: block;
	font-weight: 700;
	color: #1d4ed8;
}

.bf-link-card-desc {
	display: block;
	font-size: 0.9rem;
	color: #4b5563;
	margin-top: 0.2rem;
}

.bf-affiliate-note {
	font-size: 0.82rem;
	color: #6b7280;
	margin-top: 0.9rem;
}

.bf-affiliate-note a {
	color: #1d4ed8;
}

.bf-result-actions {
	margin-top: 1.25rem;
	text-align: center;
}

/* ------------------------------------------------------------------ */
/* Landing grid                                                       */
/* ------------------------------------------------------------------ */

.bf-tools-landing {
	display: grid;
	gap: 1rem;
	max-width: 1080px;
	margin: 0 auto;
}

.bf-tool-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 1.4rem;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}

.bf-tool-card-icon {
	font-size: 1.8rem;
	line-height: 1;
	margin-bottom: 0.6rem;
}

.bf-tool-card-title {
	font-size: 1.2rem;
	margin: 0 0 0.5rem;
}

.bf-tool-card-desc {
	color: #374151;
	margin: 0 0 0.75rem;
}

.bf-tool-card-meta {
	font-size: 0.9rem;
	color: #4b5563;
	margin: 0 0 0.4rem;
}

.bf-tool-card-cta {
	margin-top: auto;
	align-self: flex-start;
}

/* ------------------------------------------------------------------ */
/* Larger screens                                                     */
/* ------------------------------------------------------------------ */

@media (min-width: 560px) {
	.bf-card {
		padding: 1.75rem;
	}

	.bf-dl-row {
		grid-template-columns: 200px 1fr;
		gap: 1rem;
	}

	.bf-link-grid {
		grid-template-columns: 1fr 1fr;
	}

	.bf-tools-landing {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.bf-tools-landing {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ------------------------------------------------------------------ */
/* Print + reduced motion                                             */
/* ------------------------------------------------------------------ */

@media print {
	.bf-tools .bf-btn,
	.bf-tools .bf-progress-wrap,
	.bf-tools .bf-nav,
	.bf-tools .bf-copy-btn,
	.bf-tools .bf-result-actions {
		display: none !important;
	}

	.bf-tools,
	.bf-card,
	.bf-result-section {
		box-shadow: none;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bf-tools *,
	.bf-tools *::before,
	.bf-tools *::after {
		animation: none !important;
		transition: none !important;
	}
}
