/* ==========================================================================
   Webmindex Brief — isolated design system
   Tokens mirrored from the main Webmindex editorial theme.
   This file is loaded only by the Brief theme.
   ========================================================================== */

:root {
	--color-bg: #0a0a0a;
	--color-text: #ffffff;
	--color-muted: #8a8a8a;
	--color-dim: #777777;
	--color-line: #333333;
	--color-pill-border: rgba(255, 255, 255, 0.18);
	--color-pill-hover: rgba(255, 255, 255, 0.45);

	--color-pure-white: #ffffff;
	--color-ink-black: #000000;

	--font-sans: 'Inter Tight', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	--text-body-lg: 16px;
	--leading-body-lg: 1.7;
	--tracking-meta: 0.019em;

	--text-h1: clamp(52px, 7.8vw, 90px);
	--leading-h1: 1.02;
	--tracking-h1: -0.03em;

	--text-h2: clamp(36px, 5.2vw, 64px);
	--leading-h2: 1.06;
	--tracking-h2: -0.03em;

	--page-padding: 48px;
	--page-padding-mobile: 20px;
	--header-height: clamp(80px, 10vh, 104px);
	--content-max: 1080px;
	--radius-pill: 999px;

	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--duration: 0.3s;
}

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

html {
	-webkit-text-size-adjust: 100%;
	overflow-x: hidden;
	background: var(--color-bg);
}

body.brief-body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: var(--font-sans);
	font-size: var(--text-body-lg);
	font-weight: 400;
	line-height: var(--leading-body-lg);
	letter-spacing: var(--tracking-meta);
	color: var(--color-text);
	background: var(--color-bg);
	-webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
	font-family: inherit;
	color: inherit;
}

input,
textarea,
select {
	color-scheme: dark;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

h1, h2, h3, p, ul, figure {
	margin: 0;
}

button {
	font: inherit;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

::selection {
	background: var(--color-pure-white);
	color: var(--color-ink-black);
}

.brief-skip {
	position: absolute;
	left: 16px;
	top: -48px;
	z-index: 400;
	padding: 8px 12px;
	background: var(--color-pure-white);
	color: var(--color-ink-black);
	font-size: 13px;
}

[hidden] {
	display: none !important;
}

.brief-nav[hidden],
.brief-screen[hidden] {
	display: none !important;
}

.brief-app {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.brief-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--color-bg);
}

.brief-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: var(--header-height);
	padding: 24px clamp(20px, 4vw, 50px);
}

.brief-logo {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 0;
}

.brief-logo__img {
	display: block;
	height: 26px;
	width: auto;
}

.brief-header__tools {
	display: flex;
	align-items: flex-end;
	gap: 28px;
	flex-shrink: 0;
}

.brief-lang {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.14em;
	line-height: 1;
	padding-bottom: 1px;
}

.brief-lang__btn {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	color: #777777;
	cursor: pointer;
	font: inherit;
	letter-spacing: inherit;
}

.brief-lang__btn.is-active {
	color: var(--color-pure-white, #ffffff);
}

.brief-lang__btn:hover {
	color: #c4c4c4;
}

.brief-lang__btn.is-active:hover {
	color: var(--color-pure-white, #ffffff);
}

.brief-lang__div {
	color: #555555;
	pointer-events: none;
}

.brief-header__progress {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	flex-shrink: 0;
	gap: 10px;
}

.brief-header__count {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.14em;
	line-height: 1;
	color: #c4c4c4;
	white-space: nowrap;
}

.brief-header__bar {
	width: 168px;
	height: 1px;
	background: #333333;
	overflow: hidden;
}

.brief-header__bar-fill {
	display: block;
	height: 100%;
	width: 20%;
	background: var(--color-pure-white);
	transform-origin: left center;
	transition: width var(--duration) var(--ease);
}

/* --------------------------------------------------------------------------
   Main / screens
   -------------------------------------------------------------------------- */

.brief-main {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 0 clamp(20px, 4vw, 50px) clamp(32px, 5vh, 56px);
}

.brief-form {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--content-max);
	margin: 0 auto;
	min-width: 0;
}

.brief-screen {
	display: none;
	flex: 1 1 auto;
	min-width: 0;
}

.brief-screen.is-active {
	display: flex;
	flex-direction: column;
	animation: brief-in var(--duration) var(--ease);
}

.brief-screen.is-leaving {
	display: flex;
	flex-direction: column;
	animation: brief-out 0.3s ease forwards;
}

@keyframes brief-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes brief-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(-6px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.brief-screen.is-active,
	.brief-screen.is-leaving,
	.brief-header__bar-fill,
	.brief-cta,
	.brief-pill,
	.brief-cta::before {
		animation: none;
		transition: none;
	}
}

/* --------------------------------------------------------------------------
   Intro / success
   -------------------------------------------------------------------------- */

.brief-intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	flex: 1 1 auto;
	max-width: 820px;
	padding-block: clamp(48px, 12vh, 140px) clamp(40px, 8vh, 96px);
}

