/**
 * GD Pilots Manager — front-end form styles.
 *
 * Visual direction: aviation paperwork. Operational flight plans and
 * approach charts are dense, ruled and monochrome, with one signal colour
 * doing all the wayfinding. That's the logic here — quiet slate throughout,
 * chart magenta reserved for the current step, focus rings and the primary
 * action. Nothing else earns colour.
 */

/* ------------------------------------------------------------------ */
/* Fallback layer                                                      */
/*                                                                     */
/* Dark-only. Used only when no theme palette is present. Blocksy sets */
/* --theme-palette-color-* itself, so when it is active it drives the   */
/* form and these never apply. Without a theme palette the form still   */
/* renders on this dark scheme.                                         */
/* ------------------------------------------------------------------ */

:root {
	--gdp-fb-signal: #39a751;
	--gdp-fb-signal-hover: #45bc60;
	--gdp-fb-signal-ink: #ffffff;
	--gdp-fb-ink: #ffffff;
	--gdp-fb-body: #e6e6e6;
	--gdp-fb-muted: #9b9b9b;
	--gdp-fb-rule: #002e0a;
	--gdp-fb-rule-strong: #14431f;
	--gdp-fb-shade: #0f1a0e;
	--gdp-fb-surface: #0d140d;
	--gdp-fb-paper: #0a100a;
	--gdp-fb-danger: #f0938c;
	--gdp-fb-ok: #7fcb92;
}

.gdp-form {
	/*
	 * Fixed CDU-green scheme, matched to the single-listing (detail) page so
	 * the "Post a pilot job" form reads as the same product. Dark-only.
	 *
	 * The employer login / register / gate templates also carry .gdp-form, so
	 * they inherit this same scheme automatically. Employers → Colours (Custom
	 * mode) can still override these on the employer pages if ever needed.
	 */
	--gdp-signal: #39a751;        /* buttons, focus rings, current step  */
	--gdp-signal-hover: #45bc60;
	--gdp-signal-ink: #ffffff;    /* text on a filled accent button      */
	--gdp-ink: #ffffff;           /* labels and the strongest text       */
	--gdp-body: #e6e6e6;
	--gdp-muted: #9b9b9b;         /* hints, help text, optional tags     */
	--gdp-rule: #002e0a;          /* hairlines and dividers              */
	--gdp-rule-strong: #14431f;   /* field borders                       */
	--gdp-shade: #0f1a0e;         /* panels, consent box                 */
	--gdp-surface: #0d140d;       /* input fills                         */
	--gdp-paper: #0a100a;         /* quiet fills, term grid              */
	--gdp-danger: #f0938c;
	--gdp-ok: #7fcb92;

	--gdp-step: 0.35rem;
	--gdp-radius: 8px;
	--gdp-bwidth: 1px;
	--gdp-font: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	max-width: var(--gdp-maxw, 46rem);
	margin-inline: auto;
	padding-top: var(--gdp-pt, 0px);
	padding-bottom: var(--gdp-pb, 0px);
	color: var(--gdp-ink);
	font-family: var(--gdp-font, inherit);
	font-size: var(--gdp-fsize, 1rem);
	line-height: var(--gdp-lh, 1.55);
	background: var(--gdp-bg, transparent);
}

/* Primary action echoes the listing's "Apply now" button. */
.gdp-form .gdp-button--primary {
	border-radius: 11px;
	padding: 0.8rem 1.6rem;
	font-weight: 700;
}

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

/* ------------------------------------------------------------------ */
/* Step indicator                                                      */
/* ------------------------------------------------------------------ */

.gdp-steps {
	display: flex;
	gap: 0;
	margin: 0 0 2.75rem;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--gdp-rule);
}

.gdp-steps__item {
	display: flex;
	align-items: baseline;
	gap: 0.55rem;
	padding: 0 1.25rem 0.85rem 0;
	color: var(--gdp-muted);
	font-size: 0.9375rem;
}

