/* Form polish: additive rules on top of the Demo form styles (nothing here changes the Demo look). */

/* 1. Phones: 16px minimum stops iOS Safari from zooming into a field. */
@media (max-width:700px){
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=submit]):not([type=button]),select,textarea{font-size:16px!important}
}

/* 2. Placeholder contrast and autofill. */
input::placeholder,textarea::placeholder{color:#68707A;opacity:1}
input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,textarea:-webkit-autofill{-webkit-text-fill-color:#0D1014;-webkit-box-shadow:0 0 0 40px #fff inset;transition:background-color 9999s ease-out}

/* 3. Plain checkboxes and radios (anything not already a custom chip) use the brand green. */
input[type=checkbox],input[type=radio]{accent-color:var(--lg-green)}

/* 4. Keyboard focus on chips made of a label and a hidden input. */
:is(.qp-pf,.wz-sv,.cf-sv,.gq-sv,.pp-cn,.sh-ck,.lgp-chk,.lg-chip,.lg-check):has(input:focus-visible){outline:2px solid #0D1014;outline-offset:3px}
:is(.qp-pf,.wz-sv,.cf-sv,.gq-sv):active{transform:scale(.97)}

/* 5. Invalid fields: red border plus a soft ring, also for screen-reader state. */
input[aria-invalid=true],select[aria-invalid=true],textarea[aria-invalid=true]{border-color:var(--lg-red-deep)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--lg-red-deep) 14%,transparent)!important}
.lg-err{display:flex;align-items:center;gap:6px;font-weight:500}
.lg-err:not([hidden])::before{content:"!";flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--lg-red-deep);color:#fff;font-size:11px;font-weight:700;line-height:1}
.lg-form-errors:not(:empty){border:1.5px solid var(--lg-red-deep);border-radius:14px;background:#FFF3F3;color:#8A1016;font-weight:500}

/* 6. Sending: the button shows a spinner and cannot be pressed twice. */
.lg-form.is-loading [type=submit]{position:relative;color:transparent!important;pointer-events:none;cursor:progress}
.lg-form.is-loading [type=submit] *{opacity:0}
.lg-form.is-loading [type=submit]::after{content:"";position:absolute;left:50%;top:50%;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;border:2.5px solid rgba(255,255,255,.35);border-top-color:#fff;animation:lgspin .7s linear infinite}
@keyframes lgspin{to{transform:rotate(360deg)}}

/* 7. Disabled controls. */
button:disabled,input:disabled,select:disabled,textarea:disabled,.btn[aria-disabled=true]{opacity:.55;cursor:not-allowed}

/* 8. Selects get one arrow everywhere. */
.lg-form select{-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230D1014' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 16px center;background-size:16px;padding-right:44px}

/* 9. Success screen. */
.lg-form-done{border:1.5px solid var(--lg-green);border-radius:18px}

@media (prefers-reduced-motion:reduce){.lg-form.is-loading [type=submit]::after{animation-duration:2.4s}}

/* Dark footer form: lighter placeholder so it stays readable. */
.lg-form--inline input::placeholder{color:rgba(242,240,234,.66)}
