/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Long combined application: theme flex column on .single-job-application confuses height + footer flow */
.single-job-application.single-job-application--form-expanded,
body:has(#gild-form-combined):has(.single-job-application__form.apply-form-wrap.active) .single-job-application {
	display: block !important;
	overflow: visible;
	min-height: min-content;
}

/* inline-block on .apply-form-wrap.active can confuse sizing; use block for full flow height */
.single-job-application__form.apply-form-wrap.active,
.single-job-application.single-job-application--form-expanded .single-job-application__form.apply-form-wrap.active,
body:has(#gild-form-combined):has(.single-job-application__form.apply-form-wrap.active) .single-job-application__form.apply-form-wrap.active {
	display: block !important;
	width: 100%;
}

.layout-single-job-post-content.layout-single-job-post-content--form-expanded {
	overflow: visible;
}

/* Form stack must size to full content (submit/consent live outside .single-job-application-position) */
body.cig-gild-job-form-open #gild-form-combined,
body:has(#gild-form-combined):has(.single-job-application__form.apply-form-wrap.active) #gild-form-combined {
	display: block;
	min-height: fit-content;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
}

body.cig-gild-job-form-open #gild-form-combined .application-form.gild-form,
body:has(#gild-form-combined):has(.single-job-application__form.apply-form-wrap.active)
	#gild-form-combined
	.application-form.gild-form {
	display: block;
	min-height: fit-content;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
}

body.cig-gild-job-form-open .single-job-application__form.apply-form-wrap.active,
body:has(#gild-form-combined):has(.single-job-application__form.apply-form-wrap.active)
	.single-job-application__form.apply-form-wrap.active {
	min-height: fit-content;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
}

/*
 * Body is a flex column with footer { margin-top: auto }. Page-wrap must grow with the full form
 * (flex: none made the main region too short so the footer drew up under the submit band).
 */
body.cig-gild-job-form-open .page-wrap.cig-gild-page-wrap--job-form,
body.cig-gild-job-form-open .page-wrap.js-main[role="main"],
body:has(#gild-form-combined):has(.single-job-application__form.apply-form-wrap.active) .page-wrap.js-main[role="main"],
body:has(#gild-form-combined):has(.single-job-application__form.apply-form-wrap.active) .page-wrap:first-of-type {
	flex: 1 1 auto !important;
	flex-grow: 1 !important;
	flex-shrink: 0 !important;
	flex-basis: auto !important;
	align-self: stretch;
	min-height: fit-content !important;
	width: 100%;
	max-width: 100%;
	overflow: visible !important;
	height: auto !important;
	max-height: none !important;
}

.gild-processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gild-processing-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
}

.gild-processing-content i {
    color: #333;
    margin-bottom: 20px;
}

.gild-processing-content p {
    margin: 0;
    font-size: 18px;
    color: #333;
}

/*
 * Turnstile below submit: outer stack only; inner row matches theme (button + copy unchanged).
 */
#gild-form-combined .single-job-application-position__submit-inner-wrap {
	flex-direction: column;
	align-items: flex-start;
	row-gap: 1.5625rem;
	column-gap: 0;
}

#gild-form-combined .single-job-application-position__submit-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	row-gap: 1.5625rem;
}

@media screen and (min-width: 1024px) {
	#gild-form-combined .single-job-application-position__submit-actions {
		flex-direction: row;
		align-items: flex-start;
		column-gap: 3.375rem;
		row-gap: 0;
	}
}

#gild-form-combined .single-job-application-position__turnstile-wrap {
	width: 100%;
	max-width: 100%;
}

#gild-form-step-1 .single-job-application-resume__submit {
	flex-direction: column;
	align-items: flex-start;
	row-gap: 1.5625rem;
	column-gap: 0;
}

#gild-form-step-1 .single-job-application-resume__submit-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
}

@media screen and (min-width: 1024px) {
	#gild-form-step-1 .single-job-application-resume__submit-actions {
		flex-direction: row;
		align-items: center;
		column-gap: 4.3125rem;
		row-gap: 0;
	}
}

