/* ==========================================================
   Arena Times Contact Form — Elementor widget
   Field row (custom % width per field, e.g. 25/33/50/70/100 —
   the widget's Width slider sets it inline per field), inputs/
   textarea/select, checkbox, submit button, messages.
   ========================================================== */

.arena-contact-form {
	width: 100%;
}

/* ── Field row — flexbox with a classic "gutter" pair (container
      pulls in, each field pads back out by the same amount) instead
      of the `gap` property, so arbitrary widths like 33% or 70% stay
      exact — a plain flex `gap` would eat into percentage widths and
      wrap a field that was meant to still fit on the same row.
      Column Gap / Row Gap controls (Style tab) set the margin/padding
      and margin-bottom below. ── */
.arena-contact-fields {
	display: flex;
	flex-wrap: wrap;
}

.arena-contact-field {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-width: 0;
}

.arena-contact-field__label {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
}

.arena-contact-field__req {
	line-height: 1;
}

.arena-contact-field__error {
	display: block;
	font-size: 12px;
	color: #dc2626;
	min-height: 0;
}
/* Empty (no error yet) — remove it from the flex layout entirely so it
   doesn't still eat a Label ↔ Field Gap's worth of space below the field. */
.arena-contact-field__error:empty {
	display: none;
}

/* ── Inputs / textarea / select ── */
.arena-contact-input,
.arena-contact-textarea.arena-contact-textarea,
.arena-contact-select {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #d5dbe0;
	background: #ffffff;
	color: #1d2327;
	font: inherit;
	font-size: 14px;
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.arena-contact-textarea.arena-contact-textarea {
	height: 120px;
	resize: vertical;
}

.arena-contact-select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px !important;
}

/* Error state wins over both the default border AND the focus ring —
   the field stays flagged red until the value is actually corrected. */
.arena-contact-field.has-error .arena-contact-input,
.arena-contact-field.has-error .arena-contact-textarea,
.arena-contact-field.has-error .arena-contact-select {
	border-color: #dc2626;
}

/* ── Checkbox field ── */
.arena-contact-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
}
.arena-contact-checkbox input {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	margin-top: 3px;
	cursor: pointer;
}
.arena-contact-checkbox span {
	font-size: 14px;
	line-height: 1.5;
}

/* ── Honeypot — off-screen, not display:none (some bots skip that) ── */
.arena-contact-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ── Messages ── */
.arena-contact-msg {
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13.5px;
	line-height: 1.5;
	margin-top: 16px;
}

/* ── Submit button ──
   The button is a Button under the hood (.etb-button / .etb-arrow-circle
   — same classes as arena-button.php) so both widgets share one look and
   one set of Style controls. Button only defines these base rules
   via an inline <style> in its own render(), which isn't on the page when
   Contact Form is used alone — so the same base rules are duplicated here
   to keep Contact Form self-sufficient. */
/* margin-top comes entirely from the widget's "Gap Above Button" control
   (Style → Layout) — no static fallback here, same pattern as Row/Column Gap. */
.arena-contact-form__foot {
	display: flex;
}

.etb-button {
	display: inline-flex;
	align-items: center;
	font-family: inherit;
	text-decoration: none;
	transition: all 0.25s ease;
}

.etb-arrow-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.3s ease; /* overridden by the Icon Transition control */
}

.etb-arrow-circle svg {
	fill: currentColor;
	stroke: currentColor;
}

/* Contact Form-specific: it's a <button>, not an <a>, so add the reset
   + the loading/disabled state the JS toggles while the request is in flight. */
.arena-contact-btn.arena-contact-btn {
	border: none;
	cursor: pointer;
}
.arena-contact-btn:disabled {
	opacity: .7;
	cursor: not-allowed;
}

/* ── Responsive: every field stacks full width on narrow screens,
      whatever % it's set to on desktop — !important is required here
      since each field's width comes from an inline style attribute. ── */
@media (max-width: 600px) {
	.arena-contact-field {
		width: 100% !important;
	}
}

/* The browser paints its own focus ring at :focus-visible, which the base
   rule's `outline: none` does not reach — it sits on the unfocused state.
   Suppressing it here, at the same state it appears in, means the field
   shows exactly one focus indicator: whatever the widget's Focus controls
   set (they write outline-width/color explicitly and win from
   {{WRAPPER}}). Keyboard users still get a visible focus: the border
   colour and the ring both change. */
.arena-contact-input:focus,
.arena-contact-input:focus-visible,
.arena-contact-textarea:focus,
.arena-contact-textarea:focus-visible,
.arena-contact-select:focus,
.arena-contact-select:focus-visible {
	outline: 0 solid transparent;
	outline-offset: 2px;
}

/* ── Inline layout: fields and button on one row - a subscribe bar ──
   The stacked layout's spacing is all margins (Row Gap, Column Gap, Gap
   Above Button), and those controls are hidden - so write no CSS - when
   Inline is chosen. Here a single flex gap does the job instead, 0 by
   default so field and button join into one bar. Logical properties and
   flex order, so it mirrors for right-to-left without the RTL file. */
.arena-contact-form--inline {
	--arena-cf-inline-gap: 0px;
}

/* With labels showing, the button lines up with the bottom of the inputs;
   without them (a subscribe bar) field and button are exactly one height. */
.arena-contact-form--inline .arena-contact-inline {
	display: flex;
	align-items: flex-end;
	gap: var(--arena-cf-inline-gap);
}

.arena-contact-form--inline.arena-contact-form--no-labels .arena-contact-inline {
	align-items: stretch;
}

.arena-contact-form--inline .arena-contact-fields {
	flex: 1 1 auto;
	flex-wrap: nowrap;
	gap: var(--arena-cf-inline-gap);
	min-width: 0;
}

/* Each field shrinks from its set width to share the row with the button. */
.arena-contact-form--inline .arena-contact-field {
	position: relative;
	flex: 1 1 auto;
}

/* The field fills the row's height, so it always matches the button. */
.arena-contact-form--inline .arena-contact-field .arena-contact-input,
.arena-contact-form--inline .arena-contact-field .arena-contact-select {
	flex: 1 1 auto;
}

/* An error hangs below the field instead of pushing the row out of line. */
.arena-contact-form--inline .arena-contact-field__error {
	position: absolute;
	inset-block-start: calc(100% + 6px);
	inset-inline-start: 0;
}

.arena-contact-form--inline .arena-contact-form__foot {
	flex: 0 0 auto;
}

.arena-contact-form--inline .arena-contact-btn {
	justify-content: center;
}

@media (max-width: 600px) {
	.arena-contact-form--inline-stack .arena-contact-inline,
	.arena-contact-form--inline-stack .arena-contact-fields {
		flex-direction: column;
	}

	.arena-contact-form--inline-stack .arena-contact-btn {
		width: 100%;
	}

	/* Stacked, the button sits right under the field - the error goes
	   back in the flow so it pushes the button down, not covers it. */
	.arena-contact-form--inline-stack .arena-contact-field__error {
		position: static;
	}
}
