/**
 * The submission and account forms.
 *
 * GeoDirectory builds these from AyeCode UI, which is Bootstrap: horizontal
 * rows of `col-sm-2` label beside `col-sm-10` field, default form controls, and
 * Bootstrap's own blue. Left alone that is white inputs on a white card on a
 * white page — forty rows of it, with nothing to say which listing type you are
 * filling in or what happens when you submit.
 *
 * The page is therefore built as three layers: a tinted canvas, a coloured
 * header (printed by inc/add-listing-form.php on GeoDirectory's own
 * `geodir_before_add_listing_form` hook), and the form itself as a white card
 * standing on the tint.
 *
 * THIS FILE CHANGES ONLY APPEARANCE.
 * The markup, the field names, the validation attributes, the nonces and the
 * JavaScript hooks are GeoDirectory's and are untouched — nothing here renames
 * a class the plugin's own scripts bind to, and no rule hides an input. The
 * layout change is done by overriding the Bootstrap column widths, not by
 * moving any element.
 */

/* ==========================================================================
   Page shell
   ========================================================================== */

.geodir-add-listing,
.geodir-login-form-wrap {
	--gcn-form-width: 1040px;
}

/*
 * The theme's content column is 1100px, which the form now nearly fills. On the
 * submission page it is widened a little further so the card is not squeezed
 * against its own gutters.
 */
body.geodir-page-add #brx-content.wordpress {
	width: 1160px;
	/* See gcn-profile.css: the theme's max-width is a pixel value, not 100%. */
	max-width: 100%;
}

/*
 * The canvas.
 *
 * body carries `geodir-page-add` on the submission page, so the tint is scoped
 * to it and no other page changes. The glow is a fixed layer rather than a
 * background on #brx-content, which is only as tall as its content and would
 * leave the tint stopping mid-page on a short step.
 */
body.geodir-page-add {
	background: var(--gcn-surface-sunken);
}

body.geodir-page-add::before {
	content: "";
	position: fixed;
	inset: 0 0 auto;
	height: 620px;
	background:
		radial-gradient(90% 120% at 15% 0%, hsl(168 55% 92% / 0.85) 0%, transparent 60%),
		radial-gradient(70% 100% at 95% 0%, hsl(38 70% 93% / 0.55) 0%, transparent 55%);
	pointer-events: none;
	z-index: 0;
}

body.geodir-page-add #brx-content {
	position: relative;
	z-index: 1;
	padding-bottom: var(--gcn-space-20);
}

/*
 * The theme reserves 120px above the content for a sticky header
 * (`.brx-sticky + article { padding-top: var(--section-space-m) !important }`).
 * The GCN header is `position: relative` — it scrolls away rather than
 * overlaying — so on this page that is 120px of empty tint before the reader
 * meets the title. The !important is answering the theme's own !important, not
 * winning an argument with a plain rule.
 *
 * If the header is ever switched to overlay/fixed, put this back to 120px.
 */
body.geodir-page-add #brx-content {
	padding-top: var(--gcn-space-12) !important;
}

.geodir-add-listing {
	max-width: var(--gcn-form-width);
	margin: 0 auto var(--gcn-space-16);
}

/*
 * The page heading comes from the theme, above the form. Given room it reads as
 * the title of the task rather than as another line of the form.
 */
.geodir-page #brx-content > h1,
.page #brx-content > h1 {
	max-width: var(--gcn-form-width, 880px);
	margin: var(--gcn-space-16) auto var(--gcn-space-6);
	font-size: var(--gcn-text-3xl);
	font-weight: var(--gcn-weight-bold);
	letter-spacing: var(--gcn-tracking-tight);
	line-height: var(--gcn-leading-tight);
	color: var(--gcn-text);
}

body.geodir-page-add #brx-content > h1 {
	margin: var(--gcn-space-6) auto var(--gcn-space-5);
}

/*
 * wpautop runs over the shortcode output and leaves stray <br> and empty <p>
 * between the hidden inputs, which push the first visible field down by
 * something like 150px. Hidden, not removed: the elements are GeoDirectory's.
 */
