/**
 * Application Form - Premium Styling
 * 
 * Maps all design elements to Nathan Hotel's styleguide tokens.
 */

/* 1. Page & Container Layout */
.application-form-page {
	padding-top: 66px;
	padding-bottom: 132px;
	box-sizing: border-box;
	min-height: min(calc(100vh - var(--height_header, 0px) - var(--height_footer, 0px)), 950px);
}


.application-form-title {
	font-family: var(--h1-font-family);
	font-weight: var(--h1-font-weight);
	font-size: var(--h1-font-size);
	line-height: var(--h1-line-height);
	letter-spacing: var(--h1-letter-spacing);
	text-transform: var(--h1-text-transform);
	color: var(--h1-color);
	text-align: center;
	margin: 0 0 50px 0;
}

.fake-form-wrapper {
	max-width: 840px;
	margin: 0 auto;
}

.fake-fields-container {
	background: var(--color-white);
	padding: 50px 50px 60px;
}

/* 2. Progress Indicator (Progress Bar with sliding wrapper) */
.app-progress-bar {
	position: relative;
	margin-bottom: 60px;
	padding: 0;
	--step-width: 339px;
}

/* Full width background line running through the center of dots */
.app-progress-bar::before {
	content: '';
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 100vw;
	height: 1px;
	background-color: var(--color-light-grey, #E1E1E1);
	bottom: 5px;
	z-index: 1;
	pointer-events: none;
}

@media only screen and (max-width: 1440px) {
	.app-progress-bar {
		--step-width: clamp(180px, 25vw - 80px, 339px);
	}
}

@media only screen and (max-width: 992px) {
	.app-progress-bar {
		--step-width: clamp(97px, 20vw - 40px, 180px);
	}
}

@media only screen and (max-width: 768px) {
	.app-progress-bar {
		margin-bottom: 40px;
		--step-width: 97px;
	}

	.app-progress-bar::before {
		bottom: 4px;
	}
}

.progress-steps-wrapper {
	position: relative;
	width: 100%;
}

.progress-steps-row {
	display: flex;
	justify-content: center;
	position: relative;
	z-index: 2;
	transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
	will-change: transform;
	align-items: end;
}

.progress-line-container {
	position: absolute;
	bottom: 5px;
	/* Aligns vertically with the center of the step-dot */
	left: calc(var(--step-width) / 2);
	right: calc(var(--step-width) / 2);
	height: 1px;
	z-index: 2;
	pointer-events: none;
}

.progress-line-bg {
	display: none;
}

.progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	flex: 0 0 var(--step-width);
	width: var(--step-width);
	min-width: var(--step-width);
	text-align: center;
	cursor: default;
}

.progress-step.active {
	cursor: pointer;
}

.progress-step .step-label {
	font-family: var(--h4-font-family);
	font-weight: var(--h4-font-weight);
	font-size: var(--h4-font-size);
	line-height: var(--h4-line-height);
	letter-spacing: var(--h4-letter-spacing);
	color: var(--h4-color);
	transition: color 0.3s ease, opacity 0.3s ease;
	margin: 0;
	display: block;
	width: 100%;
	text-align: center;
}

.progress-step .step-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--color-dark-brown);
	position: relative;
	transition: background-color 0.3s ease;
	z-index: 3;
}

.progress-step .step-dot-halo {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid var(--color-light-grey);
	transform: translate(-50%, -50%) scale(1);
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease;
	pointer-events: none;
	z-index: 2;
}

