/*
   AWWO® Forms - Frontend
   Base structural styling for [awwo_form] — per-form colors/radii/weight
   are injected inline by cw_awwo_nt_forms_render() (cw-awwo-nt-forms-frontend.php)
   right above the markup, so this file only ever covers what every form
   shares regardless of its own Styling box values.
   @package cw-awwo-nt
*/

/**
 * © AWWO® (Advertise What We Offer)
 * Unauthorized use, copying, modification, distribution, or reverse engineering is strictly prohibited without prior written authorization from CITIPRO WORLD®.
 * @license LicenseRef-Proprietary
 */

.cw-awwo-nt-forms-form {
	box-sizing: border-box;
	/* A theme's own form spacing (Flatsome: 1.3em below every form)
	   stays out — the space around a form is the page's, inside it the
	   form's own gaps. */
	margin: 0;
	/* The form's own baseline, so the page around it doesn't reach inside
	   (on request: a theme's 28px body line height made every label and
	   counter 38px tall, a centred page section centred the labels). The
	   form's own settings (label/input/button alignment, its <style>)
	   are more specific and still win. */
	line-height: normal;
	text-align: left;
}

/* A theme's own textarea rule (BeTheme: 20px lines, 60px at least;
   Flatsome: a fixed 2.5em height) stays out: the Message box is as tall
   as its rows. */
.cw-awwo-nt-forms-form textarea {
	line-height: normal;
	min-height: 0;
	height: auto;
	max-height: none;
}

/* Forms set their own fields' and buttons' look — nothing a theme gives
   every input or button reaches them: Flatsome's button margins,
   minimum sizes and letter spacing, its field max-width and select
   display. The Security
   Check window keeps the login form's look (see below). */
.cw-awwo-nt-forms-form :is(input, select, textarea) {
	max-width: 100%;
}

.cw-awwo-nt-forms-form .cw-awwo-nt-forms-phone-country {
	display: block;
}

.cw-awwo-nt-forms-form button:not(:where(.cw-awwo-nt-forms-captcha-modal *)) {
	margin: 0;
	min-height: 0;
	min-width: 0;
	letter-spacing: normal;
}

.cw-awwo-nt-forms-form .cw-awwo-nt-forms-field {
	max-width: 100%;
}

/* Not inside the Security Check window (Captcha Protection In Modal): its
   captcha keeps the look it has on the login form, WordPress and WooCommerce. */
.cw-awwo-nt-forms-form label:not(:where(.cw-awwo-nt-forms-captcha-modal *)) {
	display: block;
	font-size: 14px;
}

.cw-awwo-nt-forms-field-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.cw-awwo-nt-forms-field-label-row label {
	flex: 1 1 auto;
}

/* Guarantees this row always has the height of one real line of the
   form's own label font, whether or not it currently holds visible
   text — label position "inside" (cw_awwo_nt_forms_render_field())
   hides the real label text entirely (display:none, no line box of
   its own), which otherwise collapses this row to 0px while a
   submit/captcha field sharing the row still reserves a full line
   for its own invisible placeholder label (align_with_row, same
   file) — an invisible zero-width \00a0 always renders regardless,
   so every row's own label keeps the same line height and both stay
   top-aligned. width:0 + overflow:hidden keeps it from ever taking
   visible space or shifting real label text/the hint next to it. */
.cw-awwo-nt-forms-field-label-row label::before {
	content: "\00a0";
	display: inline-block;
	width: 0;
	overflow: hidden;
}

/* Fixed warning red, independent of the Styling box's own label color —
   deliberately not part of the per-form <style> block
   (cw_awwo_nt_forms_render(), cw-awwo-nt-forms-frontend.php) since this
   color is never meant to be themeable: it's the same "something's
   required of this input" signal regardless of a form's own palette.
   Font-weight is NOT fixed here, though — that follows this form's own
   label weight (see that same per-form <style> block) so the hint reads
   as part of the label row rather than a visually distinct caption.
   display:inline-block + the animation below is what makes the fade-in-
   from-the-right actually play every time cw-awwo-nt-forms-frontend.js
   toggles this from display:none to shown — a CSS animation (unlike a
   transition) runs from its own first frame the moment an element stops
   being display:none, so no JS-driven class juggling is needed to
   replay it on every show. */
.cw-awwo-nt-forms-field-hint {
	display: inline-block;
	color: #DB4437 !important;
	animation: cw-awwo-nt-forms-hint-in .25s ease-out;
}