.geodir-add-listing form > br,
.geodir-add-listing form > p:empty,
.geodir-add-listing [data-argument] > p:empty,
.geodir-add-listing .input-group > p:empty {
	display: none;
}

/* ==========================================================================
   The header above the form
   ==========================================================================
   Printed by inc/add-listing-form.php. It carries the colour on this page: the
   form below it is deliberately quiet, so the one saturated block is the one
   that says what you are filling in.
   ========================================================================== */

/*
 * wpautop runs over the shortcode output and inserts <br> between the header's
 * elements, including inside the pill. Hidden rather than fought upstream: the
 * markup is the theme's, but the filter is applied to the whole page.
 */
.gcn-formhead br,
.gcn-formhead p:empty {
	display: none;
}

.gcn-formhead {
	margin-bottom: var(--gcn-space-5);
	padding: var(--gcn-space-6) var(--gcn-space-8);
	color: var(--gcn-text-inverse);
	background:
		radial-gradient(120% 180% at 100% 0%, hsl(168 45% 30% / 0.55) 0%, transparent 60%),
		linear-gradient(115deg, var(--gcn-brand-strong) 0%, #0b4f45 55%, #10333c 100%);
	border-radius: var(--gcn-radius-lg);
	box-shadow: var(--gcn-shadow-md);
}

.gcn-formhead__main {
	display: flex;
	align-items: center;
	gap: var(--gcn-space-4);
}

.gcn-formhead__icon {
	flex: 0 0 auto;
	width: 3rem;
	height: 3rem;
	background: hsl(0 0% 100% / 0.14);
	border: 1px solid hsl(0 0% 100% / 0.18);
	border-radius: var(--gcn-radius-md);
}

/* The icon itself, masked from the token set so it takes the text colour. */
.gcn-formhead__icon::after {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background: currentColor;
	-webkit-mask: var(--gcn-formhead-icon, var(--gcn-icon-info)) center / 1.4rem no-repeat;
	mask: var(--gcn-formhead-icon, var(--gcn-icon-info)) center / 1.4rem no-repeat;
}

.gcn-formhead__icon[data-icon="pin"]       { --gcn-formhead-icon: var(--gcn-icon-pin); }
.gcn-formhead__icon[data-icon="layers"]    { --gcn-formhead-icon: var(--gcn-icon-layers); }
.gcn-formhead__icon[data-icon="clock"]     { --gcn-formhead-icon: var(--gcn-icon-clock); }
.gcn-formhead__icon[data-icon="tag"]       { --gcn-formhead-icon: var(--gcn-icon-tag); }
.gcn-formhead__icon[data-icon="arrow-in"]  { --gcn-formhead-icon: var(--gcn-icon-arrow-in); }
.gcn-formhead__icon[data-icon="users"]     { --gcn-formhead-icon: var(--gcn-icon-users); }
.gcn-formhead__icon[data-icon="user"]      { --gcn-formhead-icon: var(--gcn-icon-user); }

.gcn-formhead__text {
	flex: 1 1 auto;
	min-width: 0;
}

.gcn-formhead__eyebrow {
	margin: 0;
	font-size: var(--gcn-text-2xs);
	font-weight: var(--gcn-weight-semibold);
	letter-spacing: var(--gcn-tracking-wide);
	text-transform: uppercase;
	color: hsl(0 0% 100% / 0.62);
}

.gcn-formhead__title {
	margin: 0.15em 0 0;
	font-size: var(--gcn-text-xl);
	font-weight: var(--gcn-weight-semibold);
	letter-spacing: var(--gcn-tracking-tight);
	color: var(--gcn-text-inverse);
}

.gcn-formhead__blurb {
	margin: 0.2em 0 0;
	font-size: var(--gcn-text-sm);
	line-height: var(--gcn-leading-normal);
	color: hsl(0 0% 100% / 0.72);
}

.gcn-formhead__switch {
	flex: 0 0 auto;
	align-self: center;
	padding: 0.55em 1.1em;
	white-space: nowrap;
	font-size: var(--gcn-text-sm);
	font-weight: var(--gcn-weight-medium);
	color: var(--gcn-text-inverse);
	text-decoration: none;
	background: hsl(0 0% 100% / 0.12);
	border: 1px solid hsl(0 0% 100% / 0.24);
	border-radius: var(--gcn-radius-pill);
	transition: background var(--gcn-duration) var(--gcn-ease);
}

.gcn-formhead__switch:hover,
.gcn-formhead__switch:focus-visible {
	color: var(--gcn-text-inverse);
	background: hsl(0 0% 100% / 0.22);
}

.gcn-formhead__notes {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gcn-space-2) var(--gcn-space-6);
	margin: var(--gcn-space-5) 0 0;
	padding: var(--gcn-space-4) 0 0;
	list-style: none;
	border-top: 1px solid hsl(0 0% 100% / 0.14);
}

