/* ===========================================================
   RICH GARDENS FARMER DATA COLLECTOR — stylesheet
   Theme color: #96C93F, used for buttons, focus states, accents,
   and status highlights throughout — one consistent color, not a
   separate palette per screen.
   =========================================================== */

:root {
	--rgfd-primary: #96c93f;
	--rgfd-primary-dark: #7ca934;
	--rgfd-primary-darker: #5c7d26;
	--rgfd-primary-light: #eef7e1;
	--rgfd-danger: #c0392b;
	--rgfd-danger-light: #fdecea;
	--rgfd-danger-dark: #7a1f13;
	--rgfd-border: #ccc;
	--rgfd-text: #23282d;
	--rgfd-text-muted: #666;
}

/* ================= FORMS (public form, quick sign-up, buyer form, portal, etc.) ================= */

.rgfd-public-form {
	max-width: 520px;
	margin: 0 auto;
	font-size: 16px;
}

.rgfd-hint {
	font-size: 13px;
	color: var(--rgfd-text-muted);
	margin-top: 0;
}

.rgfd-field {
	margin-bottom: 16px;
}

.rgfd-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}

.rgfd-required {
	color: var(--rgfd-danger);
}

.rgfd-field input[type="text"],
.rgfd-field input[type="number"],
.rgfd-field input[type="date"],
.rgfd-field select,
.rgfd-field textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--rgfd-border);
	border-radius: 4px;
	box-sizing: border-box;
	font-size: 16px; /* prevents iOS auto-zoom on focus */
	font-family: inherit;
}

.rgfd-field input[type="text"]:focus,
.rgfd-field input[type="number"]:focus,
.rgfd-field input[type="date"]:focus,
.rgfd-field select:focus,
.rgfd-field textarea:focus {
	border-color: var(--rgfd-primary);
	outline: none;
}

.rgfd-honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
}

.rgfd-button-primary {
	width: 100%;
	padding: 14px;
	background: var(--rgfd-primary);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
}

.rgfd-button-primary:hover {
	background: var(--rgfd-primary-dark);
}

.rgfd-button-primary:disabled {
	opacity: 0.6;
	cursor: default;
}

.rgfd-button-secondary {
	padding: 8px 12px;
	background: #f0f0f0;
	border: 1px solid var(--rgfd-border);
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}

.rgfd-notice {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
}

.rgfd-success {
	background: var(--rgfd-primary-light);
	border: 1px solid var(--rgfd-primary);
	color: var(--rgfd-primary-darker);
}

.rgfd-error {
	background: var(--rgfd-danger-light);
	border: 1px solid var(--rgfd-danger);
	color: var(--rgfd-danger-dark);
}

/* Crop repeater */
.rgfd-crop-blocks {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 12px;
}

.rgfd-crop-block {
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 14px;
	background: #fafafa;
}

.rgfd-crop-blocks .rgfd-crop-block:nth-child(even) {
	background: #f4f8ef;
	border-color: #d3e4bd;
}

.rgfd-crop-blocks .rgfd-crop-block:nth-child(even) .rgfd-crop-block-title {
	color: var(--rgfd-primary-darker);
}

.rgfd-crop-block-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.rgfd-crop-block-title {
	color: var(--rgfd-primary-dark);
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.5px;
}

.rgfd-remove-crop {
	background: none;
	border: none;
	color: var(--rgfd-danger);
	cursor: pointer;
	font-size: 13px;
	text-decoration: underline;
	padding: 0;
}

.rgfd-add-crop {
	margin-top: 4px;
}

/* Admin list extras */
.rgfd-source-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
}

.rgfd-source-public_form {
	background: #e3f2fd;
	color: #0d47a1;
}

.rgfd-source-admin {
	background: #f3e5f5;
	color: #6a1b9a;
}

.rgfd-crop-count {
	color: #888;
	font-size: 12px;
}

.rgfd-field-recurring_annual_confirmed {
	display: none;
}

/* Collapsible sections: Your Details on the public form, and every section in the farmer portal */
.rgfd-collapsible {
	margin-bottom: 16px;
}