/* Progress Step Active & Current Statuses */
.progress-step.active .step-label {
	color: var(--color-black, #000000);
	opacity: 1;
}

.progress-step.active .step-dot {
	background-color: var(--color-orange);
}

/* Hover halo for active/clickable dots */
.progress-step.active:hover .step-dot-halo {
	transform: translate(-50%, -50%) scale(1.3);
	border-color: var(--color-orange, #E29C6B);
}

/* Halo of current step made more prominent */
.progress-step.current .step-dot-halo {
	transform: translate(-50%, -50%) scale(1.1);
}

/* 3. Form fields and typography */
.application-form {
	margin-bottom: 30px;
}

.application-form .form-column {
	/* Controlled by jQuery transition */
}

/* Hide redundancy column titles inside steps */
.application-form .column-title {
	display: none;
}

.application-form .form-group {
	margin-bottom: 30px;
	position: relative;
}

.application-form .nathan-input {
	width: 100%;
	border: none;
	border-bottom: 1px solid var(--color-mid-grey, #D9D9D9);
	background: transparent;
	padding: 14px 0;
	font-family: var(--font-lato);
	font-size: 15px;
	color: var(--color-black, #000000);
	outline: none;
	transition: border-color 0.3s ease;
	border-radius: 0;
	-webkit-appearance: none;
}

.application-form .nathan-input:focus,
.application-form .nathan-input.has-value {
	border-bottom-color: var(--color-light-brown, #A78873);
}

.application-form .nathan-input::placeholder {
	color: #7A7A7A;
	opacity: 0.7;
	font-family: var(--font-lato);
}

/* 4. Custom File Upload Styles */
.custom-file-upload-wrapper {
	margin-top: 15px;
}

.custom-file-upload-trigger {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--color-mid-grey, #D9D9D9);
	padding: 14px 0;
	cursor: pointer;
	transition: border-color 0.3s ease;
}

.custom-file-upload-trigger:hover,
.custom-file-upload-trigger.has-file {
	border-bottom-color: var(--color-light-brown, #A78873);
}

.custom-file-upload-trigger .file-name {
	font-family: var(--font-lato);
	font-size: 15px;
	color: #7A7A7A;
	transition: color 0.3s ease;
}

.custom-file-upload-trigger .file-name.file-selected {
	color: var(--color-light-brown, #A78873);
	font-weight: 500;
}

.custom-file-upload-trigger .upload-icon {
	color: var(--color-light-brown, #A78873);
	display: flex;
	align-items: center;
	transition: transform 0.3s ease;
}

.custom-file-upload-trigger:hover .upload-icon {
	transform: translateY(-2px);
}

/* Hide original CF7 file input */
.application-form input[type="file"].nathan-file-upload {
	display: none !important;
}

/* 5. Submit Action Button styling */
.form-submit-row,
.form-nav-row {
	display: flex;
	justify-content: center;
	margin-top: 50px;
}

.form-submit-row .wpcf7-submit,
.app-next-btn {
	cursor: pointer;
	outline: none;
}

.app-next-btn.is-loading {
	opacity: 0.7 !important;
	cursor: wait !important;
}

/* Hide standard response output for clean multi-step experience */
.application-form-wrapper .wpcf7-response-output {
	display: none !important;
}

/* Hide real CF7 form visual elements while keeping form serializable */
.application-form-wrapper .wpcf7-form {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Fake Form layout - JS controls display dynamically */
.fake-form-column {
	will-change: opacity, transform;
}

/* 6. Form validation error hints */
.wpcf7-not-valid {
	border-bottom-color: #ff3b30 !important;
}

.wpcf7-not-valid-tip {
	font-size: var(--btn-font-size) !important;
	margin-top: 6px !important;
	display: block !important;
	text-align: left !important;
}

.application-form .nathan-placeholder-label {
	top: 14px;
	bottom: auto;
	left: 0;
}

/* Autofill detection animation */
@keyframes onAutoFillStart {
	from {}
	to {}
}
@keyframes onAutoFillCancel {
	from {}
	to {}
}

.nathan-input-wrapper input:-webkit-autofill {
	animation-name: onAutoFillStart;
}
.nathan-input-wrapper input:not(:-webkit-autofill) {
	animation-name: onAutoFillCancel;
}

/* Hide simulated placeholder label immediately when input has value, is focused, or is autofilled */
.nathan-input-wrapper input:not(:placeholder-shown) + .nathan-placeholder-label,
.nathan-input-wrapper textarea:not(:placeholder-shown) + .nathan-placeholder-label,
.nathan-input-wrapper input:-webkit-autofill + .nathan-placeholder-label,
.nathan-input-wrapper input:autofill + .nathan-placeholder-label,
.nathan-input-wrapper.is-focused .nathan-placeholder-label,
.nathan-input-wrapper.has-value .nathan-placeholder-label {
	opacity: 0 !important;
	visibility: hidden !important;
}

.wpcf7-response-output {
	border: 1px solid var(--color-light-brown, #A78873) !important;
	border-radius: 4px !important;
	padding: 15px !important;
	margin: 30px 0 0 0 !important;
	font-size: 14px !important;
	text-align: center !important;
	color: var(--color-black, #000000) !important;
	background: #fff !important;
}

.wpcf7-mail-sent-ok {
	border-color: #4cd964 !important;
}

/* Spinner loader styles */
.wpcf7-spinner {
	margin: 0 0 0 10px !important;
	vertical-align: middle !important;
}

/* 7. Thank You step screen wrapper */
.application-thank-you {
	text-align: center;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	border-radius: 4px;
	box-sizing: border-box;
}

.thank-you-image img {
	max-width: 100px;
	height: auto;
	margin-bottom: 10px;
}

.thank-you-title {
	margin: 0 0 120px 0;
}

.thank-you-description {
	margin: 0;
}

.thank-you-description * {
	font-family: var(--h5-font-family);
	font-weight: var(--h5-font-weight);
	font-size: var(--h5-font-size);
	line-height: var(--h5-line-height);
	letter-spacing: var(--h5-letter-spacing);
	color: var(--color-black);
}

.thank-you-description a {
	color: var(--color-orange, #E29C6B) !important;
}

.thank-you-description a:hover {
	text-decoration: underline;
}

.thank-you-action {
	margin-top: 40px;
}

/* 8. Mobile Responsive Layout overrides */
@media only screen and (max-width: 767px) {
	.application-form-page {
		padding-top: 60px;
		padding-bottom: 120px;
	}

	.progress-steps-row {
		gap: 25px;
	}

	.fake-fields-container {
		padding: 30px 20px;
	}

	.application-form-title {
		font-family: var(--h2-font-family);
		font-weight: var(--h2-font-weight);
		font-size: var(--h2-font-size);
		line-height: var(--h2-line-height);
		letter-spacing: var(--h2-letter-spacing);
		text-transform: var(--h2-text-transform);
		margin-bottom: 55px;
	}

	.app-progress-bar {
		margin-bottom: 40px;
	}

	.progress-line-container {
		left: calc(var(--step-width) / 2);
		right: calc(var(--step-width) / 2);
		bottom: 4px;
	}

	.progress-step {
		gap: 20px;
		flex: 0 0 var(--step-width);
		width: var(--step-width);
		min-width: var(--step-width);
	}

	.progress-step .step-label {
		font-family: var(--body-font-family);
		font-weight: var(--body-font-weight);
		font-size: var(--body-font-size);
		line-height: var(--body-line-height);
		letter-spacing: var(--body-letter-spacing);
		word-break: keep-all;
	}

	.progress-step .step-dot {
		width: 8px;
		height: 8px;
	}

	.progress-step .step-dot-halo {
		width: 18px;
		height: 18px;
		transform: translate(-50%, -50%) scale(1);
	}

	.application-thank-you {
		padding: 40px 24px;
	}

	.thank-you-title {
		font-size: 28px;
		margin-bottom: 55px;
	}

	.thank-you-action {
		margin-top: 55px;
	}

	.form-nav-row {
		margin-top: 55px;
	}
}