#gild-form-step-1 .single-job-application-resume__turnstile-wrap {
	width: 100%;
	max-width: 100%;
}

/* Custom Select Dropdown Styles */
.custom-select {
	position: relative;
	display: block;
}

.custom-select select {
	display: none; /* Hide the original select element */
}

.select-selected {
	background-color: #f5f5f5;
	position: relative;
	overflow: hidden;
	color: #1d3557;
	padding: 16px 24px 14px;
	cursor: pointer;
	height: 56px;
	user-select: none;
	text-decoration: none;
	display: block;
	margin-top: 8px;
	font-size: 16px;
	line-height: 24px;
}

.select-selected.select-error {
	border: 2px solid #dc3545;
	outline: 2px solid #dc3545;
}

/* Style the arrow inside the select element */
.select-selected::after {
	position: absolute;
	content: "";
	top: 50% !important;
	right: 24px;
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	transform: translateY(-50%);
	margin-top: 0;
}

/* Point the arrow upwards when the select box is open */
.select-selected.select-arrow-active::after {
	border-top: none;
	top: 0 !important;
}

/* Style the items (options) */
.select-items {
	position: absolute;
	background-color: #1d3557;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 99;
	padding-left: 0;
	margin: 0;
	list-style: none;
	max-height: 300px;
	overflow-y: auto;
}

.select-items li {
	color: #ffffff;
	padding: 14px 24px;
	cursor: pointer;
	user-select: none;
	text-decoration: none;
	display: block;
	font-size: 16px;
	line-height: 24px;
	border-right: 4px solid rgba(82, 100, 139, 0.34);
}

.select-items li:first-child {
	padding-top: 20px;
}

.select-items li:last-child {
	padding-bottom: 20px;
}

/* Hide the items when the select box is closed */
.select-hide {
	display: none;
}

/* Hover and selected states */
.select-items li:hover,
.select-items li.same-as-selected {
	background-color: rgba(82, 100, 139, 0.34);
	color: #d4af37;
}

/* Competing companies repeatable field group spacing */
#competing-companies-section  {
	margin-bottom: 1.25rem;
}

#competing-companies-section .field-group {
	margin-bottom: 1.25rem;
}

/* Hide delete button on first repeatable field while preserving layout space */
.repeatable-inputs .field-group:first-child .btn.delete {
	visibility: hidden;
}

.optional-links-inputs {
	margin-bottom: 1.25rem;
}

.optional-links {
	display: block !important;
}

/* Personal story textarea height */
#personal_story {
	height: 19.6875rem;
}

/* Disable validation border styling for competing companies section */
#competing-companies-section input:not(:focus):not(:placeholder-shown):invalid,
#competing-companies-section select:not(:focus):not(:placeholder-shown):invalid {
	border: 1px solid #d7d7d7 !important;
}

/* Office Location Validation: Disabled checkbox styling */
input[name="profile[other_office_locations][]"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

input[name="profile[other_office_locations][]"]:disabled + span {
	opacity: 0.5;
	cursor: not-allowed;
}

label:has(input[name="profile[other_office_locations][]"]:disabled) {
	cursor: not-allowed;
}

/* Optional links delete button positioning */
.btn.delete.btn--delete.optional-links-delete {
	position: absolute;
	right: 11px;
	top: 20px;
	z-index: 10;
}

.btn.btn--delete.delete.education-delete {
	position: absolute;
	right: 1px;
	top: -1px;
	z-index: 10;
}

/* Competing process delete button positioning */
.competing-process-delete {
	top: -10px !important;
}

@media screen and (min-width: 768px) {
	.btn.btn--delete.delete.education-delete  {
		right: -40px;
		top: 160px;
	}

	.btn.delete.btn--delete.optional-links-delete {
		right: -40px;
		top: 20px;
	}

	.competing-process-delete {
		top: 50px !important;
	}
}

.location-checkbox {
	padding-bottom: 10px;
}