/**
 * Primitive — Input
 *
 * Expected HTML: <input type="text" class="ec-input" data-material="water">
 *
 * Water material throughout (EC-DESIGN-SYSTEM.md, Form controls) —
 * data-material defaults to neutral if omitted; usage convention is to
 * set it to water for the trust-context treatment forms belong to.
 * ec-input--error is the one shared validation/error treatment used
 * across every form control primitive in this set.
 */

.ec-input {
	display: block;
	width: 100%;
	/* Reporting Deep-Dive pass (2026-09-15) — box-sizing was never set
	   here, so `width: 100%` measured the CONTENT box only; padding/
	   border were then added on top, a couple of px past the parent's
	   own edge. Harmless at most viewport widths (the overflow rounds
	   away), but visible as a real, if tiny, horizontal scroll on a
	   375px form (first caught on the new Costs report's own form).
	   `border-box` is the correct, standard fix and only ever tightens
	   layout — never a behaviour change worth withholding for review,
	   unlike the separate, already-documented "no sitewide `*` reset
	   without review" caution this is deliberately narrower than. */
	box-sizing: border-box;
	min-height: 2.75rem; /* matches ec-button--md, the shared control height */
	padding: var(--ec-space-3) var(--ec-space-4);
	border: 1px solid var(--ec-color-border);
	border-radius: var(--ec-radius-sm);
	background-color: var(--ec-color-surface);
	color: var(--ec-color-text-primary);
	font-family: var(--ec-font-family-base);
	font-size: var(--ec-font-size-body);
	line-height: var(--ec-line-height-base);
	transition: border-color var(--ec-duration-base) var(--ec-ease-standard);
}

.ec-input::placeholder {
	color: var(--ec-color-text-secondary);
}

.ec-input:focus-visible {
	outline: 2px solid var(--ec-material-color);
	outline-offset: 2px;
	border-color: var(--ec-material-color);
}

.ec-input[disabled] {
	background-color: var(--ec-color-surface-elevated);
	color: var(--ec-color-text-secondary);
	cursor: not-allowed;
	opacity: 0.7;
}

.ec-input--error {
	border-color: var(--ec-color-danger);
}

/**
 * Currency adornment — same wrapper + pseudo-element technique as
 * .ec-select-wrapper (primitives/select.css), applied to a plain
 * .ec-input instead of a <select>. Storage/validation are entirely
 * unaffected — this is presentation only, the input's own type/name/
 * value are untouched.
 *
 * Expected HTML:
 *   <span class="ec-input-currency">
 *     <input type="number" class="ec-input" data-material="water">
 *   </span>
 */
.ec-input-currency {
	position: relative;
	display: block;
}

.ec-input-currency::before {
	content: '£';
	position: absolute;
	top: 50%;
	left: var(--ec-space-4);
	transform: translateY(-50%);
	color: var(--ec-color-text-secondary);
	font-family: var(--ec-font-family-base);
	font-size: var(--ec-font-size-body);
	pointer-events: none;
}

/* This codebase has no sitewide box-sizing:border-box reset (a known,
   already-documented gap — see hq-management.css/hq-draws.css's own
   identical fixes for other controls). .ec-input is therefore
   content-box by default: adding extra left padding here, on top of
   its existing width:100%, made a currency-adorned input render wider
   than its own grid cell and collide with the field beside it inside
   .ec-hq-form-grid (Winner Detail Fulfilment Workflow Correction,
   2026-09-07 bug report) — width:100% must include the padding for a
   two-column grid row to line up with the plain-text row below it. */
.ec-input-currency .ec-input {
	box-sizing: border-box;
	padding-left: var(--ec-space-7);
}