@keyframes cw-awwo-nt-forms-hint-in {
	from {
		opacity: 0;
		transform: translateX(8px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.cw-awwo-nt-forms-char-counter {
	font-size: 12px;
	color: #8c8f94;
	white-space: nowrap;
	flex: 0 0 auto;
}

.cw-awwo-nt-forms-char-counter-invalid {
	color: #DB4437;
}

.cw-awwo-nt-forms-form textarea {
	resize: vertical;
}

.cw-awwo-nt-forms-message {
	flex: 0 0 100%;
	box-sizing: border-box;
	padding: 10px 14px;
	border-radius: 4px;
	font-size: 14px;
}

.cw-awwo-nt-forms-message-success {
	background: #edfaef;
	color: #1d602c;
	border: 1px solid #b8e6c1;
	text-align: center;
}

.cw-awwo-nt-forms-message-error {
	background: #fcf0f1;
	color: #8a1f24;
	border: 1px solid #f1c6c9;
}

.cw-awwo-nt-forms-submit {
	border: none;
	appearance: none;
}

.cw-awwo-nt-forms-submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Phone field — always an equal 50/50 split between the country-code
   select and the number input, regardless of the field's OWN overall
   width (50%, 100%, whatever Grid Columns/its own width% setting
   gives it) — same idea the existing International Phone Numbers
   WooCommerce feature's own .cw-nt-phone-combined-code/-number pair
   uses (cw-awwo-nt-front.css), just namespaced for Forms. No gap
   between the two columns — they're meant to read as one joined
   control (like the WP color picker's input+swatch pair), not two
   separate fields side by side; the unified border/background/box-shadow
   (on the row itself, stripped from both children entirely) comes from
   cw_awwo_nt_forms_render()'s own per-form <style> block
   (cw-awwo-nt-forms-phone-row/-country/-number rules), not from here. */
.cw-awwo-nt-forms-phone-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	width: 100%;
}

.cw-awwo-nt-forms-phone-col {
	flex: 1 1 50%;
	min-width: 0;
}

.cw-awwo-nt-forms-phone-col select,
.cw-awwo-nt-forms-phone-col input {
	width: 100%;
	box-sizing: border-box;
}

/* Divider field — a purely visual horizontal rule splitting the form
   into sections (cw_awwo_nt_forms_render_field()). The FIELD wrapper
   is always full width (its own flex:0 0 100% is set inline, same as
   response_message's), independent of the RULE's own configured
   divider_width, which is what actually varies — centered inside that
   full-width row via margin:0 auto so a narrower rule reads as
   centered, not left-stuck. */
.cw-awwo-nt-forms-divider-field {
	display: flex;
	box-sizing: border-box;
}

/* Every divider_type (solid/dashed/dotted/double included — see
   cw_awwo_nt_forms_divider_svg_shape()'s own docblock,
   cw-awwo-nt-forms-frontend.php, for why gradient color moved them
   all off a plain CSS border) is a fixed-width <svg> holding one long,
   continuous path now, cropped down to this divider's own width by
   this wrapper's own inline overflow:hidden — never a bordered div,
   so no per-type border-style rules live here any more; what still
   tells solid/dashed/dotted/double apart is each one's own stroke-
   dasharray/second-stroke, set inline per divider
   (cw_awwo_nt_forms_divider_stroke_style()). Height is set inline per
   divider too (each shape's own height — square and rectangular-tall
   aren't the same height, for instance, by design) rather than here. */
.cw-awwo-nt-forms-divider {
	margin: 0 auto;
	display: block;
}

/* Form Steps — the step-circle indicator (cw_awwo_nt_forms_render()),
   rendered once, centered, ABOVE whichever step is currently visible
   (was below, on request — same markup/JS, just moved earlier in the
   form's own DOM order). No separate Previous/Next buttons any more
   either, on request — the circles themselves are real click targets
   now (cwAwwoNtFormsShowStep()'s own click handler, cw-awwo-nt-forms-
   frontend.js), so .cw-awwo-nt-forms-step-nav-btn's own rule is gone
   too. Colors/border/font come from this form's own per-form <style>
   block (that function again) — only structural layout lives here,
   same split every other section already follows. */
.cw-awwo-nt-forms-steps-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	box-sizing: border-box;
}

.cw-awwo-nt-forms-step-indicator {
	display: flex;
	align-items: center;
	gap: 6px;
}

.cw-awwo-nt-forms-step-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	box-sizing: border-box;
	flex: 0 0 auto;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}

.cw-awwo-nt-forms-step-line {
	width: 24px;
	height: 2px;
	flex: 0 0 auto;
}

/* Display logic (cw-awwo-nt-forms-logic.php): hidden by its rules, whatever
   else (Reload Form!, a step, the element's own inline display) says. */
.cw-awwo-nt-forms-logic-hidden {
	display: none !important;
}

/* Captcha Protection In Modal (cw_awwo_nt_forms_render_field(),
   cw-awwo-nt-forms-frontend.php), as AWWO® CMS has it: Security Check
   top left (12px, bold, uppercase, muted), Cancel top right, the check,
   then the form's own button the whole width, 16px apart. The buttons
   and corners are the form's own (its <style> block). */
.cw-awwo-nt-forms-captcha-modal {
	width: min(400px, calc(100vw - 32px));
	max-width: none;
	padding: 24px;
	border: 0;
	background: #fff;
	color: inherit;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
}

.cw-awwo-nt-forms-captcha-modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.cw-awwo-nt-forms-captcha-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}