.brief-intro__title {
	font-size: var(--text-h1);
	font-weight: 500;
	line-height: var(--leading-h1);
	letter-spacing: var(--tracking-h1);
	max-width: 18ch;
}

.brief-intro__lead {
	margin-top: clamp(20px, 2.4vw, 32px);
	max-width: 42em;
	font-size: clamp(16px, 1.2vw, 18px);
	line-height: 1.7;
	color: var(--color-muted);
}

.brief-intro .brief-cta,
.brief-intro--success .brief-cta {
	margin-top: clamp(36px, 5vh, 56px);
}

.brief-intro__meta {
	margin-top: 18px;
	font-size: 13px;
	letter-spacing: 0.02em;
	color: var(--color-dim);
}

.brief-status {
	margin-bottom: 20px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   Step layout
   -------------------------------------------------------------------------- */

.brief-step {
	padding-top: clamp(28px, 5vh, 64px);
	padding-bottom: 24px;
}

.brief-step__title {
	font-size: var(--text-h2);
	font-weight: 500;
	line-height: var(--leading-h2);
	letter-spacing: var(--tracking-h2);
	max-width: 16ch;
	margin-bottom: clamp(36px, 5vh, 56px);
}

.brief-fields {
	display: flex;
	flex-direction: column;
	gap: clamp(56px, 7vh, 80px);
	min-width: 0;
}

.brief-fields > .brief-field.is-reveal:not(.is-open) {
	display: none;
}

.brief-fields > .brief-field.is-reveal.is-open {
	display: block;
	grid-template-rows: none;
	max-height: none;
	opacity: 1;
	margin-top: 0;
	overflow: visible;
	pointer-events: auto;
	transform: none;
}

.brief-grid {
	display: grid;
	gap: clamp(16px, 2vw, 28px);
}

.brief-grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.brief-field {
	min-width: 0;
}

.brief-field.is-reveal {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	max-height: 0;
	margin-top: 0;
	overflow-x: clip;
	overflow-y: hidden;
	pointer-events: none;
	transform: translateY(-6px);
	transition:
		opacity 0.3s ease,
		max-height 0.3s ease,
		margin-top 0.3s ease,
		transform 0.3s ease;
}

.brief-field.is-reveal > * {
	min-height: 0;
	overflow: hidden;
}

.brief-field.is-reveal.is-open {
	grid-template-rows: 1fr;
	opacity: 1;
	max-height: 160px;
	margin-top: 28px;
	pointer-events: auto;
	transform: translateY(0);
}

.brief-field.is-reveal.is-open.is-reveal--date,
.brief-field.is-reveal[data-reveal="deadline"].is-open {
	margin-top: 46px;
	max-height: 180px;
}

.brief-field.is-reveal.is-open.is-reveal--choices {
	max-height: 720px;
}

.brief-label {
	display: block;
	margin-bottom: 28px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #ffffff;
}

.brief-label--soft {
	margin-top: 16px;
	margin-bottom: 12px;
	color: var(--color-muted);
}

.brief-label span {
	color: #ffffff;
}

.brief-hint {
	margin-top: 8px;
	font-size: 13px;
	color: var(--color-dim);
}

.brief-note {
	margin: 22px 0 0;
	max-width: 700px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.7;
	letter-spacing: 0.01em;
	color: var(--color-muted);
}

.brief-error {
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--color-text);
}

.brief-error[hidden] {
	display: none;
}

.brief-form-error {
	margin-top: 16px;
	font-size: 14px;
	color: var(--color-text);
}

