/* ============================================================
   Recyca Collection Form — Public Styles
   Scoped entirely to .rf-wrap to avoid theme conflicts.
   ============================================================ */

/* ---- Reset & tokens ---- */
.rf-wrap {
	--rf-green:        #AAC623;
	--rf-green-dk:     #8a9e1a;
	--rf-green-lt:     #f5f8e8;
	--rf-text:         #111827;
	--rf-muted:        #6b7280;
	--rf-border:       #e5e7eb;
	--rf-bg:           #f9fafb;
	--rf-white:        #ffffff;
	--rf-error:        #ef4444;
	--rf-radius:       12px;
	--rf-radius-sm:    8px;
	--rf-shadow:       0 1px 3px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.05);
	--rf-transition:   0.2s ease;

	max-width: 680px;
	margin: 0 auto;
	padding: 0 16px 48px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
	font-size: 16px;
	color: var(--rf-text);
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
}

.rf-wrap *,
.rf-wrap *::before,
.rf-wrap *::after {
	box-sizing: inherit;
}

.rf-noscript {
	background: #fef3c7;
	border: 1px solid #fbbf24;
	border-radius: var(--rf-radius-sm);
	padding: 12px 16px;
	font-size: 0.9rem;
	margin-bottom: 16px;
}

/* ---- Form header (title + intro from settings) ---- */
.rf-form-header {
	padding: 32px 0 8px;
}

.rf-form-title {
	font-size: clamp(1.35rem, 4vw, 1.7rem);
	font-weight: 800;
	color: var(--rf-text);
	margin: 0 0 10px;
	line-height: 1.25;
}

.rf-form-intro {
	font-size: 0.95rem;
	color: var(--rf-muted);
	margin: 0;
	line-height: 1.6;
}

/* ---- Progress indicator ---- */
.rf-progress-wrap {
	padding: 24px 0 32px;
}

@media (max-width: 600px) {
	.rf-progress-wrap {
		position: sticky;
		top: 0;
		z-index: 20;
		background: var(--rf-white);
		margin: 0 -16px;
		padding: 14px 16px;
		box-shadow: 0 2px 8px rgba(0,0,0,.07);
	}
}

.rf-progress {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
}

.rf-progress__step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	position: relative;
	z-index: 1;
}

.rf-progress__num {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid var(--rf-border);
	background: var(--rf-white);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--rf-muted);
	transition: all var(--rf-transition);
	flex-shrink: 0;
}

.rf-progress__label {
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--rf-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	transition: color var(--rf-transition);
	white-space: nowrap;
}

@media (max-width: 480px) {
	.rf-progress__label { display: none; }
}

.rf-progress__line {
	flex: 1;
	height: 2px;
	background: var(--rf-border);
	transition: background var(--rf-transition);
	min-width: 16px;
}

/* Active step */
.rf-progress__step.is-active .rf-progress__num {
	border-color: var(--rf-green);
	color: var(--rf-green);
	box-shadow: 0 0 0 4px rgba(170, 198, 35, .14);
}
.rf-progress__step.is-active .rf-progress__label {
	color: var(--rf-green);
}

/* Completed step */
.rf-progress__step.is-done .rf-progress__num {
	background: var(--rf-green);
	border-color: var(--rf-green);
	color: var(--rf-white);
}
.rf-progress__step.is-done .rf-progress__num::after {
	content: '';
	display: block;
	width: 10px;
	height: 6px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(-45deg) translate(1px, -1px);
}
.rf-progress__step.is-done .rf-progress__num > span { display: none; }
.rf-progress__line.is-done { background: var(--rf-green); }

/* ---- Step cards ---- */

/*
 * Steps start visible so the form works without JS and has no blank flash.
 * The JS init immediately adds .rf-js to .rf-wrap, which then hides all
 * inactive steps. This means: no JS → all steps scroll-visible; JS ready →
 * only the active step is shown.
 */
.rf-step {
	display: block;
}

/* Once JS is running, hide all steps by default; only .is-active is shown. */
.rf-js .rf-step {
	display: none;
}
.rf-js .rf-step.is-active {
	display: block;
	animation: rfFadeUp var(--rf-transition) both;
}

@keyframes rfFadeUp {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0);    }
}

.rf-card {
	background: var(--rf-white);
	border-radius: var(--rf-radius);
	box-shadow: var(--rf-shadow);
	padding: 32px;
	margin-bottom: 4px;
}

@media (max-width: 480px) {
	.rf-card { padding: 24px 20px; }
}

.rf-step__title {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--rf-text);
	margin: 0 0 6px;
}

.rf-step__subtitle {
	font-size: 0.9rem;
	color: var(--rf-muted);
	margin: 0 0 28px;
	line-height: 1.5;
}