.gcn-formhead__notes li {
	display: flex;
	align-items: flex-start;
	gap: var(--gcn-space-2);
	font-size: var(--gcn-text-sm);
	line-height: var(--gcn-leading-snug);
	color: hsl(0 0% 100% / 0.78);
}

.gcn-formhead__notes li::before {
	content: "";
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	margin-top: 0.2em;
	background: hsl(168 60% 72%);
	-webkit-mask: var(--gcn-icon-tick) center / contain no-repeat;
	mask: var(--gcn-icon-tick) center / contain no-repeat;
}

/*
 * The notice a Restricted User meets instead of the form.
 *
 * It replaces GeoDirectory's whole widget, so the .geodir-add-listing wrapper
 * that centres and limits the form is not there to inherit from — the width has
 * to be restated or the panel runs the full width of the page.
 */
.gcn-formhead--closed {
	max-width: var(--gcn-form-width, 880px);
	margin: 0 auto var(--gcn-space-20);
}

/* ==========================================================================
   The form as a card
   ========================================================================== */

.geodir-add-listing form#geodirectory-add-post {
	padding: var(--gcn-space-8);
	background: var(--gcn-surface);
	border: 1px solid var(--gcn-rule);
	border-radius: var(--gcn-radius-lg);
	box-shadow: var(--gcn-shadow-md);
}

/* ==========================================================================
   Section headings
   ==========================================================================
   GeoDirectory emits an empty <fieldset> carrying only an <h3> before each
   group of fields — the fields are siblings, not children. So the fieldset is
   styled as a heading band rather than as a box around anything.
   ========================================================================== */

.geodir-add-listing fieldset {
	margin: var(--gcn-space-12) 0 var(--gcn-space-6) !important;
	padding: 0;
	border: 0;
}

.geodir-add-listing fieldset:first-of-type {
	margin-top: var(--gcn-space-2) !important;
}

.geodir-add-listing fieldset h3 {
	position: relative;
	margin: 0;
	padding-bottom: var(--gcn-space-3);
	font-size: var(--gcn-text-xl);
	font-weight: var(--gcn-weight-semibold);
	letter-spacing: var(--gcn-tracking-tight);
	color: var(--gcn-text);
	border-bottom: 1px solid var(--gcn-rule);
}

.geodir-add-listing fieldset h3::after {
	content: "";
	position: absolute;
	inset: auto auto -1px 0;
	width: 3rem;
	height: 2px;
	background: var(--gcn-brand);
}

/* ==========================================================================
   Field rows — stacked, not two-column
   ==========================================================================
   A 17% label column forces "Address / map location" onto three lines beside a
   full-width input. Stacking reads better and scans faster on a long form.

   Scoped to [data-argument] rows, which is how GeoDirectory marks one field.
   The business-hours widget and the image uploader use their own nested grids
   and must keep them, so they are excluded by that scope.
   ========================================================================== */

.geodir-add-listing [data-argument].row {
	display: block;
	margin-bottom: var(--gcn-space-6) !important;
	margin-left: 0;
	margin-right: 0;
}