.gdp-steps__num {
	display: inline-grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	flex: 0 0 auto;
	align-self: center;
	border: 1px solid var(--gdp-rule-strong);
	border-radius: 50%;
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.gdp-steps__item.is-current {
	color: var(--gdp-ink);
	font-weight: 600;
	box-shadow: inset 0 -2px 0 0 var(--gdp-signal);
}

.gdp-steps__item.is-current .gdp-steps__num {
	border-color: var(--gdp-signal);
	background: var(--gdp-signal);
	color: var(--gdp-signal-ink);
}

.gdp-steps__item.is-done .gdp-steps__num {
	border-color: var(--gdp-ink);
	background: var(--gdp-ink);
	color: var(--gdp-surface);
}

/* ------------------------------------------------------------------ */
/* Groups                                                              */
/* ------------------------------------------------------------------ */

.gdp-group {
	margin: 0 0 2.5rem;
	padding: 0;
	border: 0;
	border-top: 1px solid var(--gdp-rule);
}

.gdp-group:first-of-type {
	border-top: 0;
}

.gdp-group__title {
	padding: 0;
	margin: 0;
	font-size: var(--gdp-hsize, 1.0625rem);
	font-weight: var(--gdp-hweight, 600);
	letter-spacing: -0.008em;
}

.gdp-group__note {
	margin: 0.35rem 0 0;
	color: var(--gdp-muted);
	font-size: 0.9375rem;
}

.gdp-group__body {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 1.25rem;
	margin-top: 1.5rem;
}

/* Long-form fields take the full row. */
.gdp-field--textarea,
.gdp-field--editor,
.gdp-field--terms,
.gdp-field--checkbox,
.gdp-field--file {
	grid-column: 1 / -1;
}

/* ------------------------------------------------------------------ */
/* Fields                                                              */
/* ------------------------------------------------------------------ */

.gdp-field__label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.9375rem;
	font-weight: 600;
}

.gdp-field__optional {
	margin-left: 0.4rem;
	color: var(--gdp-muted);
	font-size: 0.8125rem;
	font-weight: 400;
	font-style: italic;
}

.gdp-field__help {
	margin: 0.4rem 0 0;
	color: #ccc;
	font-size: 0.875rem;
	line-height: 1.45;
}

.gdp-input {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: var(--gdp-bwidth, 1px) solid var(--gdp-rule-strong);
	border-radius: var(--gdp-radius);
	background: var(--gdp-surface);
	color: inherit;
	font: inherit;
	line-height: 1.4;
}

.gdp-input::placeholder {
	color: var(--gdp-muted);
	opacity: 0.75;
}

/* Job-title field carries a green border as a wayfinding cue. */
#gdp-listing_title.gdp-input {
	border-color: green;
}

.gdp-input:focus-visible,
.gdp-check input:focus-visible,
.gdp-chip input:focus-visible {
	outline: 2px solid var(--gdp-signal);
	outline-offset: 1px;
	border-color: var(--gdp-signal);
}

.gdp-textarea {
	resize: vertical;
	min-height: 6rem;
}

.gdp-select {
	appearance: none;
	padding-right: 2.2rem;
	background-image: linear-gradient(45deg, transparent 50%, var(--gdp-muted) 50%),
		linear-gradient(135deg, var(--gdp-muted) 50%, transparent 50%);
	background-position: calc(100% - 1.05rem) 55%, calc(100% - 0.75rem) 55%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

/* Numeric inputs read as data, so give them tabular figures. */
.gdp-input--numeric {
	font-variant-numeric: tabular-nums;
	max-width: 9rem;
}

.gdp-input--compact {
	max-width: 18rem;
	padding: 0.4rem 0.55rem;
	font-size: 0.9375rem;
}

.gdp-input-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.gdp-input-group__unit {
	color: var(--gdp-muted);
	font-size: 0.875rem;
}

.gdp-field__inline-add {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0.55rem 0 0;
	flex-wrap: wrap;
}

.gdp-field__inline-add label {
	color: var(--gdp-muted);
	font-size: 0.875rem;
}

/* ------------------------------------------------------------------ */
/* Checkbox                                                            */
/* ------------------------------------------------------------------ */

.gdp-check {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	cursor: pointer;
}

.gdp-check input {
	margin-top: 0.25rem;
	accent-color: var(--gdp-signal);
	width: 1rem;
	height: 1rem;
	flex: 0 0 auto;
}

.gdp-check__label {
	font-size: 0.9375rem;
	font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Term grid — aircraft types and other long taxonomies                */
/* ------------------------------------------------------------------ */

.gdp-termgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: 1.25rem 1.5rem;
	padding: 1.1rem 1.15rem;
	border: var(--gdp-bwidth, 1px) solid var(--gdp-rule);
	border-radius: var(--gdp-radius);
	background: var(--gdp-paper);
}

.gdp-termgrid__heading {
	margin: 0 0 0.55rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--gdp-rule);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: -0.005em;
}

