/* LeadForm Renderer Styles */

[x-cloak] { display: none !important; }

.lf-form {
  --lf-accent: #0299ed;
  --lf-button-bg: #066aab;
  --lf-button-text: #ffffff;
  --lf-field-border: #cccccc;
  --lf-text-primary: #444444;
  --lf-text-secondary: #777777;
  --lf-error: #d63637;
  --lf-success: #16a34a;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--lf-text-primary);
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
  /* Keep footer below the fold so short steps don't feel cramped */
  min-height: 60vh;
  padding-bottom: 48px;
}

/* Progress */
.lf-progress {
  margin-bottom: 24px;
}
.lf-progress-bar {
  height: 4px;
  background: var(--lf-accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.lf-progress-text {
  font-size: 13px;
  color: var(--lf-text-secondary);
  margin-top: 8px;
}

/* Steps */
.lf-step {
  animation: lf-fade 0.3s ease;
}
@keyframes lf-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fields */
.lf-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lf-label,
.lf-radio-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--lf-text-primary);
}
.lf-required {
  color: var(--lf-error);
  margin-left: 4px;
}

/* Inputs */
.lf-input,
.lf-textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--lf-field-border);
  border-radius: 6px;
  background: #fff;
  color: var(--lf-text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.lf-input:focus,
.lf-textarea:focus {
  border-color: var(--lf-accent);
  box-shadow: 0 0 0 3px rgba(2, 153, 237, 0.15);
}
.lf-input-lg {
  padding: 14px 16px;
  font-size: 17px;
}
.lf-input[readonly] {
  background: #f7f7f7;
  color: var(--lf-text-secondary);
}

/* Radio cards grid */
.lf-radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.lf-radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 12px;
  border: 1px solid var(--lf-field-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 120px;
  text-align: center;
}
.lf-radio-card:hover {
  border-color: var(--lf-accent);
  background: #fafdff;
}
.lf-radio-card.lf-selected {
  border-color: var(--lf-accent);
  background: #f0f8fd;
  box-shadow: 0 0 0 2px rgba(2, 153, 237, 0.2);
}
.lf-radio-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ── radio-list: simple text+circle list (used when icons impractical) */
.lf-radio-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lf-radio-list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--lf-field-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.lf-radio-list-item:hover {
  border-color: var(--lf-accent);
  background: #fafdff;
}
.lf-radio-list-item.lf-selected {
  border-color: var(--lf-accent);
  background: #f0f8fd;
}
.lf-radio-list-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lf-radio-list-circle {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--lf-field-border);
  border-radius: 50%;
  background: #fff;
  transition: all 0.15s;
  position: relative;
}
.lf-radio-list-item:hover .lf-radio-list-circle {
  border-color: var(--lf-accent);
}
.lf-radio-list-item.lf-selected .lf-radio-list-circle {
  border-color: var(--lf-accent);
  background: var(--lf-accent);
  box-shadow: inset 0 0 0 3px #fff;
}
.lf-radio-list-text {
  flex: 1;
  font-size: 15px;
  color: var(--lf-primary-text);
}
.lf-radio-icon {
  color: var(--lf-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}
.lf-radio-icon svg {
  width: 100%;
  height: 100%;
}
.lf-radio-text {
  font-size: 13px;
  line-height: 1.3;
  color: var(--lf-text-primary);
}

/* Email status */
.lf-email-status {
  margin-top: 4px;
}
.lf-email-suggest {
  background: #fff8e1;
  border: 1px solid #ffd970;
  color: #6b4c00;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.lf-email-suggest-action {
  background: none;
  border: none;
  color: var(--lf-accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
  padding: 0;
  margin-left: 4px;
}
.lf-email-error {
  color: var(--lf-error);
  font-size: 14px;
  padding: 6px 0;
}
.lf-email-checking {
  color: var(--lf-text-secondary);
  font-size: 13px;
  padding: 4px 0;
}

/* Field error */
.lf-field-error {
  color: var(--lf-error);
  font-size: 13px;
}

/* Global error (server-side validation failures) */
.lf-global-error {
  background: rgba(214, 54, 55, 0.08);
  border: 1px solid var(--lf-error);
  color: var(--lf-error);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 16px 0 8px;
  font-size: 14px;
  line-height: 1.4;
}

/* Actions */
.lf-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}
.lf-btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  padding: 14px 24px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.05s;
}
.lf-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.lf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.lf-btn-next,
.lf-btn-submit {
  background: var(--lf-button-bg);
  color: var(--lf-button-text);
  margin-left: auto;
}
.lf-btn-next:hover:not(:disabled),
.lf-btn-submit:hover:not(:disabled) {
  opacity: 0.9;
}
.lf-btn-back {
  background: transparent;
  color: var(--lf-text-secondary);
  border: 1px solid var(--lf-field-border);
}
.lf-btn-back:hover {
  color: var(--lf-text-primary);
  background: #f7f7f7;
}

/* Success */
.lf-success {
  text-align: center;
  padding: 32px 24px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  color: #065f46;
  font-size: 16px;
}

/* Honeypot — visually hidden but accessible to bots */
.lf-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Mobile */
@media (max-width: 480px) {
  .lf-form { padding: 16px; }
  .lf-radio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lf-radio-card {
    min-height: 100px;
    padding: 12px 8px;
  }
  .lf-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .lf-btn-next, .lf-btn-submit {
    margin-left: 0;
  }
}

/* Info fields and step descriptions (v1.0.40) */
.lf-step-description {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #f4f9ff;
  border-left: 3px solid var(--lf-accent);
  border-radius: 4px;
  color: var(--lf-text-primary);
  font-size: 15px;
  line-height: 1.5;
}
.lf-info {
  margin: 8px 0 20px;
  padding: 14px 16px;
  background: #f4f9ff;
  border-left: 3px solid var(--lf-accent);
  border-radius: 4px;
}
.lf-info-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--lf-text-primary);
}
.lf-info-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--lf-text-primary);
}

/* ── File upload (v1.0.51) ───────────────────────────────── */
.lf-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lf-file-button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 6px; cursor: pointer;
  background: #e9e9e9; color: #444; font-size: 15px; line-height: 1;
  border: 1px solid #d5d5d5; transition: background .15s ease;
}
.lf-file-button:hover { background: #dedede; }
.lf-file-help { margin-top: 6px; font-size: 13px; color: #777; }
.lf-file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.lf-file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #f6f6f6; border: 1px solid #e2e2e2;
  border-radius: 5px; font-size: 14px;
}
.lf-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-file-size { color: #888; font-size: 13px; }
.lf-file-remove {
  background: none; border: 0; color: #999; font-size: 20px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.lf-file-remove:hover { color: #c33; }
.lf-file-reading { margin-top: 8px; font-size: 13px; color: #777; }

/* ── Consent checkbox (v1.0.51) ──────────────────────────── */
.lf-field-consent { margin-top: 4px; }
.lf-consent { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.lf-consent-input { margin-top: 3px; width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; }
.lf-consent-text { font-size: 14px; line-height: 1.45; color: #444; }
.lf-consent-links { margin-top: 8px; font-size: 13px; color: #777; }
.lf-consent-links a { color: inherit; text-decoration: underline; }