/* ---- Form fields ---- */
.rf-field {
	margin-bottom: 18px;
}
.rf-field:last-child { margin-bottom: 0; }

.rf-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--rf-text);
	margin-bottom: 6px;
}

.rf-label-link {
	font-weight: 500;
	font-size: 0.8125rem;
	color: var(--rf-green);
	margin-left: auto;
	text-decoration: none;
}
.rf-label-link:hover { text-decoration: underline; }

.rf-label-optional {
	font-weight: 400;
	color: var(--rf-muted);
	font-size: 0.8125rem;
}

.rf-required { color: var(--rf-error); }

.rf-input {
	display: block;
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--rf-border);
	border-radius: var(--rf-radius-sm);
	font-size: 1rem;
	font-family: inherit;
	color: var(--rf-text);
	background: var(--rf-white);
	transition: border-color var(--rf-transition), box-shadow var(--rf-transition);
	outline: none;
	appearance: none;
}
.rf-input:hover { border-color: #d1d5db; }
.rf-input:focus {
	border-color: var(--rf-green);
	box-shadow: 0 0 0 3px rgba(170, 198, 35, .15);
}
.rf-input.has-error {
	border-color: var(--rf-error);
	box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

.rf-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
	cursor: pointer;
}

.rf-textarea {
	resize: vertical;
	min-height: 130px;
	line-height: 1.6;
}

.rf-hint {
	font-size: 0.8125rem;
	color: var(--rf-muted);
	margin: 6px 0 0;
	line-height: 1.4;
}

.rf-error {
	font-size: 0.8125rem;
	color: var(--rf-error);
	margin: 5px 0 0;
	display: none;
	align-items: center;
	gap: 5px;
}
.rf-error.is-visible { display: flex; }

/* ---- Grid rows ---- */
.rf-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.rf-row--3col {
	grid-template-columns: 1fr 2fr 1fr;
}
@media (max-width: 520px) {
	.rf-row,
	.rf-row--3col { grid-template-columns: 1fr; }
}

/* ---- Quantity stepper ---- */
.rf-stepper {
	display: inline-flex;
	align-items: stretch;
	border: 1.5px solid var(--rf-border);
	border-radius: var(--rf-radius-sm);
	overflow: hidden;
	background: var(--rf-white);
	transition: border-color var(--rf-transition);
}
.rf-stepper:focus-within { border-color: var(--rf-green); }

.rf-stepper__btn {
	width: 44px;
	height: 48px;
	background: var(--rf-bg);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rf-muted);
	transition: background var(--rf-transition), color var(--rf-transition);
	flex-shrink: 0;
}
.rf-stepper__btn:hover {
	background: #e9eef4;
	color: var(--rf-text);
}
.rf-stepper__btn:active { background: var(--rf-green-lt); }

.rf-stepper__input {
	width: 64px;
	height: 48px;
	border: none;
	border-left: 1px solid var(--rf-border);
	border-right: 1px solid var(--rf-border);
	text-align: center;
	font-size: 1.0625rem;
	font-weight: 700;
	font-family: inherit;
	color: var(--rf-text);
	background: var(--rf-white);
	outline: none;
	-moz-appearance: textfield;
	appearance: textfield;
}
.rf-stepper__input::-webkit-outer-spin-button,
.rf-stepper__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---- Material sections (step 2) ---- */
.rf-material-section {
	border: 1.5px solid var(--rf-border);
	border-radius: var(--rf-radius-sm);
	padding: 20px 20px 16px;
	margin-bottom: 16px;
	transition: border-color var(--rf-transition);
}
.rf-material-section:last-child { margin-bottom: 0; }
.rf-material-section:hover { border-color: #d1d5db; }

.rf-material-section__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 4px;
}

.rf-material-section__icon {
	color: var(--rf-green);
	display: flex;
	flex-shrink: 0;
}

.rf-material-section__title {
	font-size: 1rem;
	font-weight: 700;
	margin: 0;
}

.rf-material-section__desc {
	font-size: 0.875rem;
	color: var(--rf-muted);
	margin: 0 0 14px;
}

/* ---- Delivery rows (step 3) ---- */
.rf-delivery-quantities { margin-bottom: 20px; }

.rf-delivery-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid var(--rf-border);
	gap: 16px;
}
.rf-delivery-row:first-child { padding-top: 0; }
.rf-delivery-row:last-child  { border-bottom: none; padding-bottom: 0; }

.rf-delivery-row__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.rf-delivery-row__info strong { font-size: 0.9375rem; }
.rf-delivery-row__sub { font-size: 0.8125rem; color: var(--rf-muted); }