.geodir-add-listing [data-argument].row > .col-sm-2,
.geodir-add-listing [data-argument].row > .col-sm-10 {
	flex: 0 0 100%;
	max-width: 100%;
	width: 100%;
	padding-left: 0;
	padding-right: 0;
}

.geodir-add-listing [data-argument] > .col-form-label,
.geodir-add-listing [data-argument] > label {
	display: block;
	margin-bottom: var(--gcn-space-2);
	padding: 0;
	font-size: var(--gcn-text-md);
	font-weight: var(--gcn-weight-semibold);
	line-height: var(--gcn-leading-snug);
	color: var(--gcn-text);
}

/* The required mark: present, but not shouting. */
.geodir-add-listing .text-danger {
	color: var(--gcn-critical) !important;
	font-weight: var(--gcn-weight-semibold);
}

/* Guidance under a field is help, so it should not compete with the label. */
.geodir-add-listing .form-text {
	margin-top: var(--gcn-space-2);
	font-size: var(--gcn-text-sm);
	line-height: var(--gcn-leading-normal);
	color: var(--gcn-text-muted) !important;
}

/* ==========================================================================
   Controls
   ==========================================================================
   Tinted at rest and white on focus, so an empty field reads as something
   waiting to be filled rather than as a hairline on a white card, and the field
   you are in is the brightest thing on the page.
   ========================================================================== */

.geodir-add-listing .form-control,
.geodir-add-listing .form-select,
.geodir-add-listing .select2-container--default .select2-selection--multiple,
.geodir-add-listing .select2-container--default .select2-selection--single {
	padding: 0.75em 0.95em;
	font-size: var(--gcn-text-md);
	color: var(--gcn-text);
	background-color: var(--gcn-surface-sunken);
	border: 1px solid var(--gcn-rule);
	border-radius: var(--gcn-radius-md);
	box-shadow: none;
	transition:
		border-color var(--gcn-duration) var(--gcn-ease),
		background-color var(--gcn-duration) var(--gcn-ease),
		box-shadow var(--gcn-duration) var(--gcn-ease);
}

.geodir-add-listing .form-control:hover,
.geodir-add-listing .form-select:hover {
	border-color: var(--gcn-rule-strong);
}

.geodir-add-listing .form-control:focus,
.geodir-add-listing .form-select:focus,
.geodir-add-listing .select2-container--focus .select2-selection {
	background-color: var(--gcn-surface);
	border-color: var(--gcn-brand);
	box-shadow: var(--gcn-ring);
	outline: none;
}

.geodir-add-listing textarea.form-control {
	min-height: 8rem;
	line-height: var(--gcn-leading-relaxed);
	resize: vertical;
}

.geodir-add-listing .form-control::placeholder {
	color: var(--gcn-text-faint);
}

/* Select2 is the multi-select GeoDirectory uses for topics, languages and the rest. */
.geodir-add-listing .select2-container--default .select2-selection--multiple .select2-selection__choice {
	padding: 0.25em 0.6em;
	font-size: var(--gcn-text-sm);
	color: var(--gcn-brand-strong);
	background: var(--gcn-brand-soft);
	border: 1px solid var(--gcn-brand-border);
	border-radius: var(--gcn-radius-pill);
}

/* Checkboxes and radios. */
.geodir-add-listing .form-check {
	padding-left: 1.9em;
	margin-bottom: var(--gcn-space-2);
}

.geodir-add-listing .form-check-input {
	width: 1.15em;
	height: 1.15em;
	margin-left: -1.9em;
	background-color: var(--gcn-surface);
	border: 1px solid var(--gcn-rule-strong);
}

.geodir-add-listing .form-check-input:checked {
	background-color: var(--gcn-brand);
	border-color: var(--gcn-brand);
}

.geodir-add-listing .form-check-input:focus {
	border-color: var(--gcn-brand);
	box-shadow: var(--gcn-ring);
}

