/* ==========================================================================
   WebGx Pro — base.css
   Tokens (aliases of theme.json presets), reset, typography, forms.
   ========================================================================== */

:root {
	--color-brand-primary: var(--wp--preset--color--brand-primary, #14324A);
	--color-brand-secondary: var(--wp--preset--color--brand-secondary, #1C7C8A);
	--color-accent: var(--wp--preset--color--accent, #E3A008);

	--color-background: var(--wp--preset--color--background, #F7F8F7);
	--color-background-alt: var(--wp--preset--color--background-alt, #EDF1F0);
	--color-surface: var(--wp--preset--color--surface, #FFFFFF);
	--color-surface-raised: #FFFFFF;
	--color-dark: var(--wp--preset--color--dark, #0F1C26);
	--color-dark-alt: var(--wp--preset--color--dark-alt, #16283A);

	--color-text: var(--wp--preset--color--text, #17232C);
	--color-text-muted: var(--wp--preset--color--text-muted, #56656F);
	--color-heading: var(--wp--preset--color--heading, #0F1C26);
	--color-text-on-dark: #E9EEF2;
	--color-text-muted-on-dark: #9FB0BC;

	--color-border: var(--wp--preset--color--border, #D5DDDC);
	--color-border-strong: #AEBBB9;

	--color-success: #1E7F4F;
	--color-warning: #B26A00;
	--color-error: #B3261E;
	--color-focus: #1C7C8A;

	--radius-sm: var(--wp--custom--radius--sm, 6px);
	--radius-md: var(--wp--custom--radius--md, 10px);
	--radius-lg: var(--wp--custom--radius--lg, 16px);
	--radius-pill: 999px;

	--shadow-sm: var(--wp--custom--shadow--sm, 0 1px 2px rgba(15,28,38,.06));
	--shadow-md: var(--wp--custom--shadow--md, 0 8px 24px rgba(15,28,38,.08));
	--shadow-lg: var(--wp--custom--shadow--lg, 0 20px 48px rgba(15,28,38,.12));

	--motion-fast: var(--wp--custom--motion--fast, 140ms);
	--motion-normal: var(--wp--custom--motion--normal, 240ms);
	--motion-slow: var(--wp--custom--motion--slow, 420ms);
	--ease: var(--wp--custom--motion--ease, cubic-bezier(.2,.7,.2,1));

	--space-4: 0.25rem;  --space-8: 0.5rem;   --space-12: 0.75rem; --space-16: 1rem;
	--space-24: 1.5rem;  --space-32: 2rem;    --space-48: 3rem;
	--space-64: clamp(3rem, 6vw, 4rem);
	--space-80: clamp(3.5rem, 7vw, 5rem);
	--space-96: clamp(4rem, 8vw, 6rem);
	--space-128: clamp(5rem, 10vw, 8rem);

	--font-sans: var(--wp--preset--font-family--sans, "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	--font-mono: var(--wp--preset--font-family--mono, ui-monospace, Menlo, Consolas, monospace);

	--text-caption: var(--wp--preset--font-size--caption, 0.75rem);
	--text-small: var(--wp--preset--font-size--small, 0.875rem);
	--text-body: var(--wp--preset--font-size--body, 1rem);
	--text-body-large: var(--wp--preset--font-size--body-large, 1.125rem);
	--text-h5: var(--wp--preset--font-size--h5, 1.125rem);
	--text-h4: var(--wp--preset--font-size--h4, 1.375rem);
	--text-h3: var(--wp--preset--font-size--h3, 1.75rem);
	--text-h2: var(--wp--preset--font-size--h2, clamp(2rem, 4vw, 3rem));
	--text-h1: var(--wp--preset--font-size--h1, clamp(2.375rem, 5.5vw, 4rem));
	--text-display: var(--wp--preset--font-size--display, clamp(2.75rem, 7vw, 5.25rem));

	--container: 1240px;
	--container-narrow: 760px;
	--gutter: clamp(1rem, 4vw, 2rem);
	--header-height: 72px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--text-body);
	line-height: 1.6;
	color: var(--color-text);
	background: var(--color-background);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
img { font-style: italic; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--color-brand-secondary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--color-brand-primary); }
:where(h1, h2, h3, h4, h5, h6) { color: var(--color-heading); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: var(--text-h1); line-height: 1.05; letter-spacing: -.03em; }
h2 { font-size: var(--text-h2); line-height: 1.08; }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); letter-spacing: -.01em; }
h5 { font-size: var(--text-h5); letter-spacing: 0; }
h6 { font-size: var(--text-body); letter-spacing: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.3em; }
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-32) 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
pre { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
th { font-weight: 600; color: var(--color-heading); }
::selection { background: var(--color-accent); color: var(--color-heading); }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 3px; }
.skip-link {
	position: absolute; left: 1rem; top: -100%; z-index: 1000;
	padding: .75rem 1rem; background: var(--color-brand-primary); color: #fff; border-radius: var(--radius-md); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); white-space: nowrap; }

/* ---------- dark surfaces ---------- */
.is-style-section-dark, .wgx-dark, .has-dark-background-color, .has-dark-alt-background-color {
	--color-text: var(--color-text-on-dark);
	--color-text-muted: var(--color-text-muted-on-dark);
	--color-heading: #FFFFFF;
	--color-surface: rgba(255,255,255,.04);
	--color-surface-raised: #16283A;
	--color-border: rgba(255,255,255,.14);
	--color-border-strong: rgba(255,255,255,.3);
	--color-background-alt: rgba(255,255,255,.06);
	color: var(--color-text);
}
.is-style-section-dark a, .wgx-dark a { color: #8FD1DA; }
.is-style-section-dark a:hover, .wgx-dark a:hover { color: #fff; }

/* ---------- forms (native, CF7, WPForms, Gravity) ---------- */
.wgx-form, .wpcf7, .wpforms-container, .gform_wrapper { --field-bg: var(--color-surface); }
.wgx-field { margin-bottom: var(--space-16); }
.wgx-field label, .wpcf7 label, .wpforms-field-label, .gfield_label { display: block; font-size: var(--text-small); font-weight: 600; color: var(--color-heading); margin-bottom: .4rem; }
.wgx-opt { font-weight: 400; color: var(--color-text-muted); }
.wgx-req { color: var(--color-error); }
.wgx-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-16); }
@media (max-width: 640px) { .wgx-form__row { grid-template-columns: 1fr; } }
.wgx-form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wgx-form__note { font-size: var(--text-small); color: var(--color-text-muted); }

.wgx-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]),
.wgx-form select, .wgx-form textarea,
.wpcf7 input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]), .wpcf7 select, .wpcf7 textarea,
.wpforms-container input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]), .wpforms-container select, .wpforms-container textarea,
.gform_wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]), .gform_wrapper select, .gform_wrapper textarea,
.wp-block-search__input, .wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]), .wp-block-post-comments-form textarea {
	width: 100%; min-height: 48px; padding: .7rem .9rem;
	background: var(--field-bg, var(--color-surface)); color: var(--color-text);
	border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
	transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.wgx-form textarea, .wpcf7 textarea, .wpforms-container textarea, .gform_wrapper textarea { min-height: 150px; resize: vertical; }
.wgx-form select, .wpcf7 select, .wpforms-container select, .gform_wrapper select {
	appearance: none; padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2356656F' stroke-width='1.8'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right .9rem center;
}
.wgx-form :is(input, select, textarea):focus-visible, .wpcf7 :is(input, select, textarea):focus-visible, .wpforms-container :is(input, select, textarea):focus-visible, .gform_wrapper :is(input, select, textarea):focus-visible {
	outline: none; border-color: var(--color-focus); box-shadow: 0 0 0 3px rgba(28,124,138,.2);
}
.wgx-form :is(input, select, textarea):disabled { background: var(--color-background-alt); color: var(--color-text-muted); cursor: not-allowed; }
.wgx-form :is(input, select, textarea)[aria-invalid="true"], .wpcf7-not-valid, .wpforms-error { border-color: var(--color-error) !important; }
.wgx-field--check { display: flex; gap: .7rem; align-items: flex-start; }
.wgx-field--check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--color-brand-secondary); flex: none; }
.wgx-field--check label { font-weight: 400; font-size: var(--text-small); color: var(--color-text); margin: 0; }
input[type="file"] { padding: .6rem 0; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--color-brand-secondary); width: 18px; height: 18px; }