.gdp-termgrid__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.gdp-chip {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9375rem;
	cursor: pointer;
}

.gdp-chip input {
	accent-color: var(--gdp-signal);
	width: 0.95rem;
	height: 0.95rem;
	flex: 0 0 auto;
}

.gdp-chip:hover span {
	color: var(--gdp-signal);
}

/* ------------------------------------------------------------------ */
/* File field                                                          */
/* ------------------------------------------------------------------ */

.gdp-file-input {
	display: block;
	width: 100%;
	font-size: 0.9375rem;
}

.gdp-file-preview {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin-bottom: 0.7rem;
}

.gdp-file-preview img {
	width: 3.5rem;
	height: 3.5rem;
	object-fit: contain;
	border: 1px solid var(--gdp-rule);
	border-radius: var(--gdp-radius);
	background: var(--gdp-surface);
	padding: 0.25rem;
}

.gdp-file-preview__clear {
	border: 0;
	background: none;
	padding: 0;
	color: var(--gdp-danger);
	font: inherit;
	font-size: 0.875rem;
	text-decoration: underline;
	cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Actions                                                             */
/* ------------------------------------------------------------------ */

.gdp-form__actions {
	margin-top: 2.25rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--gdp-rule);
}

.gdp-form__actions--split {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.gdp-form__hint {
	margin: 0.75rem 0 0;
	color: var(--gdp-muted);
	font-size: 0.875rem;
}

.gdp-button {
	display: inline-block;
	padding: 0.7rem 1.4rem;
	border: 1px solid transparent;
	border-radius: var(--gdp-radius);
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
}

.gdp-button--primary {
	background: var(--gdp-signal);
	color: var(--gdp-signal-ink);
}

.gdp-button--primary:hover,
.gdp-button--primary:focus {
	background: var(--gdp-signal-hover);
	color: var(--gdp-signal-ink);
}

.gdp-button--ghost {
	background: transparent;
	border-color: var(--gdp-rule-strong);
	color: var(--gdp-ink);
}

.gdp-button--ghost:hover {
	border-color: var(--gdp-ink);
}

.gdp-button:focus-visible {
	outline: 2px solid var(--gdp-ink);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Notices                                                             */
/* ------------------------------------------------------------------ */

.gdp-notice {
	margin: 0 auto 1.5rem;
	max-width: 46rem;
	padding: 0.85rem 1rem;
	border-left: 3px solid;
	border-radius: 0 var(--gdp-radius) var(--gdp-radius) 0;
	font-size: 0.9375rem;
}

.gdp-notice--error {
	border-color: #a8261f;
	background: #fdf2f1;
	color: #7d1c17;
}

.gdp-notice--success {
	border-color: #1c6b4a;
	background: #f0f8f4;
	color: #14513a;
}

/* ------------------------------------------------------------------ */
/* Preview                                                             */
/* ------------------------------------------------------------------ */

.gdp-preview__intro {
	margin: 0 0 1.5rem;
	color: var(--gdp-muted);
	font-size: 0.9375rem;
}

.gdp-listing {
	border: 1px solid var(--gdp-rule);
	border-radius: var(--gdp-radius);
	background: var(--gdp-surface);
	overflow: hidden;
}

.gdp-listing__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.5rem;
	border-bottom: 1px solid var(--gdp-rule);
}

.gdp-listing__logo {
	width: 3.5rem;
	height: 3.5rem;
	flex: 0 0 auto;
	object-fit: contain;
}

.gdp-listing__title {
	margin: 0;
	font-size: 1.375rem;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.gdp-listing__operator {
	margin: 0.3rem 0 0;
	color: var(--gdp-muted);
	font-size: 0.9375rem;
}

.gdp-listing__base::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 0.85em;
	margin: 0 0.6rem;
	background: var(--gdp-rule-strong);
	vertical-align: -0.05em;
}

.gdp-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 1rem 1.5rem;
	list-style: none;
	background: var(--gdp-shade);
	border-bottom: 1px solid var(--gdp-rule);
}