.geodir-add-listing .form-check-label {
	font-size: var(--gcn-text-md);
	color: var(--gcn-text-soft);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.geodir-add-listing .btn-primary,
.geodir-add-listing .geodir_button,
.geodir-add-listing input[type="submit"] {
	padding: 0.8em 1.7em;
	font-size: var(--gcn-text-md);
	font-weight: var(--gcn-weight-semibold);
	color: var(--gcn-brand-contrast);
	background: var(--gcn-brand);
	border: 1px solid var(--gcn-brand);
	border-radius: var(--gcn-radius-md);
	box-shadow: var(--gcn-shadow-sm);
	transition:
		background var(--gcn-duration) var(--gcn-ease),
		box-shadow var(--gcn-duration) var(--gcn-ease);
}

.geodir-add-listing .btn-primary:hover,
.geodir-add-listing .geodir_button:hover,
.geodir-add-listing input[type="submit"]:hover {
	color: var(--gcn-brand-contrast);
	background: var(--gcn-brand-strong);
	border-color: var(--gcn-brand-strong);
	box-shadow: var(--gcn-shadow-md);
}

.geodir-add-listing .btn-outline-primary,
.geodir-add-listing .btn-secondary {
	color: var(--gcn-brand-strong);
	background: var(--gcn-surface);
	border: 1px solid var(--gcn-brand-border);
	border-radius: var(--gcn-radius-md);
}

.geodir-add-listing .btn-outline-primary:hover,
.geodir-add-listing .btn-secondary:hover {
	color: var(--gcn-brand-strong);
	background: var(--gcn-brand-soft);
}

/*
 * The submit row. GeoDirectory puts the preview/submit buttons at the foot of
 * the form with no separation from the last field.
 */
.geodir-add-listing form > .mb-3:last-child,
.geodir-add-listing .geodir-add-listing-submit {
	margin-top: var(--gcn-space-8);
	padding-top: var(--gcn-space-6);
	border-top: 1px solid var(--gcn-rule);
}

/* ==========================================================================
   Notices and the social importer
   ========================================================================== */

.geodir-add-listing .alert {
	display: flex;
	align-items: flex-start;
	gap: var(--gcn-space-3);
	padding: var(--gcn-space-4) var(--gcn-space-5);
	font-size: var(--gcn-text-sm);
	line-height: var(--gcn-leading-normal);
	color: var(--gcn-text-soft);
	background: var(--gcn-notice-soft);
	border: 0;
	border-radius: var(--gcn-radius-md);
}

.geodir-add-listing .alert i {
	margin-top: 0.15em;
	color: var(--gcn-notice);
}

.geodir-add-listing .alert-danger {
	color: var(--gcn-critical);
	background: var(--gcn-critical-soft);
}

.geodir-add-listing .alert-danger i {
	color: var(--gcn-critical);
}

/*
 * "Import details from a social URL" is a shortcut, not a step — it sits above
 * the card as a quiet strip rather than as the first thing that looks like a
 * required field.
 */
#gd-social-importer {
	margin-bottom: var(--gcn-space-5);
	padding: var(--gcn-space-4) var(--gcn-space-5);
	background: var(--gcn-brand-soft);
	border: 1px solid var(--gcn-brand-border);
	border-radius: var(--gcn-radius-md);
}

#gd-social-importer .form-control {
	background: var(--gcn-surface);
}

#gd-social-importer .alert {
	margin-bottom: var(--gcn-space-3);
	padding: 0;
	background: transparent;
	font-size: var(--gcn-text-sm);
	font-weight: var(--gcn-weight-semibold);
	color: var(--gcn-text);
}

