/**
 * Fugamma — project-inquiry modal + form micro-interactions.
 *
 * The modal scales/fades in over a blurred backdrop. Form styling targets BOTH
 * the real Ninja Forms markup (.nf-field-element, .nf-field-label …) and a
 * static .fg-form mock used in the standalone preview, so the same hover /
 * focus / filled micro-interactions show up in either context.
 */

:root {
	--fg-accent: #48cae4;
	--fg-accent-soft: rgba(72, 202, 228, 0.18);
	--fg-accent-hi: #6fd8ec;
	--fg-on-accent: #07121a;
	--fg-modal-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Overlay ------------------------------------------------------------- */
.fg-modal {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
}
.fg-modal[hidden] { display: none; }

.fg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 8, 14, 0.55);
	-webkit-backdrop-filter: blur(12px) saturate(1.1);
	backdrop-filter: blur(12px) saturate(1.1);
	opacity: 0;
	transition: opacity 0.45s ease;
}

/* ---- Dialog -------------------------------------------------------------- */
.fg-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 580px;
	max-height: calc(100dvh - 2 * clamp(16px, 4vw, 40px));
	overflow-y: auto;
	padding: clamp(1.6rem, 1rem + 2.4vw, 2.6rem);
	border-radius: 22px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	background: rgba(16, 18, 26, 0.74);
	-webkit-backdrop-filter: blur(30px) saturate(1.3);
	backdrop-filter: blur(30px) saturate(1.3);
	box-shadow:
		0 30px 80px rgba(0, 0, 0, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
	opacity: 0;
	transform: translateY(22px) scale(0.965);
	transition:
		opacity 0.5s ease,
		transform 0.6s var(--fg-modal-ease);
}

/* Active (open) state — set by JS one frame after [hidden] is removed. */
.fg-modal.is-active .fg-modal__backdrop { opacity: 1; }
.fg-modal.is-active .fg-modal__dialog { opacity: 1; transform: none; }

/* ---- Close button -------------------------------------------------------- */
.fg-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.75);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--fg-modal-ease);
}
.fg-modal__close svg { width: 18px; height: 18px; }
.fg-modal__close:hover { background: rgba(255, 255, 255, 0.14); color: #fff; transform: rotate(90deg); }
.fg-modal__close:focus-visible { outline: 2px solid var(--fg-accent); outline-offset: 2px; }

/* ---- Head ---------------------------------------------------------------- */
.fg-modal__head { margin: 0 0 1.4rem; padding-right: 2.5rem; }
.fg-modal__eyebrow {
	margin: 0 0 0.5rem;
	font-family: 'Roboto', sans-serif;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--fg-accent);
}
.fg-modal__title {
	margin: 0 0 0.5rem;
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	font-weight: 300;
	font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.3rem);
	line-height: 1.1;
	color: #fff;
}
.fg-modal__sub {
	margin: 0;
	font-family: 'Roboto', sans-serif;
	font-size: 0.95rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.62);
}
.fg-modal__fallback {
	font-family: 'Roboto', sans-serif;
	font-size: 0.95rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.72);
}
.fg-modal__fallback code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.85em;
	color: var(--fg-accent);
	background: rgba(72, 202, 228, 0.1);
	padding: 0.1em 0.4em;
	border-radius: 5px;
}
.fg-modal__fallback a { color: var(--fg-accent); }

/* ---- Field micro-interactions (Ninja Forms + .fg-form mock) -------------- */
.fg-modal__body { font-family: 'Roboto', sans-serif; }

/* Layout: two columns for short fields on wider dialogs. */
.fg-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fg-form .fg-field--full { grid-column: 1 / -1; }
@media (max-width: 520px) { .fg-form { grid-template-columns: 1fr; } }

.fg-field { position: relative; }

/* The control itself — shared glass treatment. */
.fg-modal .nf-field-element input[type="text"],
.fg-modal .nf-field-element input[type="email"],
.fg-modal .nf-field-element input[type="tel"],
.fg-modal .nf-field-element input[type="url"],
.fg-modal .nf-field-element input[type="number"],
.fg-modal .nf-field-element textarea,
.fg-modal .nf-field-element select,
.fg-field__input {
	width: 100%;
	font-family: inherit;
	font-size: 0.98rem;
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 12px;
	padding: 1.35rem 1rem 0.55rem; /* room for floating label */
	-webkit-appearance: none;
	appearance: none;
	transition:
		border-color 0.25s ease,
		background 0.25s ease,
		box-shadow 0.3s var(--fg-modal-ease),
		transform 0.3s var(--fg-modal-ease);
}
.fg-field__input::placeholder { color: transparent; } /* placeholder used only to drive :not(:placeholder-shown) */
.fg-field--textarea .fg-field__input { min-height: 116px; resize: vertical; line-height: 1.5; }

