/* ========================================================================== 
   VLC shared form system
   Usage: wrap forms in .vlc-form. Use .vf-grid, .vf-field, .vf-options,
   .vf-upload and .vf-actions for consistent forms on any page.
   All selectors are scoped; importing this file does not restyle other forms.
   Override the custom properties on .vlc-form when a theme variation is needed.
   ========================================================================== */

/* 01. Theme and container ------------------------------------------------- */
.vlc-form {
  --vf-paper: #fffbf5;
  --vf-forest: #173d31;
  --vf-green: #287b30;
  --vf-line: #d5d9cb;
  --vf-muted: #64675f;
  --vf-error: #a23737;
  padding: clamp(24px, 4vw, 64px);
  border: 1px solid var(--vf-line);
  border-radius: 20px;
  background: var(--vf-paper);
  color: var(--vf-forest);
  font-family: Poppins, Arial, sans-serif;
}

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

.vlc-form [hidden] {
  display: none !important;
}

/* 02. Sections and responsive field grid --------------------------------- */
.vlc-form .vf-section {
  min-width: 0;
  margin: 0 0 44px;
  padding: 0 0 44px;
  border: 0;
  border-bottom: 1px solid var(--vf-line);
}

.vlc-form .vf-section > legend {
  margin-bottom: 28px;
  padding: 0;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.vlc-form .vf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}

.vlc-form .vf-wide {
  grid-column: 1 / -1;
}

.vlc-form .vf-field {
  min-width: 0;
}

/* 03. Text fields and native selects ------------------------------------- */
.vlc-form .vf-field > label,
.vlc-form .vf-options > legend {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.vlc-form .vf-field > label > span,
.vlc-form .vf-options > legend > span {
  color: var(--vf-error);
}

.vlc-form .vf-field :is(input, select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid var(--vf-line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--vf-forest);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}

.vlc-form .vf-field textarea {
  min-height: 140px;
  resize: vertical;
}

.vlc-form :is(input, textarea, select, button):focus-visible {
  outline: 3px solid var(--vf-green);
  outline-offset: 3px;
}

.vlc-form :is(input, textarea, select):user-invalid {
  border-color: var(--vf-error);
}

.vlc-form :disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* 04. Radio groups, checkboxes and declaration --------------------------- */
.vlc-form .vf-options {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.vlc-form .vf-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vlc-form .vf-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--vf-line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}

.vlc-form .vf-choice:has(input:checked) {
  border-color: var(--vf-green);
  background: #f0f0df;
}

.vlc-form .vf-choice input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--vf-green);
}

.vlc-form .vf-declaration .vf-choice {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--vf-muted);
}

/* 05. Upload controls, hints and feedback -------------------------------- */
.vlc-form .vf-upload {
  padding: 24px;
  border: 1px dashed var(--vf-line);
  border-radius: 10px;
}

.vlc-form input[type="file"] {
  padding: 8px;
  font-size: 14px;
}

.vlc-form input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 5px;
  background: #f0f0df;
  color: var(--vf-forest);
  font: inherit;
  cursor: pointer;
}

.vlc-form .vf-hint,
.vlc-form .vf-error,
.vlc-form .vf-status {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--vf-muted);
}

.vlc-form .vf-error {
  color: var(--vf-error);
}

.vlc-form .vf-error:empty,
.vlc-form .vf-status:empty {
  display: none;
}

/* 06. Actions ------------------------------------------------------------ */
.vlc-form .vf-actions {
  margin-top: 32px;
}

.vlc-form .vf-button {
  width: 100%;
  min-height: 58px;
  padding: 16px 24px;
  border: 1px solid var(--vf-green);
  border-radius: 8px;
  background: var(--vf-green);
  color: #fff;
  font: 600 15px/1.5 Poppins, Arial, sans-serif;
  cursor: pointer;
}

.vlc-form .vf-button:hover {
  background: var(--vf-forest);
}

.vlc-form[aria-busy="true"] .vf-button {
  cursor: wait;
  opacity: 0.7;
}

/* 07. Repeating groups and secondary actions ----------------------------- */
.vlc-form .vf-subheading {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.vlc-form .vf-repeat {
  min-width: 0;
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid var(--vf-line);
  border-radius: 10px;
}

.vlc-form .vf-repeat > legend {
  padding: 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.vlc-form .vf-repeat .vf-button--secondary {
  margin-top: 20px;
}

.vlc-form .vf-button--secondary {
  width: auto;
  justify-self: start;
  min-height: 46px;
  padding: 12px 20px;
  background: transparent;
  color: var(--vf-green);
}

.vlc-form .vf-button--secondary:hover {
  background: #f0f0df;
}

.vlc-form .vf-section > .vf-hint {
  margin: 0 0 24px;
}

/* 08. Mobile ------------------------------------------------------------- */
@media (max-width: 640px) {
  .vlc-form .vf-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .vlc-form .vf-upload {
    padding: 16px;
  }

  .vlc-form .vf-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
  }
}