.cw-awwo-nt-forms-captcha-head h3 {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-align: left;
	text-transform: uppercase;
	opacity: 0.7;
}

.cw-awwo-nt-forms-captcha-check {
	margin: 0 0 16px;
}

/* Another form's Turnstile "in form" locks every .cw-awwo-nt-forms-submit
   on the page with a plain class rule (cw_awwo_nt_cfturnstile_disable_button_styles());
   this window's own buttons are never its to lock. */
.cw-awwo-nt-forms-captcha-modal .cw-awwo-nt-forms-submit {
	pointer-events: auto;
	opacity: 1;
}

.cw-awwo-nt-forms-captcha-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Turnstile's widget as the Configurator's preview shows it
   (cw_awwo_nt_forms_captcha_sample(), cw-awwo-nt-forms-frontend.php): its
   settings' size (Normal 300px, Flexible the form's width but never under
   300px, Compact 150px) and theme, a green tick, Success!, Cloudflare's logo;
   nothing loaded. Its frame (border, corners, shadow) is the form's fields',
   set in the form's own <style>. */
.cw-awwo-nt-forms-turnstile-stand-in {
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	height: 65px;
	padding: 0 14px;
	background: #fafafa;
	color: #232323;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
}

.cw-awwo-nt-forms-turnstile-stand-in.is-size-flexible {
	width: 100%;
	min-width: 300px;
}

.cw-awwo-nt-forms-turnstile-stand-in.is-size-normal {
	width: 300px;
	max-width: 100%;
}

.cw-awwo-nt-forms-turnstile-stand-in.is-size-compact {
	flex-direction: column;
	justify-content: center;
	width: 150px;
	height: 140px;
}

.cw-awwo-nt-forms-turnstile-stand-in.is-size-compact .cw-awwo-nt-forms-turnstile-stand-in-brand {
	margin-left: 0;
}

.cw-awwo-nt-forms-turnstile-stand-in.is-theme-dark {
	background: #232323;
	color: #fafafa;
}

@media (prefers-color-scheme: dark) {
	.cw-awwo-nt-forms-turnstile-stand-in.is-theme-auto {
		background: #232323;
		color: #fafafa;
	}
}

.cw-awwo-nt-forms-turnstile-stand-in-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #038127;
	color: #fff;
}

/* Cloudflare's logo: its wordmark #404041 as Cloudflare draws it, light on
   a dark widget (currentColor in the SVG). */
.cw-awwo-nt-forms-turnstile-stand-in-brand {
	display: inline-flex;
	margin-left: auto;
	color: #404041;
	line-height: 0;
}

.cw-awwo-nt-forms-turnstile-stand-in.is-theme-dark .cw-awwo-nt-forms-turnstile-stand-in-brand {
	color: #fafafa;
}

@media (prefers-color-scheme: dark) {
	.cw-awwo-nt-forms-turnstile-stand-in.is-theme-auto .cw-awwo-nt-forms-turnstile-stand-in-brand {
		color: #fafafa;
	}
}

.cw-awwo-nt-forms-turnstile-stand-in-logo {
	width: 72px;
	height: auto;
}

@media (max-width: 600px) {
	.cw-awwo-nt-forms-form .cw-awwo-nt-forms-field {
		flex-basis: 100% !important;
	}

	/* A Wrap split into columns stacks them too: each column the full width,
	   one under the other, as its fields already are (a 4-column row would
	   otherwise keep four quarter-width columns on a phone). A column left
	   empty only holds a place beside the others, so on its own line it
	   would be a blank gap: it goes. */
	.cw-awwo-nt-forms-form .cw-awwo-nt-forms-column-fields {
		flex-basis: 100% !important;
	}

	.cw-awwo-nt-forms-form .cw-awwo-nt-forms-row-empty-column {
		display: none !important;
	}

	/* "Align with row" keeps an invisible label line above a submit or
	   captcha only to line it up with labelled inputs on the same line.
	   Here every field is stacked on a line of its own, so the line goes and
	   the button sits exactly the form's gap below the field above it. */
	.cw-awwo-nt-forms-form .cw-awwo-nt-forms-field-label-row[aria-hidden="true"] {
		display: none !important;
	}

	/* .cw-awwo-nt-forms-phone-col deliberately NOT forced to
	   flex-basis:100% here the way every other field is above — that
	   split the phone row's own country-select + number-input pair
	   (.cw-awwo-nt-forms-phone-col's own docblock a few lines up: "No
	   gap between the two columns — they're meant to read as one
	   joined control... not two separate fields side by side") onto
	   two stacked lines on mobile, confirmed live as exactly that:
	   the joined control breaking apart into two separate-looking
	   boxes the moment the viewport narrowed. Its own flex:1 1 50%
	   (that same rule, above) already keeps both halves reasonably
	   sized without help from this media query. */
}