/* Hover — a small lift + brighter edge. */
.fg-modal .nf-field-element input:hover,
.fg-modal .nf-field-element textarea:hover,
.fg-modal .nf-field-element select:hover,
.fg-field__input:hover {
	border-color: rgba(255, 255, 255, 0.34);
	background: rgba(255, 255, 255, 0.07);
	transform: translateY(-1px);
}

/* Focus — accent ring glow. */
.fg-modal .nf-field-element input:focus,
.fg-modal .nf-field-element textarea:focus,
.fg-modal .nf-field-element select:focus,
.fg-field__input:focus {
	outline: none;
	border-color: var(--fg-accent);
	background: rgba(72, 202, 228, 0.06);
	box-shadow: 0 0 0 3px var(--fg-accent-soft);
	transform: translateY(-1px);
}

/* Filled / entered — accent edge persists (JS adds .fg-filled on NF inputs;
   the mock uses :not(:placeholder-shown)). */
.fg-modal .nf-field-element.fg-filled input,
.fg-modal .nf-field-element.fg-filled textarea,
.fg-modal .nf-field-element.fg-filled select,
.fg-field__input:not(:placeholder-shown) {
	border-color: rgba(72, 202, 228, 0.5);
}

/* ---- Floating labels (mock + NF) ---------------------------------------- */
.fg-field__label {
	position: absolute;
	left: 1rem;
	top: 0.95rem;
	font-size: 0.98rem;
	color: rgba(255, 255, 255, 0.5);
	pointer-events: none;
	transform-origin: left top;
	transition: transform 0.2s var(--fg-modal-ease), color 0.2s ease;
}
.fg-field__input:focus + .fg-field__label,
.fg-field__input:not(:placeholder-shown) + .fg-field__label {
	transform: translateY(-0.62rem) scale(0.74);
	color: var(--fg-accent);
	letter-spacing: 0.02em;
}

/* Selects always show a value, so keep their label pinned up. */
.fg-field--select .fg-field__label {
	transform: translateY(-0.62rem) scale(0.74);
	letter-spacing: 0.02em;
}
.fg-field--select:focus-within .fg-field__label { color: var(--fg-accent); }
.fg-field--select .fg-field__input { padding-right: 2.4rem; }

/* Select caret. */
.fg-field--select::after {
	content: "";
	position: absolute;
	right: 1.05rem;
	top: 1.55rem;
	width: 9px;
	height: 9px;
	border-right: 2px solid rgba(255, 255, 255, 0.55);
	border-bottom: 2px solid rgba(255, 255, 255, 0.55);
	transform: rotate(45deg);
	pointer-events: none;
	transition: border-color 0.2s ease;
}
.fg-field--select:focus-within::after { border-color: var(--fg-accent); }
.fg-field--select .fg-field__input { color: rgba(255, 255, 255, 0.92); }

/* NF native labels (when the real form renders) — keep them readable. */
.fg-modal .nf-field-label label,
.fg-modal .nf-field-label .label {
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.7);
	margin-bottom: 0.4rem;
}
.fg-modal .nf-field-element input[type="text"],
.fg-modal .nf-field-element input[type="email"],
.fg-modal .nf-field-element input[type="tel"],
.fg-modal .nf-field-element select,
.fg-modal .nf-field-element textarea {
	padding: 0.85rem 1rem; /* NF labels sit above, so no floating-label padding */
}

/* Ninja Forms list-checkbox / list-radio — keep NF's native controls (robust
   across NF markup) but tint them to the palette accent and size them up. */
.fg-modal .nf-field-element input[type="checkbox"],
.fg-modal .nf-field-element input[type="radio"] {
	-webkit-appearance: auto;
	appearance: auto;
	accent-color: var(--fg-accent);
	width: 18px;
	height: 18px;
	margin: 0 0.55rem 0 0;
	vertical-align: -4px;
	cursor: pointer;
}
/* Option rows + their labels in a checkbox/radio list. */
.fg-modal .nf-field-element ul,
.fg-modal .nf-field-element .nf-field-element ul { list-style: none; margin: 0; padding: 0; }
.fg-modal .nf-field-element li { margin: 0 0 0.5rem; }
.fg-modal .nf-field-element li label {
	display: inline;
	font-size: 0.96rem;
	color: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	vertical-align: middle;
}

/* ---- Service multi-select chips (mock) ---------------------------------- */
.fg-checkgroup__label {
	display: block;
	margin: 0 0 0.55rem;
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--fg-accent);
}
.fg-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.fg-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 0.95rem;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.82);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s var(--fg-modal-ease);
}
.fg-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.fg-chip::before {
	content: "";
	width: 15px;
	height: 15px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 5px;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.fg-chip:hover { border-color: rgba(255, 255, 255, 0.4); transform: translateY(-1px); }
.fg-chip:has(input:checked) {
	color: #fff;
	background: rgba(72, 202, 228, 0.16);
	border-color: var(--fg-accent);
}
.fg-chip:has(input:checked)::before {
	background: var(--fg-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.5 3.5L13 4.5' fill='none' stroke='%2307121a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
	border-color: var(--fg-accent);
}
.fg-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--fg-accent-soft); }

