/*
 * Startup Nest Core — form structure.
 *
 * Structural CSS only: layout of the multi-step wrapper, breadcrumbs, fields,
 * the compound phone control, choice lists, notices, the spinner, the invalid
 * state and the responsive stacking. Every brand colour is read from a CSS
 * custom property with the legacy value as the fallback, so the forms still
 * look right when the theme is not active.
 *
 * Measurements are transcribed from applicationpage.php and partner-form.php.
 */

/* ==========================================================================
   Form shell
   ========================================================================== */

.snc-form {
	--snc-primary: var( --sn-primary, #864622 );
	--snc-primary-dark: var( --sn-primary-dark, #6e381d );
	--snc-surface: var( --sn-surface, #ffffff );
	--snc-border: var( --sn-border, #e6e6e6 );
	--snc-ink: var( --sn-ink, #333333 );
	--snc-muted: var( --sn-muted, #666666 );
	--snc-radius: var( --sn-radius, 12px );

	box-sizing: border-box;
	display: block;
	width: 100%;
	color: var( --snc-ink );
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
}

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

.snc-form__form {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 0;
}

/* ==========================================================================
   Steps
   ========================================================================== */

.snc-step {
	display: none;
	flex-direction: column;
	gap: 12px;
	padding-bottom: 22px;
	border-bottom: 1px solid var( --snc-border );
}

.snc-step.is-active {
	display: flex;
}

.snc-step:last-of-type {
	border-bottom: none;
	padding-bottom: 0;
}

.snc-step__title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
	color: var( --snc-primary );
}

.snc-section-title {
	margin: 10px 0;
	font-size: 15px;
	line-height: 1.4;
	font-weight: 700;
	color: var( --snc-primary );
}

/* Partner form section rules mirror partner-form.php's .section-title. */
.snc-form--partner .snc-section-title {
	margin-top: 30px;
	padding-bottom: 5px;
	border-bottom: 2px solid var( --sn-border, #eeeeee );
	color: var( --snc-primary-dark, #6f3a1d );
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.snc-crumbs {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 20px 0 30px;
	padding: 0;
	list-style: none;
}

.snc-crumbs::before {
	content: "";
	position: absolute;
	top: 19px;
	left: 10%;
	right: 10%;
	height: 2px;
	background: #dddddd;
	z-index: 0;
}

.snc-crumb {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1 1 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.snc-crumb__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-bottom: 6px;
	border-radius: 50%;
	background: #dddddd;
	color: var( --snc-muted );
	font-size: 15px;
	font-weight: 600;
	transition: background .3s ease, color .3s ease;
}

.snc-crumb__label {
	font-size: 13px;
	color: #777777;
	text-align: center;
}

.snc-crumb.is-active .snc-crumb__dot,
.snc-crumb.is-complete .snc-crumb__dot {
	background: var( --snc-primary );
	color: #ffffff;
}

.snc-crumb.is-complete .snc-crumb__dot {
	font-size: 0;
}

.snc-crumb.is-complete .snc-crumb__dot::after {
	content: "\2713";
	font-size: 18px;
}

/* ==========================================================================
   Fields
   ========================================================================== */

.snc-field {
	width: 100%;
	margin: 0 0 14px;
}

.snc-field__group {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.snc-field__label {
	display: block;
	width: 100%;
	margin: 0 0 6px;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.45;
	color: var( --snc-muted );
}

.snc-field__required {
	color: var( --snc-primary );
}

.snc-field__help {
	display: block;
	margin: -2px 0 6px;
	font-size: 12px;
	line-height: 1.5;
	color: #777777;
}

.snc-field__error {
	display: none;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #a94442;
}

.snc-field.snc-invalid .snc-field__error {
	display: block;
}

.snc-hidden {
	display: none;
}

/* ==========================================================================
   Controls
   ========================================================================== */

.snc-input,
.snc-select,
.snc-textarea,
.snc-file {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 12px 14px;
	border: 1px solid var( --snc-border );
	border-radius: 10px;
	background: var( --snc-surface );
	color: var( --snc-ink );
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.snc-textarea {
	min-height: 120px;
	resize: vertical;
}

.snc-file {
	padding: 10px 12px;
}

.snc-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 34px;
	background-image:
		linear-gradient( 45deg, transparent 50%, var( --snc-primary ) 50% ),
		linear-gradient( 135deg, var( --snc-primary ) 50%, transparent 50% );
	background-position:
		calc( 100% - 18px ) center,
		calc( 100% - 13px ) center;
	background-size: 5px 5px;
	background-repeat: no-repeat;
}

.snc-input:focus,
.snc-select:focus,
.snc-textarea:focus,
.snc-file:focus {
	border-color: var( --snc-primary );
	box-shadow: 0 0 0 3px rgba( 134, 70, 34, .12 );
	outline: none;
}

.snc-input.snc-invalid,
.snc-select.snc-invalid,
.snc-textarea.snc-invalid,
.snc-file.snc-invalid {
	border-color: #d63638;
	box-shadow: 0 0 0 3px rgba( 214, 54, 56, .12 );
}

/* ==========================================================================
   Compound phone control
   ========================================================================== */

.snc-phone {
	display: flex;
	gap: 10px;
	align-items: stretch;
	width: 100%;
}

.snc-phone__code {
	flex: 0 0 auto;
	width: 40%;
	max-width: 250px;
}

.snc-phone__number {
	flex: 1 1 auto;
	min-width: 0;
}

/* ==========================================================================
   Radio and checkbox lists
   ========================================================================== */

.snc-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 10px;
}

.snc-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: var( --snc-ink );
	text-align: left;
	cursor: pointer;
}

.snc-option__label {
	flex: 1 1 auto;
	word-break: break-word;
}

.snc-radio,
.snc-checkbox {
	position: relative;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
	border: 2px solid var( --snc-primary );
	border-radius: 4px;
	background: var( --snc-surface );
	cursor: pointer;
}

.snc-radio {
	border-radius: 50%;
}

.snc-radio:checked,
.snc-checkbox:checked {
	background-color: var( --snc-primary );
	border-color: var( --snc-primary );
}

.snc-checkbox:checked::after {
	content: "\2714";
	position: absolute;
	top: -2px;
	left: 2px;
	color: #ffffff;
	font-size: 12px;
	line-height: 1;
}

.snc-radio:checked::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ffffff;
}

.snc-radio:focus-visible,
.snc-checkbox:focus-visible {
	outline: 2px solid var( --snc-primary );
	outline-offset: 2px;
}

/* ==========================================================================
   Actions and buttons
   ========================================================================== */

.snc-actions {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 25px;
}

.snc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 140px;
	padding: 14px 18px;
	border: none;
	border-radius: var( --snc-radius );
	background: var( --snc-primary );
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: opacity .2s ease, transform .2s ease, background .2s ease;
}

.snc-btn:hover,
.snc-btn:focus {
	background: var( --snc-primary-dark );
	opacity: .95;
}

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

.snc-btn--prev {
	background: #999999;
}

.snc-btn--prev:hover,
.snc-btn--prev:focus {
	background: #838383;
}

.snc-btn--submit {
	flex: 1 1 auto;
	max-width: 100%;
}

.snc-form--partner .snc-btn--submit,
.snc-form--newsletter .snc-btn--submit {
	width: 100%;
}

.snc-btn[disabled],
.snc-btn.is-loading {
	opacity: .8;
	cursor: default;
	pointer-events: none;
}

/* ==========================================================================
   Spinner
   ========================================================================== */

.snc-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-top-color: transparent;
	border-radius: 50%;
	vertical-align: middle;
}

.snc-btn.is-loading .snc-spinner {
	display: inline-block;
	animation: snc-spin .8s linear infinite;
}

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

@media ( prefers-reduced-motion: reduce ) {
	.snc-btn.is-loading .snc-spinner {
		animation-duration: 2.4s;
	}

	.snc-btn,
	.snc-crumb__dot,
	.snc-input,
	.snc-select,
	.snc-textarea {
		transition: none;
	}
}

/* ==========================================================================
   Notices
   ========================================================================== */

.snc-notice {
	margin: 0 0 20px;
	padding: 16px 18px;
	border-radius: 8px;
	font-size: 15px;
	line-height: 1.5;
}

.snc-notice--success {
	background: #e8f8e4;
	border: 1px solid #b4ebb0;
	color: #206520;
}

.snc-notice--error {
	background: #ffeaea;
	border: 1px solid #f5c6cb;
	color: #a94442;
}

.snc-notice[hidden] {
	display: none;
}

/* `.snc-form__form` and `.snc-crumbs` both declare `display: flex`, which beats
   the user-agent `[hidden]` rule; the success panel hides them via the `hidden`
   property, so restate it here. */
.snc-form__form[hidden],
.snc-crumbs[hidden] {
	display: none;
}

/* ==========================================================================
   Success panel (AJAX forms)
   ========================================================================== */

.snc-success {
	padding: 60px 20px;
	text-align: center;
}

.snc-success__title {
	margin: 0 0 20px;
	font-family: var( --sn-font-display, inherit );
	font-size: 32px;
	line-height: 1.25;
	color: var( --snc-primary );
}

.snc-success__body {
	margin: 0 0 20px;
	font-size: 18px;
	line-height: 1.7;
	color: #555555;
}

.snc-success__note {
	display: inline-block;
	margin: 0;
	padding: 10px 14px;
	border-left: 4px solid var( --snc-primary );
	border-radius: 6px;
	background: #fff3ed;
	color: var( --snc-primary );
	font-weight: 700;
	text-align: left;
}

.snc-success__again {
	margin-top: 35px;
}

/* ==========================================================================
   Applications-closed panel
   ========================================================================== */

.snc-maintenance {
	max-width: 800px;
	margin: 0 auto;
	padding: 60px;
	border-radius: 20px;
	background: var( --snc-surface );
	box-shadow: 0 10px 40px rgba( 0, 0, 0, .08 );
	text-align: center;
}

.snc-maintenance__icon {
	margin-bottom: 20px;
	font-size: 70px;
	line-height: 1;
}

.snc-maintenance__title {
	margin: 0 0 25px;
	font-size: 32px;
	line-height: 1.25;
	color: var( --snc-primary );
}

.snc-maintenance__text {
	margin: 0 0 20px;
	font-size: 18px;
	line-height: 1.8;
	color: #64748b;
}

.snc-maintenance__note {
	display: inline-block;
	margin: 0;
	padding: 12px 25px;
	border-radius: 30px;
	background: #fff4eb;
	color: var( --snc-primary );
	font-weight: 600;
}

/* ==========================================================================
   Partners / services / FAQ shortcodes
   ========================================================================== */

.snc-partners {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	align-items: center;
	justify-content: center;
}

.snc-partner {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 20px;
	border-radius: 12px;
	background: var( --sn-surface, #ffffff );
	box-shadow: 0 6px 18px rgba( 0, 0, 0, .08 );
	transition: transform .3s ease, box-shadow .3s ease;
}

.snc-partner:hover {
	transform: scale( 1.05 );
	box-shadow: 0 10px 28px rgba( 0, 0, 0, .15 );
}

.snc-partner__link {
	display: block;
	line-height: 0;
}

.snc-partner__logo {
	display: block;
	max-width: 100%;
	max-height: 50px;
	height: auto;
	width: auto;
}

.snc-services {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 240px, 1fr ) );
	gap: 24px;
	align-items: stretch;
}

.snc-service {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 32px 24px;
	border-radius: 12px;
	background: var( --sn-surface, #ffffff );
	box-shadow: 0 4px 14px rgba( 0, 0, 0, .08 );
}

.snc-service__icon {
	width: 56px;
	height: 56px;
	object-fit: contain;
}

.snc-service__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	color: var( --sn-primary, #864622 );
}

.snc-service__list {
	margin: 0;
	padding-left: 20px;
	font-size: 15px;
	line-height: 1.5;
	color: var( --sn-muted, #555555 );
}

.snc-service__list li + li {
	margin-top: 8px;
}

.snc-faqs {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.snc-faq {
	padding: 28px 32px;
	border-radius: 12px;
	background: var( --sn-surface, #ffffff );
	box-shadow: 0 4px 14px rgba( 0, 0, 0, .08 );
}

.snc-faq__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.snc-faq__title {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.35;
	color: var( --sn-footer, #844521 );
}

.snc-faq__toggle {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: #f5f5f5;
	color: var( --sn-ink, #383331 );
	font-size: 22px;
	line-height: 1;
}

.snc-faq__body {
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.45;
	color: var( --sn-muted, #555555 );
}

.snc-faq__body[hidden] {
	display: none;
}

.snc-faq__body p:first-child {
	margin-top: 0;
}

.snc-faq__body p:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media ( max-width: 768px ) {

	.snc-crumbs {
		margin: 16px 0 24px;
	}

	.snc-crumbs::before {
		top: 15px;
		left: 16%;
		right: 16%;
	}

	.snc-crumb__dot {
		width: 30px;
		height: 30px;
		font-size: 13px;
	}

	.snc-crumb__label {
		font-size: 11px;
	}

	.snc-step__title {
		font-size: 18px;
	}

	.snc-actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.snc-btn {
		width: 100%;
		min-width: 0;
	}

	/* Legacy applicationpage.php mobile phone-row rules. */
	.snc-phone__code {
		width: 110px;
		flex: 0 0 110px;
		font-size: 13px;
	}

	.snc-phone__number {
		font-size: 14px;
	}

	.snc-partners {
		gap: 18px;
	}

	.snc-services {
		grid-template-columns: 1fr;
	}

	.snc-faq {
		padding: 20px;
	}

	.snc-faq__title {
		font-size: 18px;
	}

	.snc-faq__toggle {
		width: 30px;
		height: 30px;
		font-size: 20px;
	}

	.snc-maintenance {
		padding: 40px 25px;
	}

	.snc-maintenance__title {
		font-size: 24px;
	}

	.snc-maintenance__text {
		font-size: 16px;
	}

	.snc-success {
		padding: 40px 16px;
	}

	.snc-success__title {
		font-size: 24px;
	}

	.snc-success__body {
		font-size: 16px;
	}
}

@media ( max-width: 480px ) {

	.snc-crumb__label {
		font-size: 10px;
	}

	.snc-phone {
		flex-wrap: wrap;
	}

	.snc-phone__code {
		width: 100%;
		flex: 1 1 100%;
		max-width: none;
	}

	.snc-phone__number {
		flex: 1 1 100%;
	}
}
