/* =============================================================================
   WP Flexi Form — Frontend (minimalist)
   ============================================================================= */

:root {
  --f-accent:      #2563eb;
  --f-accent-dark: #1d4ed8;
  --f-text:        #111827;
  --f-text-label:  #374151;
  --f-text-muted:  #9ca3af;
  --f-border:      #e5e7eb;
  --f-border-active: #2563eb;
  --f-focus-ring:  rgba(37, 99, 235, .15);
  --f-r:           6px;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.wff-front-form {
  max-width: 640px;
  padding: 40px 0;
  color: var(--f-text);
  font-size: 15px;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Field ────────────────────────────────────────────────────────────────── */
.wff-field {
  margin-bottom: 24px;
}

/* ── Labels ───────────────────────────────────────────────────────────────── */
.wff-field > label:not(.wff-checkbox),
.wff-radio-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--f-text-label);
  letter-spacing: .01em;
}

/* ── Text inputs ──────────────────────────────────────────────────────────── */
.wff-field input[type="text"],
.wff-field input[type="email"],
.wff-field input[type="tel"],
.wff-field input[type="number"],
.wff-field input[type="date"],
.wff-field textarea,
.wff-field select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--f-border);
  border-radius: var(--f-r);
  background: #fff;
  color: var(--f-text);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
  outline: none;
  -webkit-appearance: none;
          appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

.wff-field textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── Character counter ────────────────────────────────────────────────────── */
.wff-char-counter {
  margin-top: 4px;
  font-size: 12px;
  color: var(--f-text-muted);
  text-align: right;
  transition: color .15s;
}

.wff-char-counter.wff-char-limit {
  color: #dc2626;
  font-weight: 600;
}

.wff-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
  cursor: pointer;
}

.wff-field input:not([type="checkbox"]):not([type="radio"]):focus,
.wff-field textarea:focus,
.wff-field select:focus {
  border-color: var(--f-border-active);
  box-shadow: 0 0 0 3px var(--f-focus-ring);
}

/* ── Checkbox ─────────────────────────────────────────────────────────────── */
.wff-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--f-border);
  border-radius: var(--f-r);
  cursor: pointer;
  transition: border-color .15s;
}

.wff-checkbox:hover {
  border-color: #d1d5db;
}

.wff-checkbox:has(input:checked) {
  border-color: var(--f-accent);
}

.wff-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
          appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px;
}

.wff-checkbox input[type="checkbox"]:checked {
  background-color: var(--f-accent);
  border-color: var(--f-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

.wff-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--f-accent);
  outline-offset: 2px;
}

.wff-checkbox > span {
  font-size: 14px;
  font-weight: 500;
  color: var(--f-text-label);
  user-select: none;
  line-height: 1.5;
}

.wff-checkbox > span a {
  color: var(--f-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wff-checkbox > span a:hover {
  color: var(--f-accent-dark);
}

/* ── Radio ────────────────────────────────────────────────────────────────── */
.wff-radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wff-radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--f-border);
  border-radius: var(--f-r);
  cursor: pointer;
  transition: border-color .15s;
}

.wff-radio-option:hover {
  border-color: #d1d5db;
}

.wff-radio-option:has(input:checked) {
  border-color: var(--f-accent);
}

.wff-radio-option input[type="radio"] {
  -webkit-appearance: none;
          appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 7px;
}

.wff-radio-option input[type="radio"]:checked {
  border-color: var(--f-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Ccircle cx='3.5' cy='3.5' r='3.5' fill='%232563eb'/%3E%3C/svg%3E");
}

.wff-radio-option input[type="radio"]:focus-visible {
  outline: 2px solid var(--f-accent);
  outline-offset: 2px;
}

.wff-radio-option > span {
  font-size: 14px;
  font-weight: 500;
  color: var(--f-text-label);
  user-select: none;
  line-height: 1.4;
}

/* ── Static text section ──────────────────────────────────────────────────── */
.wff-static-text {
  margin-bottom: 28px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--f-border);
}

.wff-static-text-title {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--f-text);
  line-height: 1.4;
}

.wff-static-text-body .wff-field:last-child {
  margin-bottom: 16px;
}

/* ── Price summary ────────────────────────────────────────────────────────── */
.wff-price-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 28px 0;
  padding-top: 24px;
  border-top: 1px solid var(--f-border);
}

.wff-price-summary strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--f-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.wff-total-price {
  font-size: 26px;
  font-weight: 700;
  color: var(--f-text);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* ── Submit ───────────────────────────────────────────────────────────────── */
.wff-front-form > p:last-of-type {
  margin: 28px 0 0;
}

.wff-front-form button[type="submit"] {
  -webkit-appearance: none;
          appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 11px 28px;
  border: none;
  border-radius: var(--f-r);
  background: var(--f-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.wff-front-form button[type="submit"]:hover {
  background: var(--f-accent-dark);
}

.wff-front-form button[type="submit"]:active {
  transform: translateY(1px);
}

.wff-front-form button[type="submit"]:focus-visible {
  outline: 2px solid var(--f-accent);
  outline-offset: 3px;
}

/* ── Success / confirmation ───────────────────────────────────────────────── */
.wff-success {
  max-width: 640px;
  padding: 48px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.wff-success-icon {
  color: #16a34a;
  margin-bottom: 20px;
  line-height: 1;
}

.wff-success-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--f-text);
  line-height: 1.3;
  letter-spacing: -.01em;
}

.wff-success-message {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--f-text-label);
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .wff-front-form {
    padding: 24px 0;
  }

  .wff-front-form button[type="submit"] {
    width: 100%;
    justify-content: center;
  }

  .wff-total-price {
    font-size: 22px;
  }
}