.geodir-add-listing .input-group > .form-control {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.geodir-add-listing .input-group > .btn {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

/* ==========================================================================
   Business hours
   ==========================================================================
   Its own nested grid, which must keep its columns — only the surface changes.
   ========================================================================== */

.geodir-add-listing .gd-bh-item {
	padding: var(--gcn-space-3);
	background: var(--gcn-surface-sunken);
	border-radius: var(--gcn-radius-sm);
}

.geodir-add-listing .gd-bh-item + .gd-bh-item {
	margin-top: var(--gcn-space-2);
}

.geodir-add-listing .gd-bh-day {
	font-weight: var(--gcn-weight-medium);
	color: var(--gcn-text);
}

.geodir-add-listing .gd-bh-time .form-control {
	padding: 0.45em 0.5em;
	font-size: var(--gcn-text-sm);
}

.geodir-add-listing .fa-plus-circle {
	color: var(--gcn-brand) !important;
}

/* ==========================================================================
   Images
   ========================================================================== */

.geodir-add-listing .gd-dropzone,
.geodir-add-listing .dropzone {
	padding: var(--gcn-space-8);
	background: var(--gcn-surface-sunken);
	border: 2px dashed var(--gcn-rule-strong);
	border-radius: var(--gcn-radius-lg);
	transition:
		background var(--gcn-duration) var(--gcn-ease),
		border-color var(--gcn-duration) var(--gcn-ease);
}

.geodir-add-listing .dropzone:hover {
	border-color: var(--gcn-brand-border);
	background: var(--gcn-brand-soft);
}

/* ==========================================================================
   The two empty blocks at the foot of the form
   ========================================================================== */

/*
 * reCAPTCHA v3 is invisible by design — it scores the request in the
 * background and has nothing to show. GeoDirectory still emits its row, which
 * held only hidden inputs and a script and rendered as an empty bordered box
 * above the submit button.
 *
 * Hidden, not removed: the hidden inputs must stay in the form to carry the
 * token, and a display:none input still submits. The :has() guard means that
 * if anyone switches the site to reCAPTCHA v2 — which has a checkbox the user
 * must actually see and click — the row comes straight back.
 */
.geodir-add-listing #gd_recaptch_row:has( #gd_recaptcha_version[value="v3"] ) {
	display: none;
}

/*
 * The submit row is a Bootstrap grid row whose first cell is an empty label,
 * so the buttons sat indented under a blank 17% column with a <br> between
 * them.
 */
#geodir-add-listing-submit {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gcn-space-3);
	align-items: center;
	margin: 0 !important;
}

#geodir-add-listing-submit > label:empty,
#geodir-add-listing-submit > .col-sm-2 {
	display: none;
}

#geodir-add-listing-submit > .col-sm-10 {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gcn-space-3);
	align-items: center;
	width: 100%;
	max-width: 100%;
	padding: 0;
}

#geodir-add-listing-submit br {
	display: none;
}

/* ==========================================================================
   Steps
   ==========================================================================
   The panels are built by assets/gcn-form-steps.js from the section headings.
   Without JavaScript none of these classes exist and the form stays as one
   long page, which still works.
   ========================================================================== */

.gcn-step {
	display: none;
}

.gcn-step.is-active {
	display: block;
	animation: gcn-step-in var(--gcn-duration) var(--gcn-ease);
}

@keyframes gcn-step-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {

	.gcn-step.is-active {
		animation: none;
	}
}

/* The first heading inside a step is the step's own title, shown by the rail. */
.gcn-step > fieldset:first-child {
	margin-top: 0 !important;
}

/* --------------------------------------------------------------------------
   The rail
   --------------------------------------------------------------------------
   A tracker rather than a row of tags: the chips sit on a sunken strip that
   spans the card, joined by a rule that reads as progress through the form.
   -------------------------------------------------------------------------- */

.gcn-steps__nav {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: var(--gcn-space-2);
	margin: 0 0 var(--gcn-space-8);
	padding: var(--gcn-space-4);
	list-style: none;
	background: var(--gcn-surface-sunken);
	border: 1px solid var(--gcn-rule);
	border-radius: var(--gcn-radius-md);
}

.gcn-steps__item {
	flex: 0 1 auto;
}

/* A step whose fields no longer apply drops out of the rail entirely. */
.gcn-steps__item[hidden] {
	display: none !important;
}

