/* ==========================================================================
   NIM Project Intake Form — Stylesheet
   All selectors namespaced under .nim-intake-form
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Poppins:wght@500;600;700&display=swap');

/* --------------------------------------------------------------------------
   Reset / Box-sizing
   -------------------------------------------------------------------------- */
.nim-intake-form *,
.nim-intake-form *::before,
.nim-intake-form *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.nim-intake-form {
	display: grid;
	position: relative;
	max-width: 700px;
	margin: 0 auto;
	padding: 20px 0 0;
	font-family: 'Montserrat', sans-serif;
	font-size: 20px;
	font-weight: 400;
	line-height: 28px;
	color: #333333;
}

/* Scroll anchor — sits at the very top of the form wrapper, outside grid flow */
#nim-form-top {
	position: absolute;
	top: 0;
	left: 0;
	height: 0;
	width: 0;
	scroll-margin-top: 140px; /* 88px sticky header + 52px breathing room */
}

/* --------------------------------------------------------------------------
   Sections — all stacked in the same grid cell; only the active one visible.
   This keeps the container height constant (sized by the tallest section).
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-section {
	grid-column: 1;
	grid-row: 1;
	visibility: hidden;
	pointer-events: none;
}

.nim-intake-form .nim-section--active {
	visibility: visible;
	pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Step indicator
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-step-indicator {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6b7280;
	margin: 0 0 1.25rem;
	min-height: 1.2em; /* reserve space so layout doesn't shift */
}

/* --------------------------------------------------------------------------
   Section headings (legend + non-fieldset labels)
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.nim-intake-form .nim-section-label {
	display: block;
	font-family: 'Montserrat', sans-serif;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.3;
	color: #F6A838;
	margin: 0 0 1.75rem;
	padding: 0;
	/* Override browser legend defaults */
	float: none;
	width: 100%;
	max-width: 100%;
}

/* --------------------------------------------------------------------------
   Radio card options
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-radio-group {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	margin-bottom: 1.75rem;
}

.nim-intake-form .nim-radio-option {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.95rem 1.2rem;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	font-size: inherit;
	font-weight: 500;
	color: #374151;
	line-height: 1.45;
	transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
	user-select: none;
}

.nim-intake-form .nim-radio-option:hover {
	border-color: #F6A838;
	background-color: #fff8ed;
	color: #333333;
}

/* Custom radio circle */
.nim-intake-form .nim-radio-option input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	min-width: 20px;
	border: 2px solid #d1d5db;
	border-radius: 50%;
	background-color: #fff;
	cursor: pointer;
	transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
	position: relative;
	margin: 0;
}

.nim-intake-form .nim-radio-option input[type="radio"]:focus-visible {
	outline: 2px solid #F6A838;
	outline-offset: 2px;
}

/* Selected state — driven by JS class .nim-radio-option--selected */
.nim-intake-form .nim-radio-option--selected {
	border-color: #F6A838;
	background-color: #fff8ed;
	color: #1a1100;
}

.nim-intake-form .nim-radio-option--selected input[type="radio"] {
	border-color: #F6A838;
	background-color: #F6A838;
	box-shadow: inset 0 0 0 3px #fff;
}

/* --------------------------------------------------------------------------
   Contact / text fields
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-field-group {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1.75rem;
}

.nim-intake-form .nim-field-row {
	display: flex;
	gap: 1rem;
}

.nim-intake-form .nim-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	flex: 1;
	min-width: 0;
}

.nim-intake-form .nim-field label {
	font-size: inherit;
	font-weight: 600;
	color: #374151;
	cursor: pointer;
}

.nim-intake-form .nim-required {
	color: #dc2626;
	margin-left: 1px;
}

.nim-intake-form .nim-optional {
	font-weight: 400;
	color: #9ca3af;
	font-size: 16px;
}

.nim-intake-form .nim-field input,
.nim-intake-form .nim-field textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	font-size: inherit;
	font-family: inherit;
	color: #111827;
	background-color: #fff;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.nim-intake-form .nim-field input:focus,
.nim-intake-form .nim-field textarea:focus {
	outline: none;
	border-color: #F6A838;
	box-shadow: 0 0 0 3px rgba(246, 168, 56, 0.2);
}

.nim-intake-form .nim-field textarea {
	min-height: 130px;
	resize: vertical;
	line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-btn {
	display: inline-block;
	padding: 0.8rem 2rem;
	border: none;
	border-radius: 10px;
	font-size: inherit;
	font-weight: 600;
	font-family: 'Poppins', sans-serif;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.18s ease, opacity 0.18s ease, transform 0.1s ease;
}

.nim-intake-form .nim-btn--primary {
	background-color: #F6A838;
	color: #000000;
	border: 2px solid #F6A838;
}

.nim-intake-form .nim-btn--secondary {
	background-color: transparent;
	color: #6b7280;
	border: 2px solid #e5e7eb;
}

.nim-intake-form .nim-btn--secondary:hover:not(:disabled) {
	border-color: #9ca3af;
	color: #374151;
	background-color: #f9fafb;
}

.nim-intake-form .nim-btn-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.nim-intake-form .nim-btn--primary:hover:not(:disabled) {
	background-color: #e09420;
	border-color: #e09420;
}

.nim-intake-form .nim-btn--primary:active:not(:disabled) {
	transform: translateY(1px);
}

.nim-intake-form .nim-btn:disabled,
.nim-intake-form .nim-btn--loading {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Inline error message
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-error {
	display: none;
	background-color: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 8px;
	padding: 0.8rem 1rem;
	font-size: inherit;
	color: #991b1b;
	margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Outcome messages (post-submission)
   -------------------------------------------------------------------------- */
.nim-intake-form .nim-outcome {
	padding: 1rem 0 2rem;
}

.nim-intake-form .nim-outcome h2 {
	font-size: 1.9rem;
	font-weight: 800;
	line-height: 1.25;
	color: #111827;
	margin: 0 0 1.1rem;
}

.nim-intake-form .nim-outcome p {
	font-size: inherit;
	line-height: 1.75;
	color: #4b5563;
	margin: 0 0 1rem;
}

.nim-intake-form .nim-outcome ul {
	margin: 0.5rem 0 1.5rem 1.5rem;
	padding: 0;
	color: #4b5563;
	line-height: 1.85;
}

.nim-intake-form .nim-outcome ul li {
	margin-bottom: 0.35rem;
}

.nim-intake-form .nim-outcome .nim-btn--primary {
	margin-top: 0.75rem;
}

/* --------------------------------------------------------------------------
   Mobile responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.nim-intake-form .nim-field-row {
		flex-direction: column;
		gap: 1rem;
	}

	.nim-intake-form .nim-section-label {
		font-size: 22px;
	}

	.nim-intake-form .nim-outcome h2 {
		font-size: 1.45rem;
	}

	.nim-intake-form .nim-btn {
		display: block;
		width: 100%;
	}

	.nim-intake-form .nim-btn-row {
		flex-direction: column-reverse;
	}

	.nim-intake-form .nim-radio-option {
		font-size: inherit;
	}
}