/* ---- Lookbook checkbox (mock) ------------------------------------------- */
.fg-check {
	grid-column: 1 / -1;
	display: flex;
	align-items: flex-start;
	gap: 0.7rem;
	margin-top: 0.2rem;
	cursor: pointer;
	font-size: 0.92rem;
	color: rgba(255, 255, 255, 0.78);
	line-height: 1.4;
}
.fg-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.fg-check__box {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.05);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--fg-modal-ease);
}
.fg-check__box svg { width: 13px; height: 13px; opacity: 0; transform: scale(0.5); transition: opacity 0.18s ease, transform 0.22s var(--fg-modal-ease); color: #07121a; }
.fg-check:hover .fg-check__box { border-color: rgba(255, 255, 255, 0.55); transform: translateY(-1px); }
.fg-check input:checked + .fg-check__box { background: var(--fg-accent); border-color: var(--fg-accent); }
.fg-check input:checked + .fg-check__box svg { opacity: 1; transform: scale(1); }
.fg-check input:focus-visible + .fg-check__box { box-shadow: 0 0 0 3px var(--fg-accent-soft); }
.fg-check strong { color: #fff; font-weight: 600; }

/* ---- Submit (mock + NF) -------------------------------------------------- */
.fg-form__submit,
.fg-modal .submit-container input[type="button"],
.fg-modal .nf-field-element input[type="button"] {
	grid-column: 1 / -1;
	width: 100%;
	margin-top: 0.4rem;
	padding: 0.95rem 1.2rem;
	font-family: 'Roboto', sans-serif;
	font-size: 0.98rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--fg-on-accent);
	background: var(--fg-accent);
	border: 1px solid var(--fg-accent);
	border-radius: 12px;
	cursor: pointer;
	transition: background 0.25s ease, box-shadow 0.3s var(--fg-modal-ease), transform 0.2s var(--fg-modal-ease);
}
.fg-form__submit:hover,
.fg-modal .submit-container input[type="button"]:hover {
	background: var(--fg-accent-hi);
	box-shadow: 0 10px 30px var(--fg-accent-soft);
	transform: translateY(-2px);
}
.fg-form__submit:active { transform: translateY(0); }
.fg-form__submit:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

/* Honeypot — off-screen, not announced; bots fill it, people never see it. */
.fg-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Submit status + success state. */
.fg-form__status {
	grid-column: 1 / -1;
	margin: 0.1rem 0 0;
	font-size: 0.88rem;
	min-height: 1em;
	color: rgba(255, 255, 255, 0.6);
}
.fg-form__status.is-error { color: #ff6b6b; }
.fg-form__done {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.85rem;
	padding: 1.8rem 0.5rem 1rem;
}
.fg-form__done svg { width: 54px; height: 54px; color: var(--fg-accent); }
.fg-form__done p {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.85);
	max-width: 34ch;
}

/* =========================================================================
   Ninja Forms (live) — match the polished mock: compact 2-column layout,
   floating placeholder-labels, and pill "chips" for the service options.
   Targets NF 3.x markup with Opinionated Styles OFF. JS adds .fg-filled to a
   field's .nf-field-container once it has a value (for the floated state).
   ========================================================================= */

/* Layout — flow fields into two columns. */
.fg-modal .nf-form-cont,
.fg-modal .nf-form-content { width: 100%; max-width: none; }
.fg-modal .nf-form-fields-required { display: none; }
.fg-modal .nf-form-content form { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.fg-modal .nf-field-container { width: 100%; margin: 0; padding: 0; }
.fg-modal .nf-field-container.fg-half { width: calc(50% - 8px); }
@media (max-width: 520px) { .fg-modal .nf-field-container.fg-half { width: 100%; } }
.fg-modal .field-wrap { margin: 0; }
.fg-modal .nf-error-msg,
.fg-modal .nf-error .nf-error-msg { color: #ff6b6b; font-size: 0.8rem; margin-top: 0.35rem; }

/* Floating labels for text-like + select fields. */
.fg-modal .textbox-container .field-wrap,
.fg-modal .email-container .field-wrap,
.fg-modal .phone-container .field-wrap,
.fg-modal .textarea-container .field-wrap,
.fg-modal .listselect-container .field-wrap { position: relative; }

.fg-modal .textbox-container .nf-field-label,
.fg-modal .email-container .nf-field-label,
.fg-modal .phone-container .nf-field-label,
.fg-modal .textarea-container .nf-field-label,
.fg-modal .listselect-container .nf-field-label {
	position: absolute; left: 1rem; top: 0; margin: 0; z-index: 2;
	pointer-events: none; transform-origin: left top;
	transform: translateY(0.95rem);
	transition: transform 0.18s var(--fg-modal-ease), color 0.18s ease;
}
.fg-modal .textbox-container .nf-field-label label,
.fg-modal .email-container .nf-field-label label,
.fg-modal .phone-container .nf-field-label label,
.fg-modal .textarea-container .nf-field-label label,
.fg-modal .listselect-container .nf-field-label label {
	margin: 0; padding: 0; font-weight: 400; font-size: 0.98rem;
	color: rgba(255, 255, 255, 0.5); white-space: nowrap; cursor: text;
}

/* Room inside the control for the floating label. */
.fg-modal .nf-field-element input[type="text"],
.fg-modal .nf-field-element input[type="email"],
.fg-modal .nf-field-element input[type="tel"],
.fg-modal .nf-field-element input[type="url"],
.fg-modal .nf-field-element input[type="number"],
.fg-modal .nf-field-element select { padding: 1.45rem 1rem 0.5rem; }
.fg-modal .textarea-container textarea { min-height: 116px; padding: 1.5rem 1rem 0.6rem; }

/* Lift the label on focus, when filled, and always for selects. */
.fg-modal .nf-field-container:focus-within .nf-field-label,
.fg-modal .nf-field-container.fg-filled .nf-field-label,
.fg-modal .listselect-container .nf-field-label {
	transform: translateY(0.42rem) scale(0.74);
}
.fg-modal .nf-field-container:focus-within .nf-field-label label,
.fg-modal .nf-field-container.fg-filled .nf-field-label label,
.fg-modal .listselect-container .nf-field-label label { color: var(--fg-accent); }

/* Select caret. */
.fg-modal .listselect-container .field-wrap::after {
	content: ""; position: absolute; right: 1.1rem; top: 1.5rem; width: 9px; height: 9px;
	border-right: 2px solid rgba(255, 255, 255, 0.55);
	border-bottom: 2px solid rgba(255, 255, 255, 0.55);
	transform: rotate(45deg); pointer-events: none;
}
.fg-modal .listselect-container select { padding-right: 2.4rem; }

/* Service options → chips (listcheckbox). The field label stays above as a
   small caption, like the mock. */
.fg-modal .listcheckbox-container .nf-field-label {
	position: static; transform: none; margin: 0 0 0.55rem;
}
.fg-modal .listcheckbox-container .nf-field-label label {
	font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em;
	color: var(--fg-accent); white-space: normal; cursor: default;
}
.fg-modal .listcheckbox-container ul {
	display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0;
}
.fg-modal .listcheckbox-container li {
	display: inline-flex; align-items: center; gap: 0.5rem; margin: 0;
	padding: 0.55rem 0.95rem; border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.05);
	color: rgba(255, 255, 255, 0.82); cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--fg-modal-ease);
}
.fg-modal .listcheckbox-container li:hover {
	border-color: rgba(255, 255, 255, 0.4); transform: translateY(-1px);
}
.fg-modal .listcheckbox-container li:has(input:checked) {
	color: #fff; background: rgba(72, 202, 228, 0.16); border-color: var(--fg-accent);
}
.fg-modal .listcheckbox-container li label {
	margin: 0; color: inherit; cursor: pointer; font-size: 0.92rem; white-space: nowrap;
}
.fg-modal .listcheckbox-container li input[type="checkbox"] {
	accent-color: var(--fg-accent); width: 15px; height: 15px; margin: 0; vertical-align: middle;
}

/* Single lookbook checkbox row. */
.fg-modal .checkbox-container .field-wrap { display: flex; align-items: center; gap: 0.6rem; }
.fg-modal .checkbox-container .nf-field-label { margin: 0; }
.fg-modal .checkbox-container label {
	font-size: 0.92rem; color: rgba(255, 255, 255, 0.8); cursor: pointer;
}
.fg-modal .checkbox-container input[type="checkbox"] {
	accent-color: var(--fg-accent); width: 18px; height: 18px;
}

/* Submit — full-width primary. */
.fg-modal .submit-container { width: 100%; }
.fg-modal .submit-container input[type="button"] { width: 100%; margin: 0.3rem 0 0; }

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	.fg-modal__backdrop,
	.fg-modal__dialog,
	.fg-modal__close,
	.fg-field__input,
	.fg-field__label,
	.fg-check__box,
	.fg-form__submit,
	.fg-modal .nf-field-label,
	.fg-modal .listcheckbox-container li {
		transition-duration: 0.001ms !important;
	}
	.fg-modal__dialog { transform: none; }
}