.gcn-steps__chip {
	display: inline-flex;
	align-items: center;
	gap: var(--gcn-space-2);
	padding: 0.42em 0.9em 0.42em 0.42em;
	font-family: inherit;
	font-size: var(--gcn-text-sm);
	font-weight: var(--gcn-weight-medium);
	color: var(--gcn-text-muted);
	background: var(--gcn-surface);
	border: 1px solid var(--gcn-rule);
	border-radius: var(--gcn-radius-pill);
	cursor: pointer;
	transition:
		color var(--gcn-duration) var(--gcn-ease),
		background var(--gcn-duration) var(--gcn-ease),
		border-color var(--gcn-duration) var(--gcn-ease),
		box-shadow var(--gcn-duration) var(--gcn-ease);
}

.gcn-steps__chip:hover {
	color: var(--gcn-brand-strong);
	border-color: var(--gcn-brand-border);
	box-shadow: var(--gcn-shadow-sm);
}

.gcn-steps__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7em;
	height: 1.7em;
	font-size: 0.85em;
	font-weight: var(--gcn-weight-semibold);
	color: var(--gcn-text-muted);
	background: var(--gcn-surface-sunken);
	border: 1px solid var(--gcn-rule);
	border-radius: 50%;
}

.gcn-steps__chip.is-done {
	color: var(--gcn-brand-strong);
	border-color: var(--gcn-brand-border);
	background: var(--gcn-brand-soft);
}

/* A completed step shows a tick instead of its number. */
.gcn-steps__chip.is-done .gcn-steps__num {
	color: transparent;
	background: var(--gcn-brand);
	border-color: var(--gcn-brand);
	position: relative;
}

.gcn-steps__chip.is-done .gcn-steps__num::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--gcn-brand-contrast);
	-webkit-mask: var(--gcn-icon-tick) center / 0.85em no-repeat;
	mask: var(--gcn-icon-tick) center / 0.85em no-repeat;
}

.gcn-steps__chip.is-active {
	color: var(--gcn-brand-contrast);
	background: var(--gcn-brand);
	border-color: var(--gcn-brand);
	box-shadow: 0 2px 8px hsl(168 78% 24% / 0.28);
}

.gcn-steps__chip.is-active .gcn-steps__num {
	color: var(--gcn-brand-strong);
	background: #fff;
	border-color: #fff;
}

/* --------------------------------------------------------------------------
   The footer
   --------------------------------------------------------------------------
   Sticky, because a step of twenty fields otherwise puts Next below the fold
   and the reader has to scroll past everything to move on.
   -------------------------------------------------------------------------- */

.gcn-steps__footer {
	position: sticky;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: var(--gcn-space-3);
	align-items: center;
	margin:
		var(--gcn-space-8)
		calc( var(--gcn-space-8) * -1 )
		calc( var(--gcn-space-8) * -1 );
	padding: var(--gcn-space-5) var(--gcn-space-8);
	background: hsl(0 0% 100% / 0.97);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--gcn-rule);
	box-shadow: 0 -8px 20px hsl(212 40% 30% / 0.06);
	border-radius: 0 0 var(--gcn-radius-lg) var(--gcn-radius-lg);
}

.gcn-steps__btn {
	padding: 0.8em 1.7em;
	font-family: inherit;
	font-size: var(--gcn-text-md);
	font-weight: var(--gcn-weight-semibold);
	border-radius: var(--gcn-radius-md);
	cursor: pointer;
	transition:
		background var(--gcn-duration) var(--gcn-ease),
		box-shadow var(--gcn-duration) var(--gcn-ease);
}

.gcn-steps__btn--next {
	order: 3;
	color: var(--gcn-brand-contrast);
	background: var(--gcn-brand);
	border: 1px solid var(--gcn-brand);
	box-shadow: var(--gcn-shadow-sm);
}

.gcn-steps__btn--next:hover {
	background: var(--gcn-brand-strong);
	border-color: var(--gcn-brand-strong);
	box-shadow: var(--gcn-shadow-md);
}

.gcn-steps__btn--back {
	order: 1;
	color: var(--gcn-text-soft);
	background: var(--gcn-surface);
	border: 1px solid var(--gcn-rule-strong);
}