/* Plugin-specific tidy-ups */
.wpcf7-form-control-wrap { display: block; margin-bottom: var(--space-16); }
.wpcf7-not-valid-tip, .wpforms-error, .gfield_validation_message, .validation_message { color: var(--color-error); font-size: var(--text-small); margin-top: .35rem; }
.wpcf7-response-output { padding: 1rem; border-radius: var(--radius-md); border: 1px solid var(--color-border); margin: var(--space-16) 0 0 !important; }
.wpcf7-mail-sent-ok, .wpcf7 form.sent .wpcf7-response-output { border-color: var(--color-success); background: rgba(30,127,79,.08); }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output { border-color: var(--color-error); background: rgba(179,38,30,.08); }
.wpcf7-submit, .wpforms-submit, .gform_button, .wp-block-search__button, .wp-block-post-comments-form input[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .8rem 1.4rem;
	background: var(--color-brand-primary) !important; color: #fff !important; border: 0 !important; border-radius: var(--radius-md); font-weight: 600; cursor: pointer;
	transition: background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.wpcf7-submit:hover, .wpforms-submit:hover, .gform_button:hover, .wp-block-search__button:hover { background: var(--color-brand-secondary) !important; }
.wpforms-container .wpforms-field { padding: 0 0 var(--space-16) !important; }
.gform_wrapper .gfield { margin-bottom: var(--space-16); }

/* ---------- notices ---------- */
.wgx-notice { padding: 1rem 1.1rem; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface); margin-bottom: var(--space-24); font-size: var(--text-small); }
.wgx-notice--success { border-color: var(--color-success); background: rgba(30,127,79,.08); }
.wgx-notice--error { border-color: var(--color-error); background: rgba(179,38,30,.08); }
.wgx-notice--warning { border-color: var(--color-warning); background: rgba(178,106,0,.08); }
.wgx-notice--info { border-color: var(--color-brand-secondary); background: rgba(28,124,138,.08); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
