/*
 * Villa & Livsstil · shared form style (ONE source for both forms)
 *   - the "Skicka in ditt bidrag" modal on the home page (components/ui/SubmitHomeModal.tsx, React)
 *   - the contact form on the partner page (public/partner.html, static)
 * Both load THIS file (<link href="/vl-form.css">). Change the look here only; keep the markup structure the same in both:
 *
 *   <form class="vf" novalidate>
 *     <div class="vf-row">                       two columns from 640 px (optional)
 *       <div class="vf-fld [err]">
 *         <label class="vf-lab" for="x">Namn</label>              optional fields end with " (valfritt)"
 *         <input class="vf-in" id="x" required aria-required="true">
 *         <span class="vf-em">Felmeddelande</span>
 *       </div>
 *     </div>
 *     <div class="vf-fld vf-chk [err]"><label><input type="checkbox" required> <span>Samtycke</span></label><span class="vf-em">…</span></div>
 *     <div class="vf-act"><button class="vf-btn" type="submit">Skicka … <svg class="vf-arrow">…</svg></button></div>
 *   </form>
 */
.vf {
  --vf-ink: #1A1A18; --vf-moss: #44523F; --vf-moss-dark: #38442F; --vf-paper: #FAF9F5; --vf-mute: #6B675F; --vf-body: #4A4843; --vf-err: #A8442A;
  display: grid; gap: 1.6rem; width: 100%; text-align: left;
  font-family: var(--font-sans, var(--sans, system-ui, sans-serif));
}
.vf-row { display: grid; gap: 1.6rem; }
@media (min-width: 640px) { .vf-row { grid-template-columns: 1fr 1fr; } }

.vf-fld { position: relative; min-width: 0; }
/* the label sits right above the line: it overlaps the field's top padding */
.vf-lab {
  position: relative; z-index: 1; display: block; margin: 0 0 -.5rem;
  font-size: .625rem; line-height: 1; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--vf-mute); transition: color .25s;
  pointer-events: none;
}
.vf-fld:focus-within .vf-lab { color: var(--vf-ink); }
.vf-in {
  display: block; width: 100%; min-height: 2.75rem; margin: 0; padding: .95rem 0 .5rem;
  background: transparent; border: 0; border-bottom: 1px solid rgba(26,26,24,.35); border-radius: 0;
  box-shadow: 0 1px 0 0 transparent;               /* focus thickens the line without moving anything */
  font: inherit; font-family: var(--font-sans, var(--sans, system-ui, sans-serif)); font-size: 1.05rem; line-height: 1.6; color: var(--vf-ink);
  outline: 0; transition: border-color .25s, box-shadow .25s;
}
textarea.vf-in { resize: vertical; min-height: 5.5rem; }
.vf-in::placeholder { color: rgba(26,26,24,.45); }
.vf-in:hover { border-bottom-color: rgba(26,26,24,.6); }
.vf-in:focus, .vf-in:focus-visible { border-bottom-color: var(--vf-moss); box-shadow: 0 1px 0 0 var(--vf-moss); }

.vf-fld.err .vf-in { border-bottom-color: var(--vf-err); box-shadow: 0 1px 0 0 var(--vf-err); }
.vf-fld.err .vf-lab { color: var(--vf-err); }
.vf-em { display: none; margin-top: .4rem; font-size: .8rem; line-height: 1.4; color: var(--vf-err); }
.vf-fld.err .vf-em { display: block; }

/* consent checkbox */
.vf-chk label { display: flex; align-items: flex-start; gap: .8rem; margin: 0; cursor: pointer; color: var(--vf-body); font-size: .875rem; line-height: 1.55; }
.vf-chk input[type=checkbox] { flex: none; width: 1.1rem; height: 1.1rem; margin: .2rem 0 0; accent-color: var(--vf-moss); }
.vf-chk input[type=checkbox]:focus-visible { outline: 2px solid var(--vf-moss); outline-offset: 2px; }
.vf-chk a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.vf-chk a:hover { color: var(--vf-moss); }
.vf-fld.err.vf-chk label { color: var(--vf-err); }

/* image upload (modal): label in the same label style, dashed drop area */
.vf-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; margin-top: .9rem;
  padding: 1.75rem 1rem; text-align: center; cursor: pointer;
  border: 1px dashed #D9D2C7; background: rgba(255,255,255,.6); color: var(--vf-body); transition: border-color .25s, background-color .25s;
}
.vf-drop:hover, .vf-drop.on, .vf-drop:focus-within { border-color: var(--vf-moss); background: #fff; }
.vf-drop small { font-size: .75rem; color: var(--vf-mute); }
.vf-files { margin: .75rem 0 0; padding: 0; list-style: none; border: 1px solid #E5E0D8; background: #fff; }
.vf-files li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; font-size: .875rem; }
.vf-files li + li { border-top: 1px solid #E8E3DD; }

/* submit: one button on both forms */
.vf-act { display: flex; margin-top: .4rem; }
.vf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem; height: 3.5rem; padding: 0 2.25rem; cursor: pointer;
  background: var(--vf-moss); color: var(--vf-paper); border: 1px solid var(--vf-moss); border-radius: 0;
  font-family: var(--font-sans, var(--sans, system-ui, sans-serif)); font-size: .6875rem; font-weight: 500; line-height: 1; letter-spacing: .18em; text-transform: uppercase;
  transition: background-color .3s, border-color .3s;
}
.vf-btn:hover:not(:disabled) { background: var(--vf-moss-dark); border-color: var(--vf-moss-dark); }
.vf-btn:disabled, .vf-btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.vf-btn:focus-visible { outline: 2px solid var(--vf-moss); outline-offset: 3px; }
.vf-arrow { width: 1rem; height: 1rem; flex: none; transition: transform .3s; }
.vf-btn:hover:not(:disabled) .vf-arrow { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) { .vf-arrow, .vf-in, .vf-lab, .vf-btn { transition: none; } }

/* Notice shown when no form endpoint is connected (same look as the partner page's result box) */
.vf-note { border: 1px solid rgba(26,26,24,.2); padding: 1.5rem 1.75rem; }
.vf-note h4 { margin: 0 0 .5rem; font-family: var(--font-serif, var(--serif, Georgia, serif)); font-weight: 400; font-size: 1.6rem; line-height: 1.1; color: var(--vf-ink); }
.vf-note p { margin: 0; color: var(--vf-body); line-height: 1.7; font-size: .95rem; }
