/* CAFODIA Field Reports — front-end form */

.cfr-form-shell {
	--cfr-green: #297d47;
	--cfr-green-deep: #1d5c34;
	--cfr-mist: #a0c9ac;
	--cfr-tint: #d6eddb;
	--cfr-ink: #4e4e4e;
	--cfr-muted: #6e6e6e;
	--cfr-line: #e2e9e4;
	--cfr-canvas: #f4f8f5;
	--cfr-high: #c62828;
	--cfr-medium: #e0a106;
	--cfr-low: #297d47;
	--cfr-radius: 14px;

	max-width: 780px;
	margin: 0 auto;
	color: var(--cfr-ink);
	font-size: 16px;
	line-height: 1.55;
}

.cfr-form-shell *,
.cfr-form-shell *::before,
.cfr-form-shell *::after {
	box-sizing: border-box;
}

/* Notices ---------------------------------------------------------- */

.cfr-notice {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 18px 20px;
	margin-bottom: 22px;
	border-radius: var(--cfr-radius);
	border-left: 5px solid var(--cfr-green);
	background: #edf5ef;
}

.cfr-notice p { margin: 4px 0 0; }
.cfr-notice ul { margin: 8px 0 0 18px; }
.cfr-notice code { background: rgba(41, 125, 71, .10); padding: 2px 6px; border-radius: 4px; }

.cfr-notice--success {
	background: #d6eddb;
	border-left-color: var(--cfr-low);
}

.cfr-notice--error {
	background: #fdeded;
	border-left-color: var(--cfr-high);
}

.cfr-notice__mark {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	border-radius: 50%;
	background: var(--cfr-low);
	color: #fff;
	font-size: 16px;
	line-height: 1;
}

/* Form ------------------------------------------------------------- */

.cfr-form {
	background: #fff;
	border: 1px solid var(--cfr-line);
	border-radius: var(--cfr-radius);
	box-shadow: 0 18px 40px -28px rgba(29, 92, 52, .40);
	overflow: hidden;
}

.cfr-form__head {
	display: flex;
	gap: 16px;
	align-items: center;
	padding: 24px 28px;
	background: var(--cfr-green);
	color: #fff;
}

.cfr-form__step {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	border-radius: 50%;
	background: var(--cfr-mist);
	color: var(--cfr-green-deep);
	font-weight: 700;
	letter-spacing: .02em;
}

.cfr-form__title {
	margin: 0;
	color: #fff;
	font-size: 22px;
	line-height: 1.2;
	letter-spacing: .01em;
}

.cfr-form__sub {
	margin: 4px 0 0;
	color: rgba(255, 255, 255, .78);
	font-size: 14px;
}

.cfr-form > .cfr-field,
.cfr-form > .cfr-grid,
.cfr-form > fieldset {
	padding: 20px 28px 0;
	border: 0;
	margin: 0;
}

.cfr-field { position: relative; }

.cfr-field > label,
.cfr-field legend {
	display: block;
	margin-bottom: 7px;
	font-weight: 600;
	font-size: 14px;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--cfr-green);
}

.cfr-req { color: var(--cfr-high); }

.cfr-form input[type="text"],
.cfr-form input[type="email"],
.cfr-form input[type="date"],
.cfr-form select,
.cfr-form textarea {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--cfr-line);
	border-radius: 9px;
	background: #fff;
	color: var(--cfr-ink);
	font-size: 15px;
	font-family: inherit;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.cfr-form input:focus,
.cfr-form select:focus,
.cfr-form textarea:focus {
	outline: none;
	border-color: var(--cfr-green);
	box-shadow: 0 0 0 3px rgba(41, 125, 71, .18);
}

.cfr-form textarea { resize: vertical; }

.cfr-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}

.cfr-help {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--cfr-muted);
}

.cfr-count {
	position: absolute;
	right: 0;
	bottom: -18px;
	font-size: 12px;
	color: var(--cfr-muted);
}

/* Upload ----------------------------------------------------------- */

.cfr-drop {
	position: relative;
	border: 2px dashed #bfd5c6;
	border-radius: 12px;
	background: var(--cfr-canvas);
	transition: border-color .15s ease, background .15s ease;
}

.cfr-drop:hover,
.cfr-drop.is-dragging {
	border-color: var(--cfr-mist);
	background: #f0f8f2;
}

.cfr-drop.is-filled {
	border-style: solid;
	border-color: var(--cfr-green);
	background: #eef6f0;
}

.cfr-drop input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.cfr-drop__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 26px 20px;
	text-align: center;
	pointer-events: none;
}

.cfr-drop__icon {
	font-size: 26px;
	color: var(--cfr-green);
	line-height: 1;
}

.cfr-drop__label { font-weight: 600; color: var(--cfr-green); }
.cfr-drop__meta { font-size: 13px; color: var(--cfr-muted); }

/* Priority --------------------------------------------------------- */

.cfr-priority {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.cfr-priority__opt {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 9px 18px;
	border: 1px solid var(--cfr-line);
	border-radius: 999px;
	background: #fff;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: all .15s ease;
}

.cfr-priority__opt input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cfr-priority__opt--high:has(input:checked) { background: var(--cfr-high); border-color: var(--cfr-high); color: #fff; }
.cfr-priority__opt--medium:has(input:checked) { background: var(--cfr-medium); border-color: var(--cfr-medium); color: #4a3300; }
.cfr-priority__opt--low:has(input:checked) { background: var(--cfr-low); border-color: var(--cfr-low); color: #fff; }

/* Fallback for browsers without :has() — JS adds this class. */
.cfr-priority__opt.is-selected.cfr-priority__opt--high { background: var(--cfr-high); border-color: var(--cfr-high); color: #fff; }
.cfr-priority__opt.is-selected.cfr-priority__opt--medium { background: var(--cfr-medium); border-color: var(--cfr-medium); color: #4a3300; }
.cfr-priority__opt.is-selected.cfr-priority__opt--low { background: var(--cfr-low); border-color: var(--cfr-low); color: #fff; }

.cfr-priority__opt:focus-within {
	box-shadow: 0 0 0 3px rgba(41, 125, 71, .22);
}

/* Footer ----------------------------------------------------------- */

.cfr-form__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 26px;
	padding: 18px 28px;
	background: #eff4f0;
	border-top: 1px solid var(--cfr-line);
}

.cfr-accepted {
	margin: 0;
	font-size: 13px;
	color: var(--cfr-green);
	font-weight: 600;
}

.cfr-btn {
	display: inline-block;
	padding: 12px 26px;
	border: 0;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform .12s ease, background .15s ease;
}

.cfr-btn--primary {
	background: var(--cfr-green);
	color: #fff;
}

.cfr-btn--primary:hover {
	background: var(--cfr-green-deep);
	color: #fff;
	transform: translateY(-1px);
}

.cfr-btn--primary:focus-visible {
	outline: 3px solid var(--cfr-ink);
	outline-offset: 2px;
}

.cfr-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 640px) {
	.cfr-grid { grid-template-columns: 1fr; }
	.cfr-form__head { padding: 20px; }
	.cfr-form > .cfr-field,
	.cfr-form > .cfr-grid,
	.cfr-form > fieldset { padding: 18px 20px 0; }
	.cfr-form__foot { padding: 16px 20px; }
	.cfr-btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.cfr-form-shell * { transition: none !important; }
}