/* No-delivery checkbox */
.rf-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px;
	border: 1.5px solid var(--rf-border);
	border-radius: var(--rf-radius-sm);
	cursor: pointer;
	transition: border-color var(--rf-transition), background var(--rf-transition);
	user-select: none;
}
.rf-checkbox-label:hover { border-color: #d1d5db; }
.rf-checkbox-label.is-checked {
	border-color: var(--rf-green);
	background: var(--rf-green-lt);
}

.rf-checkbox {
	width: 20px;
	height: 20px;
	min-width: 20px;
	margin-top: 2px;
	accent-color: var(--rf-green);
	cursor: pointer;
}

.rf-checkbox-label__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.rf-checkbox-label__text strong { font-size: 0.9375rem; }
.rf-checkbox-label__sub { font-size: 0.8125rem; color: var(--rf-muted); }

.rf-delivery-quantities.is-hidden { display: none; }

/* ---- Review step (step 5) ---- */
.rf-review-section {
	border: 1.5px solid var(--rf-border);
	border-radius: var(--rf-radius-sm);
	margin-bottom: 14px;
	overflow: hidden;
}
.rf-review-section:last-child { margin-bottom: 0; }

.rf-review-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
	background: var(--rf-bg);
	border-bottom: 1px solid var(--rf-border);
}

.rf-review-section__title {
	font-size: 0.9375rem;
	font-weight: 700;
	margin: 0;
}

.rf-review-edit {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--rf-green);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	text-decoration: none;
}
.rf-review-edit:hover { text-decoration: underline; }

.rf-review-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	padding: 12px 18px;
	margin: 0;
}

@media (max-width: 480px) {
	.rf-review-grid { grid-template-columns: 1fr; }
}

.rf-review-item {
	padding: 8px 0;
}
.rf-review-item--full {
	grid-column: 1 / -1;
}
.rf-review-item dt {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--rf-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 3px;
}
.rf-review-item dd {
	font-size: 0.9375rem;
	font-weight: 500;
	margin: 0;
	color: var(--rf-text);
}

.rf-review-remarks {
	padding: 14px 18px;
	margin: 0;
	font-size: 0.9375rem;
	color: var(--rf-text);
	line-height: 1.6;
	white-space: pre-wrap;
}

/* ---- Navigation ---- */
.rf-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 20px;
	padding: 20px 0 0;
}

.rf-nav__right { display: flex; gap: 12px; }

/* ---- Buttons ---- */
.rf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: var(--rf-radius-sm);
	font-size: 0.9375rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	border: none;
	transition: background var(--rf-transition), transform 0.1s, box-shadow var(--rf-transition), opacity var(--rf-transition);
	text-decoration: none;
	white-space: nowrap;
}

.rf-btn--primary {
	background: var(--rf-green);
	color: #fff;
}
.rf-btn--primary:hover {
	background: var(--rf-green-dk);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(170, 198, 35, .35);
}
.rf-btn--primary:active { transform: translateY(0); }

.rf-btn--secondary {
	background: var(--rf-bg);
	color: var(--rf-muted);
	border: 1.5px solid var(--rf-border);
}
.rf-btn--secondary:hover {
	background: #eef0f3;
	border-color: #d1d5db;
	color: var(--rf-text);
}

.rf-btn--loading {
	opacity: 0.65;
	pointer-events: none;
}

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

/* ---- General form error ---- */
.rf-form-error {
	color: var(--rf-error);
	font-size: 0.9rem;
	margin-top: 12px;
	padding: 12px 16px;
	background: #fef2f2;
	border-radius: var(--rf-radius-sm);
	border: 1px solid #fecaca;
}

/* ---- Confirmation screen ---- */
.rf-confirmation {
	background: var(--rf-white);
	border-radius: var(--rf-radius);
	box-shadow: var(--rf-shadow);
	padding: 56px 32px;
	text-align: center;
	animation: rfFadeUp 0.3s both;
}

.rf-confirmation__icon {
	width: 76px;
	height: 76px;
	background: var(--rf-green-lt);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 24px;
}

.rf-confirmation__title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 12px;
}

.rf-confirmation__text {
	font-size: 1rem;
	color: var(--rf-muted);
	line-height: 1.7;
	max-width: 440px;
	margin: 0 auto 24px;
}

.rf-confirmation__ref {
	display: inline-block;
	background: var(--rf-green-lt);
	border: 1px solid rgba(170, 198, 35, .3);
	border-radius: 6px;
	padding: 8px 20px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--rf-green-dk);
	margin-bottom: 24px;
}

.rf-confirmation__footer {
	font-size: 0.875rem;
	color: var(--rf-muted);
}
.rf-confirmation__footer a {
	color: var(--rf-green);
	text-decoration: none;
}
.rf-confirmation__footer a:hover { text-decoration: underline; }