.gcn-steps__btn--back:hover {
	color: var(--gcn-brand-strong);
	background: var(--gcn-brand-soft);
	border-color: var(--gcn-brand-border);
}

.gcn-steps__position {
	order: 2;
	margin-right: auto;
	font-size: var(--gcn-text-sm);
	font-weight: var(--gcn-weight-medium);
	color: var(--gcn-text-muted);
}

/* The submit row sits at the end of the footer, on the last step only. */
.gcn-steps__footer #geodir-add-listing-submit {
	order: 4;
	flex: 0 0 auto;
	width: auto;
	border-top: 0;
	padding-top: 0;
	margin-top: 0 !important;
}

.gcn-steps__footer #geodir-add-listing-submit > .col-sm-10 {
	width: auto;
}

/* A field the step could not pass. */
.gcn-step--invalid .form-control,
.gcn-step--invalid .form-select {
	border-color: var(--gcn-critical);
	background-color: var(--gcn-critical-soft);
	box-shadow: 0 0 0 3px var(--gcn-critical-soft);
}

/*
 * GeoDirectory's own "Enter Listing Details" heading. With the stepper running
 * the rail names each section, so this repeats nothing useful and would
 * otherwise sit above the rail as a heading with no content beneath it.
 */
.gcn-steps__intro {
	display: none;
}

/*
 * Specificity repairs for the two rules above.
 *
 * `[hidden]` is how the stepper hides the submit row on every step but the
 * last, but an ID selector outranks the attribute, so `#geodir-add-listing-submit
 * { display: flex }` kept it on screen throughout — Submit and Preview sat under
 * step one. Same story for Bootstrap's .d-none, which GeoDirectory uses to keep
 * the social-import progress messages out of sight until an import is running.
 *
 * Both are restated here at a specificity that actually wins.
 */
#geodir-add-listing-submit[hidden],
.geodir-add-listing [hidden] {
	display: none !important;
}

.geodir-add-listing .alert.d-none,
.geodir-add-listing .d-none {
	display: none !important;
}

/*
 * Native multi-selects.
 *
 * Where Select2 does not take over — Topics and Category are the ones that
 * matter — the browser renders a scrolling list box four rows tall, which is
 * too short to choose from a list of 64 topics without hunting.
 */
.geodir-add-listing select[multiple],
.geodir-add-listing select[size]:not([size="1"]) {
	min-height: 12rem;
	padding: var(--gcn-space-2);
	line-height: var(--gcn-leading-relaxed);
}

.geodir-add-listing select[multiple] option {
	padding: 0.4em 0.6em;
	border-radius: var(--gcn-radius-xs);
}

.geodir-add-listing select[multiple] option:checked {
	color: var(--gcn-brand-strong);
	background: var(--gcn-brand-soft);
	font-weight: var(--gcn-weight-medium);
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 720px) {

	.geodir-add-listing form#geodirectory-add-post {
		padding: var(--gcn-space-5);
	}

	.gcn-steps__nav {
		margin-bottom: var(--gcn-space-6);
		padding: var(--gcn-space-3);
	}

	.gcn-steps__footer {
		margin:
			var(--gcn-space-6)
			calc( var(--gcn-space-5) * -1 )
			calc( var(--gcn-space-5) * -1 );
		padding: var(--gcn-space-4) var(--gcn-space-5);
	}

	.gcn-formhead {
		padding: var(--gcn-space-5);
	}

	.gcn-formhead__main {
		flex-wrap: wrap;
	}

	.gcn-formhead__switch {
		order: 3;
	}

	.geodir-add-listing [data-argument].row {
		margin-bottom: var(--gcn-space-5) !important;
	}
}

@media (max-width: 640px) {

	.gcn-steps__label {
		display: none;
	}

	.gcn-steps__chip {
		padding: 0.42em;
	}

	.gcn-steps__position {
		flex: 1 0 100%;
		margin-right: 0;
		order: -1;
	}
}