.brief-form-error[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   Inputs — underline, no boxes
   -------------------------------------------------------------------------- */

.brief-input {
	display: block;
	width: 100%;
	min-width: 0;
	padding: 8px 0 10px;
	border: 0;
	border-bottom: 1px solid var(--color-line);
	border-radius: 0;
	background: transparent;
	color: var(--color-text);
	font-size: clamp(16px, 1.05vw, 18px);
	font-weight: 400;
	line-height: 1.45;
	box-shadow: none;
	outline: none;
	appearance: none;
	transition: border-color 0.25s ease;
}

.brief-input::placeholder {
	color: var(--color-dim);
}

.brief-input:focus {
	border-bottom-color: var(--color-pure-white);
}

.brief-input[aria-invalid="true"] {
	border-bottom-color: var(--color-pure-white);
}

.brief-input--area {
	resize: none;
	overflow-y: auto;
	min-height: 96px;
	max-height: 240px;
	line-height: 1.6;
}

.brief-input--date {
	color-scheme: dark;
	max-width: 100%;
}

.brief-input--date::-webkit-calendar-picker-indicator {
	display: none;
	-webkit-appearance: none;
	appearance: none;
	opacity: 0;
	width: 0;
	height: 0;
	padding: 0;
	margin: 0;
	pointer-events: none;
}

.brief-input--date::-webkit-inner-spin-button,
.brief-input--date::-webkit-clear-button {
	display: none;
	-webkit-appearance: none;
}

.brief-input--date::-webkit-datetime-edit-fields-wrapper {
	padding: 0;
}

.brief-input--date::-moz-calendar-picker-indicator {
	display: none;
	opacity: 0;
}

/* --------------------------------------------------------------------------
   Pills
   -------------------------------------------------------------------------- */

.brief-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.brief-pills--stack {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.brief-pills--thirds {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.brief-pills--wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.brief-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 46px;
	padding: 12px 22px;
	border: 1px solid var(--color-pill-border);
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--color-text);
	font-size: clamp(14px, 0.95vw, 16px);
	font-weight: 400;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	transition:
		background-color 0.25s ease,
		color 0.25s ease,
		border-color 0.25s ease;
}

.brief-pills--stack .brief-pill,
.brief-pills--thirds .brief-pill {
	width: 100%;
}

.brief-pill input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.brief-pill:has(input:checked),
.brief-pill.is-selected {
	background: var(--color-pure-white);
	border-color: var(--color-pure-white);
	color: var(--color-ink-black);
}

.brief-pill:has(input:focus-visible) {
	outline: 2px solid var(--color-pure-white);
	outline-offset: 3px;
}

.brief-pills[aria-invalid="true"] .brief-pill {
	border-color: var(--color-pill-hover);
}

/* --------------------------------------------------------------------------
   Consent checkbox
   -------------------------------------------------------------------------- */

.brief-check {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.55;
	color: var(--color-muted);
}

.brief-check input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.brief-check__box {
	display: block;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	border: 1px solid var(--color-pure-white);
	background: transparent;
	transition: background-color 0.2s ease;
}

.brief-check:has(input:checked) .brief-check__box {
	background: var(--color-pure-white);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%23000' stroke-width='1.4' d='M2 6.2l2.6 2.6L10 3.4'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px;
}

.brief-check:has(input:focus-visible) .brief-check__box {
	outline: 2px solid var(--color-pure-white);
	outline-offset: 3px;
}

.brief-check__text a {
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

/* --------------------------------------------------------------------------
   References
   -------------------------------------------------------------------------- */

.brief-refs {
	display: flex;
	flex-direction: column;
	gap: 56px;
	align-items: flex-start;
}

.brief-ref {
	display: flex;
	flex-direction: column;
	gap: 32px;
	width: 100%;
	min-width: 0;
}

.brief-ref[hidden] {
	display: none !important;
}

.brief-ref__item {
	width: 100%;
	min-width: 0;
}

.brief-input--ref-note {
	min-height: 72px;
	max-height: 160px;
}

.brief-add-ref {
	font-size: 14px;
	letter-spacing: 0.02em;
	color: var(--color-muted);
	text-decoration: underline;
	text-underline-offset: 4px;
	min-height: 44px;
}

.brief-add-ref[hidden] {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Upload
   -------------------------------------------------------------------------- */

.brief-upload {
	min-width: 0;
}

.brief-upload__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.brief-upload__drop {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	min-height: 92px;
	padding: 22px 0;
	border: 0;
	border-top: 1px solid var(--color-line);
	border-bottom: 1px solid var(--color-line);
	background: transparent;
	cursor: pointer;
	font-size: 16px;
	line-height: 1.5;
	transition: border-color 0.25s ease;
}

.brief-upload.is-dragover .brief-upload__drop {
	border-color: var(--color-pure-white);
}

.brief-upload__hint {
	font-size: 13px;
	color: var(--color-dim);
}

.brief-upload__list {
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.brief-upload__list[hidden] {
	display: none;
}

.brief-upload__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--color-line);
	font-size: 14px;
}

.brief-upload__remove {
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   CTA + nav
   -------------------------------------------------------------------------- */

.brief-cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	overflow: hidden;
	min-height: 52px;
	padding: 14px 28px;
	border: 1px solid var(--color-pure-white);
	border-radius: var(--radius-pill);
	background: var(--color-pure-white);
	color: var(--color-ink-black);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: transform 0.45s var(--ease);
}

.brief-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--color-ink-black);
	transform: translateX(-101%);
	transition: transform 0.45s var(--ease);
	z-index: 1;
}

