/* ============================================================
   FX360 Contact Form Design System
   Public Shortcode + Admin Preview + Visual Templates
   ------------------------------------------------------------
   Scope:
   - .fx360-contact-form is the single owned root for every form surface.
   - #contactForm stays available only as the public JavaScript hook.
   - All visual form controls are owned by contact-form.css through
     FX360 contact-form classes, not WordPress or theme selectors.
   ============================================================ */

.fx360-contact-form {
--fx360-cf-font-family: "Segoe UI", Arial, sans-serif;
--fx360-cf-bg: #f5f5f5;
--fx360-cf-bg-focus: #ffffff;
--fx360-cf-shell-bg-top: rgba(255, 255, 255, 0.99);
--fx360-cf-shell-bg-bottom: rgba(247, 249, 253, 0.99);
--fx360-cf-text: #333333;
--fx360-cf-label-text: #26384c;
--fx360-cf-border: #dde4f1;
--fx360-cf-border-strong: #c5cfdf;
--fx360-cf-border-hover: #9fb8c9;
--fx360-cf-accent: #6f95b2;
--fx360-cf-accent-soft: rgba(59, 106, 161, 0.14);
--fx360-cf-danger: #a00303;
--fx360-cf-success-bg: #edf9f1;
--fx360-cf-success-text: #14592d;
--fx360-cf-success-border: #bfe5cb;
--fx360-cf-error-bg: #fff1f1;
--fx360-cf-error-text: #8a1f1f;
--fx360-cf-error-border: #efc2c2;
--fx360-cf-width: 760px;
--fx360-cf-padding: clamp(22px, 3.5vw, 30px);
--fx360-cf-gap: 13px;
--fx360-cf-radius: 18px;
--fx360-cf-control-radius: 10px;
--fx360-cf-control-height: 42px;
--fx360-cf-control-padding: 9px 14px;
--fx360-cf-control-font-size: 14px;
--fx360-cf-control-font-weight: 500;
--fx360-cf-control-line-height: 1.4;
--fx360-cf-control-font-size-mobile: 14px;
--fx360-cf-textarea-min-height: 118px;
--fx360-cf-label-gap: 6px;
--fx360-cf-label-font-size: 13px;
--fx360-cf-label-font-weight: 700;
--fx360-cf-label-line-height: 1.35;
--fx360-cf-label-letter-spacing: 0.012em;
--fx360-cf-button-height: 38px;
--fx360-cf-button-padding: 8px 18px;
--fx360-cf-button-radius: 8px;
--fx360-cf-button-border: 1px solid #9fb8c9;
--fx360-cf-button-border-hover: #dddddd;
--fx360-cf-button-border-active: #9fb8c9;
--fx360-cf-button-bg: linear-gradient(180deg, #f8fafb 0%, #e7ebee 38%, #d4d9dd 52%, #eef1f3 100%);
--fx360-cf-button-bg-hover: linear-gradient(180deg, #ffffff 0%, #edf2f5 36%, #eff4f8 54%, #f2f5f7 100%);
--fx360-cf-button-bg-active: linear-gradient(180deg, #d4d9dd 0%, #eef1f3 48%, #f8fafb 100%);
--fx360-cf-button-text: #4a5d73;
--fx360-cf-button-text-hover: #024b7f;
--fx360-cf-button-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
--fx360-cf-button-font-size: 13.5px;
--fx360-cf-button-font-weight: 600;
--fx360-cf-button-line-height: 1.2;
--fx360-cf-button-letter-spacing: 0.018em;
--fx360-cf-placeholder: #8d98aa;
--fx360-cf-focus-ring: 0 0 0 3px var(--fx360-cf-accent-soft);
--fx360-cf-control-shadow: inset 0 1px 2px rgba(18, 28, 45, 0.035);
--fx360-cf-control-shadow-focus: 0 0 0 1px rgba(59, 106, 161, 0.12), 0 0 12px rgba(59, 106, 161, 0.14), 0 4px 12px rgba(22, 34, 53, 0.055), inset 0 1px 2px rgba(18, 28, 45, 0.035);
--fx360-cf-form-shadow: 0 20px 48px rgba(18, 28, 45, 0.08), 0 2px 10px rgba(18, 28, 45, 0.045);
--fx360-cf-button-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(120, 135, 148, 0.22), 0 1px 2px rgba(22, 34, 53, 0.10);
--fx360-cf-button-shadow-hover: 0 0 0 1px rgba(59, 106, 161, 0.24), 0 0 14px rgba(59, 106, 161, 0.28), 0 0 24px rgba(59, 106, 161, 0.14), 0 3px 8px rgba(22, 34, 53, 0.10);
--fx360-cf-button-shadow-active: inset 0 2px 4px rgba(22, 34, 53, 0.16), 0 1px 2px rgba(22, 34, 53, 0.08);
--fx360-cf-message-radius: 10px;
--fx360-cf-template-width: 700px;
--fx360-cf-select-arrow-size: 12px;
--fx360-cf-select-arrow-space: 44px;
--fx360-cf-mobile-margin: 24px auto;
--fx360-cf-mobile-padding: 20px;
--fx360-cf-mobile-radius: 14px;
--fx360-cf-mobile-gap: 13px;
position: relative;
overflow: hidden;
width: min(100%, var(--fx360-cf-width));
max-width: var(--fx360-cf-width);
margin: 40px auto;
padding: var(--fx360-cf-padding);
border: 1px solid var(--fx360-cf-border);
border-radius: var(--fx360-cf-radius);
background: linear-gradient(180deg, var(--fx360-cf-shell-bg-top), var(--fx360-cf-shell-bg-bottom));
box-shadow: var(--fx360-cf-form-shadow);
font-family: var(--fx360-cf-font-family);
color: var(--fx360-cf-text);
display: flex;
flex-direction: column;
gap: var(--fx360-cf-gap);
box-sizing: border-box;
isolation: isolate;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
}

.fx360-contact-form::before {
content: "";
position: absolute;
top: 0;
right: 0;
left: 0;
height: 4px;
background: linear-gradient(90deg, rgba(159, 184, 201, 0.18), rgba(59, 106, 161, 0.58), rgba(159, 184, 201, 0.18));
pointer-events: none;
}

.fx360-contact-form *,
.fx360-contact-form *::before,
.fx360-contact-form *::after {
box-sizing: border-box;
}

.fx360-contact-form__title {
margin: 0 0 4px;
padding: 0 0 10px;
border-bottom: 1px solid rgba(159, 184, 201, 0.28);
color: #24384d;
font-family: var(--fx360-cf-font-family);
font-size: clamp(20px, 3vw, 26px);
font-weight: 700;
line-height: 1.2;
letter-spacing: 0.01em;
text-align: center;
}

.fx360-contact-form-field {
display: flex;
flex-direction: column;
gap: var(--fx360-cf-label-gap);
margin: 0;
font-size: var(--fx360-cf-label-font-size);
font-weight: var(--fx360-cf-label-font-weight);
line-height: var(--fx360-cf-label-line-height);
color: var(--fx360-cf-label-text);
letter-spacing: var(--fx360-cf-label-letter-spacing);
}

.fx360-contact-form__label-text {
display: inline-flex;
align-items: center;
width: fit-content;
max-width: 100%;
gap: 4px;
padding: 3px 8px 4px;
border-left: 3px solid rgba(59, 106, 161, 0.52);
border-radius: 4px;
background: linear-gradient(180deg, rgba(248, 251, 253, 0.95), rgba(239, 245, 250, 0.95));
color: #24384d;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(22, 34, 53, 0.035);
margin: 10px 0 2px 0;
font-weight: 500;
}

.fx360-contact-form__required {
color: var(--fx360-cf-danger);
font-weight: 800;
}

.fx360-contact-form .fx360-contact-form__control {
display: block;
width: 100%;
max-width: 100%;
min-height: var(--fx360-cf-control-height);
padding: var(--fx360-cf-control-padding);
border: 1px solid var(--fx360-cf-border-strong);
border-radius: var(--fx360-cf-control-radius);
background: var(--fx360-cf-bg);
color: var(--fx360-cf-text);
font-family: inherit;
font-size: var(--fx360-cf-control-font-size);
font-weight: var(--fx360-cf-control-font-weight);
line-height: var(--fx360-cf-control-line-height);
box-shadow: var(--fx360-cf-control-shadow);
transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
outline: none;
}

.fx360-contact-form .fx360-contact-form__control--textarea {
min-height: var(--fx360-cf-textarea-min-height);
resize: vertical;
}

.fx360-contact-form .fx360-contact-form__control--select {
appearance: none;
cursor: pointer;
padding-right: var(--fx360-cf-select-arrow-space);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath fill='%23141c2b' d='M5.3 7.2a1 1 0 0 1 1.4 0L10 10.5l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 15px center;
background-size: var(--fx360-cf-select-arrow-size) var(--fx360-cf-select-arrow-size);
}

.fx360-contact-form .fx360-contact-form__control::placeholder {
color: var(--fx360-cf-placeholder);
opacity: 1;
}

.fx360-contact-form .fx360-contact-form__control:hover {
border-color: var(--fx360-cf-border-hover);
}

.fx360-contact-form .fx360-contact-form__control:focus,
.fx360-contact-form .fx360-contact-form__control:focus-visible {
border-color: var(--fx360-cf-accent);
background-color: var(--fx360-cf-bg-focus);
box-shadow: var(--fx360-cf-focus-ring), var(--fx360-cf-control-shadow-focus);
outline: 0;
outline-offset: 0;
}

.fx360-contact-form .fx360-contact-form__control:-webkit-autofill,
.fx360-contact-form .fx360-contact-form__control:-webkit-autofill:hover,
.fx360-contact-form .fx360-contact-form__control:-webkit-autofill:focus {
-webkit-text-fill-color: var(--fx360-cf-text);
box-shadow: 0 0 0 1000px var(--fx360-cf-bg) inset;
transition: background-color 9999s ease-in-out 0s;
}

.fx360-contact-form__button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: var(--fx360-cf-button-height);
padding: var(--fx360-cf-button-padding);
border: var(--fx360-cf-button-border);
border-radius: var(--fx360-cf-button-radius);
background: var(--fx360-cf-button-bg);
color: var(--fx360-cf-button-text);
font-family: inherit;
font-size: var(--fx360-cf-button-font-size);
font-weight: var(--fx360-cf-button-font-weight);
line-height: var(--fx360-cf-button-line-height);
letter-spacing: var(--fx360-cf-button-letter-spacing);
text-shadow: var(--fx360-cf-button-text-shadow);
cursor: pointer;
box-shadow: var(--fx360-cf-button-shadow);
transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.fx360-contact-form__button:hover,
.fx360-contact-form__button:focus-visible {
border-color: var(--fx360-cf-button-border-hover);
background: var(--fx360-cf-button-bg-hover);
color: var(--fx360-cf-button-text-hover);
box-shadow: var(--fx360-cf-button-shadow-hover);
transform: none;
}

.fx360-contact-form__button:active {
border-color: var(--fx360-cf-button-border-active);
background: var(--fx360-cf-button-bg-active);
color: var(--fx360-cf-button-text-hover);
box-shadow: var(--fx360-cf-button-shadow-active);
transform: translateY(1px);
}

.fx360-contact-form__button:disabled {
opacity: 0.72;
cursor: wait;
box-shadow: var(--fx360-cf-button-shadow-active);
}

.fx360-contact-form__honeypot {
position: absolute;
left: -9999px;
width: 1px;
height: 1px;
overflow: hidden;
opacity: 0;
pointer-events: none;
}

.fx360-contact-form-message {
font-size: var(--fx360-cf-control-font-size);
font-weight: 700;
padding: 12px 14px;
background: var(--fx360-cf-success-bg);
color: var(--fx360-cf-success-text);
border: 1px solid var(--fx360-cf-success-border);
border-radius: var(--fx360-cf-message-radius);
}

.fx360-contact-form-message--error {
background: var(--fx360-cf-error-bg);
color: var(--fx360-cf-error-text);
border-color: var(--fx360-cf-error-border);
}

.fx360-contact-form-preview-frame,
.fx360-contact-template-preview-shell {
width: 100%;
}

.fx360-contact-form--admin-preview,
.fx360-contact-form--template {
margin-top: 18px;
margin-bottom: 0;
}

.fx360-contact-form--template {
max-width: var(--fx360-cf-template-width);
}

.fx360-contact-template-note {
width: min(100%, var(--fx360-cf-template-width));
margin: 12px auto 0;
}

@media (max-width: 640px) {
.fx360-contact-form {
--fx360-cf-control-font-size: var(--fx360-cf-control-font-size-mobile);
margin: var(--fx360-cf-mobile-margin);
padding: var(--fx360-cf-mobile-padding);
border-radius: var(--fx360-cf-mobile-radius);
gap: var(--fx360-cf-mobile-gap);
}
}