.rgfd-collapsible-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: var(--rgfd-primary-light);
	border: 1px solid #d3e4bd;
	border-radius: 6px;
}

.rgfd-collapsible-body {
	padding-top: 4px;
}

.rgfd-crop-block-header span {
	display: flex;
	gap: 8px;
}

.rgfd-toggle-crop-block {
	background: none;
	border: none;
	color: var(--rgfd-primary-darker);
	cursor: pointer;
	font-size: 13px;
	text-decoration: underline;
	padding: 0;
}

/* Farmer portal */
.rgfd-portal-login,
.rgfd-portal {
	max-width: 520px;
	margin: 0 auto;
}

.rgfd-portal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.rgfd-portal-crops {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Harvest status badges (Crop Monitor) */
.rgfd-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	white-space: nowrap;
}

.rgfd-status-upcoming {
	background: #eceff1;
	color: #37474f;
}

.rgfd-status-window_open {
	background: #fff8e1;
	color: #8d6e00;
}

.rgfd-status-awaiting_confirmation {
	background: var(--rgfd-danger-light);
	color: #b71c1c;
}

.rgfd-status-confirmed {
	background: var(--rgfd-primary-light);
	color: var(--rgfd-primary-darker);
}

.rgfd-delay-flag {
	color: #b71c1c;
	font-weight: 600;
	font-size: 12px;
	margin-left: 6px;
}

/* WooCommerce product page batch meta */
.rgfd-batch-meta {
	margin: 14px 0;
	padding: 10px 14px;
	background: var(--rgfd-primary-light);
	border-left: 3px solid var(--rgfd-primary);
	font-size: 14px;
}

.rgfd-batch-meta p {
	margin: 2px 0;
}

.rgfd-total-tonnage {
	background: var(--rgfd-primary-light);
	border: 1px solid var(--rgfd-primary);
	color: var(--rgfd-primary-darker);
	padding: 10px 16px;
	border-radius: 4px;
	margin-bottom: 20px;
	font-size: 15px;
}

/* ================= ADMIN SCREENS (Dashboard, Settings) ================= */

.rgfd-chart-wrap {
	max-width: 700px;
	margin-bottom: 30px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 16px;
}

.rgfd-chart-wrap h4 {
	margin-top: 0;
}

.rgfd-dashboard-columns {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 20px;
}

.rgfd-dashboard-columns .rgfd-chart-wrap {
	max-width: none;
	margin-bottom: 0;
	height: 100%;
}

@media (max-width: 1100px) {
	.rgfd-dashboard-columns {
		grid-template-columns: 1fr;
	}
}

.rgfd-settings-stack {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 900px;
}

.rgfd-settings-section {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 20px 24px;
}

.rgfd-settings-section h2 {
	margin-top: 0;
}

.rgfd-save-indicator {
	display: inline-block;
	margin-left: 8px;
	font-size: 13px;
	color: var(--rgfd-primary-darker);
	font-weight: 600;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.rgfd-save-indicator.rgfd-saved-flash {
	opacity: 1;
}

.rgfd-accordion {
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #fff;
	overflow: hidden;
}

.rgfd-accordion-item {
	border-bottom: 1px solid #dcdcde;
}

.rgfd-accordion-item:last-child {
	border-bottom: none;
}

.rgfd-accordion-header {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #fafafa;
	border: none;
	padding: 16px 20px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	color: var(--rgfd-text);
}

.rgfd-accordion-header:hover {
	background: var(--rgfd-primary-light);
	color: var(--rgfd-primary-darker);
}

.rgfd-accordion-header.rgfd-accordion-active {
	background: var(--rgfd-primary-light);
	color: var(--rgfd-primary-darker);
}

.rgfd-accordion-caret {
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
}

.rgfd-accordion-body {
	padding: 22px 24px;
}

.rgfd-module-row {
	padding: 10px 0;
	border-bottom: 1px solid #eee;
}

.rgfd-placeholder-mode .rgfd-field label,
.rgfd-placeholder-mode .field label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Right-align row/table action buttons consistently */
.rgfd-settings-section table th:last-child,
.rgfd-settings-section table td:last-child {
	text-align: right;
}