.brief-cta span {
	position: relative;
	z-index: 2;
}

.brief-cta:disabled {
	opacity: 0.45;
	pointer-events: none;
	transform: none;
}

.brief-cta:focus-visible {
	outline: 2px solid var(--color-pure-white);
	outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	.brief-cta:hover::before,
	.brief-cta:focus-visible::before {
		transform: translateX(0);
	}

	.brief-cta:hover,
	.brief-cta:focus-visible {
		color: var(--color-pure-white);
		transform: translateY(-2px);
	}

	.brief-pill:hover {
		border-color: var(--color-pill-hover);
	}

	.brief-nav__back:hover {
		color: #ffffff;
		opacity: 0.72;
		transform: translateX(-3px);
		text-decoration-color: #ffffff;
	}

	.brief-add-ref:hover {
		color: var(--color-text);
	}

	.brief-check__text a:hover {
		opacity: 0.7;
	}

	.brief-upload__drop:hover {
		border-color: var(--color-pure-white);
	}

	.brief-upload__remove:hover {
		color: var(--color-text);
	}

	.brief-input:hover {
		border-bottom-color: var(--color-pill-hover);
	}
}

.brief-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: auto;
	padding-top: clamp(28px, 4vh, 48px);
}

.brief-nav[hidden] {
	display: none;
}

.brief-nav__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: #ffffff;
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
	text-decoration-color: rgba(255, 255, 255, 0.4);
	min-height: 44px;
	cursor: pointer;
	transition:
		color 0.25s ease,
		opacity 0.25s ease,
		transform 0.25s ease,
		text-decoration-color 0.25s ease;
}

.brief-nav__back:focus-visible {
	color: #ffffff;
	text-decoration-color: #ffffff;
}

.brief-nav__next {
	margin-left: auto;
}

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

@media (min-width: 1100px) {
	.brief-form {
		width: 76%;
	}
}

@media (max-width: 900px) {
	.brief-step {
		padding-top: clamp(16px, 3vh, 32px);
	}

	.brief-pills--stack,
	.brief-pills--thirds {
		grid-template-columns: 1fr;
	}

	.brief-grid--2 {
		grid-template-columns: 1fr;
	}

	.brief-intro__title,
	.brief-step__title {
		max-width: none;
	}
}

@media (max-width: 640px) {
	.brief-header__inner {
		padding-block: 20px;
	}

	.brief-logo__img {
		height: 22px;
	}

	.brief-header__bar {
		width: 108px;
	}

	.brief-header__count {
		font-size: 13px;
	}

	.brief-header__tools {
		gap: 16px;
	}

	.brief-lang {
		font-size: 12px;
		gap: 6px;
	}

	.brief-intro {
		padding-block: 36px 48px;
	}

	.brief-cta,
	.brief-nav__next {
		width: 100%;
	}

	.brief-nav {
		flex-wrap: wrap;
	}

	.brief-nav__back {
		order: 2;
		width: 100%;
		justify-content: center;
	}

	.brief-nav__next {
		order: 1;
		width: 100%;
		margin-left: 0;
	}

	.brief-pill {
		min-height: 48px;
		width: 100%;
	}

	.brief-pills--wrap .brief-pill {
		width: auto;
		flex: 1 1 auto;
	}
}

@media (max-width: 380px) {
	.brief-intro__title {
		font-size: clamp(36px, 11vw, 48px);
	}

	.brief-step__title {
		font-size: clamp(28px, 8vw, 36px);
	}
}

.brief-hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