.gdp-badge {
	padding: 0.2rem 0.6rem;
	border: 1px solid var(--gdp-rule-strong);
	border-radius: 2px;
	background: var(--gdp-surface);
	font-size: 0.8125rem;
}

.gdp-listing__body {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
	gap: 2rem;
	padding: 1.75rem 1.5rem;
}

.gdp-listing__content h3 {
	margin: 1.5rem 0 0.5rem;
	font-size: 1.0625rem;
}

.gdp-listing__content h3:first-child {
	margin-top: 0;
}

.gdp-listing__content p {
	margin: 0 0 0.9rem;
	max-width: 68ch;
}

.gdp-listing__package {
	margin: 0;
	padding-left: 1.1rem;
}

.gdp-listing__package li {
	margin-bottom: 0.35rem;
}

.gdp-listing__spec-title {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	font-weight: 700;
}

.gdp-spec {
	margin: 0;
	border-top: 1px solid var(--gdp-rule);
}

.gdp-spec__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--gdp-rule);
	font-size: 0.9375rem;
}

.gdp-spec dt {
	color: var(--gdp-muted);
}

.gdp-spec dd {
	margin: 0;
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.gdp-spec__special {
	margin-top: 1rem;
}

.gdp-spec__special-label {
	margin: 0 0 0.4rem;
	color: var(--gdp-signal);
	font-weight: 700;
	font-size: 0.9375rem;
}

.gdp-spec__special-text {
	margin: 0;
	color: var(--gdp-ink);
	font-weight: 700;
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Done                                                                */
/* ------------------------------------------------------------------ */

.gdp-done {
	padding: 2.5rem 0 1rem;
	border-left: 3px solid var(--gdp-signal);
	padding-left: 1.5rem;
}

.gdp-done__title {
	margin: 0 0 0.6rem;
	font-size: 1.5rem;
	letter-spacing: -0.015em;
}

.gdp-done__body {
	margin: 0 0 1.5rem;
	max-width: 52ch;
	color: var(--gdp-muted);
}

.gdp-done__secondary {
	margin: 1.25rem 0 0;
	font-size: 0.9375rem;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 40rem) {
	.gdp-group__body,
	.gdp-listing__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.gdp-steps {
		flex-wrap: wrap;
	}

	.gdp-steps__label {
		font-size: 0.875rem;
	}

	.gdp-form__actions--split {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.gdp-spec__row {
		flex-direction: column;
		gap: 0.1rem;
	}

	.gdp-spec dd {
		text-align: left;
	}
}

/* ------------------------------------------------------------------ */
/* Notices in dark surroundings                                        */
/*                                                                     */
/* These two keep their own values in both schemes: an error must stay */
/* legible as an error regardless of what the theme palette does.      */
/* ------------------------------------------------------------------ */

@media (prefers-color-scheme: dark) {
	.gdp-notice--error {
		background: #2b1a1a;
		color: #f0b5b0;
	}

	.gdp-notice--success {
		background: #16241d;
		color: #a7d9c1;
	}

}

@media (prefers-reduced-motion: reduce) {
	.gdp-form * {
		transition: none !important;
		animation: none !important;
	}
}

/* ------------------------------------------------------------------ */
/* Field error state                                                   */
/* ------------------------------------------------------------------ */

.gdp-field.has-error .gdp-input,
.gdp-field.has-error .gdp-termgrid,
.gdp-field.has-error .wp-editor-container {
	border-color: var(--gdp-danger);
	box-shadow: inset 3px 0 0 0 var(--gdp-danger);
}

.gdp-field.has-error .gdp-field__label {
	color: var(--gdp-danger);
}

.gdp-field__error {
	margin: 0.4rem 0 0;
	color: var(--gdp-danger);
	font-size: 0.875rem;
	font-weight: 600;
}
