/* ============================================
   form-base.css — complete base stylesheet
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--color-text-primary, #0f0f0f);
  -webkit-font-smoothing: antialiased;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* ── Page & Container ── */
.ff-page {
  min-height: 100vh;
  padding: 48px 24px 80px;
  background: var(--color-background-tertiary, #f5f5f5);
}
.ff-container {
  max-width: 640px;
  margin: 0 auto;
}

/* ── Header ── */
.ff-header { margin-bottom: 40px; }
.ff-header.has-cover { margin-bottom: 40px; }
.ff-header.has-cover .ff-title { margin-top: 4px; }
.ff-title {
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--color-text-primary, #0f0f0f);
}
.ff-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary, #6b6b6b);
}

/* ── Card ── */
.ff-card {
  background: var(--color-background-primary, #fff);
  border-radius: 12px;
  border: 0.5px solid var(--color-border-tertiary, rgba(0,0,0,0.1));
  padding: 24px;
}

/* ── Grid Layout ── */
.ff-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.ff-field-outer { grid-column: span 2; }
.ff-field-outer.half { grid-column: span 1; }

/* ── Labels & Help Text ── */
.ff-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text-primary, #0f0f0f);
}
.ff-required { margin-left: 2px; color: #ef4444; }
.ff-help {
  font-size: 13px;
  color: var(--color-text-secondary, #6b6b6b);
  margin-bottom: 8px;
  margin-top: -4px;
  line-height: 1.5;
}

/* ── Text Inputs ── */
.ff-input {
  width: 100%;
  display: block;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text-primary, #0f0f0f);
  background: var(--color-background-primary, #fff);
  border: 0.5px solid var(--color-border-secondary, rgba(0,0,0,0.2));
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.ff-input:hover {
  border-color: var(--color-border-primary, rgba(0,0,0,0.35));
}
.ff-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.ff-input::placeholder {
  color: var(--color-text-tertiary, #bbb);
}

/* ── Textarea ── */
.ff-textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

/* ── Select ── */
.ff-select {
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: auto;
  padding-right: 28px;
}

/* ── Radio & Checkbox Choices ── */
.ff-choices { display: flex; flex-direction: column; gap: 8px; }
.ff-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-primary, #0f0f0f);
  padding: 4px 0;
}
.ff-choice input[type="radio"],
.ff-choice input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #4f46e5;
  cursor: pointer;
}
.ff-choice-text { line-height: 1.4; }

/* ── Yes / No ── */
.ff-yes-no { display: flex; gap: 12px; }
.ff-yes-no-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid var(--color-border-secondary, rgba(0,0,0,0.2));
  border-radius: 8px;
  background: var(--color-background-primary, #fff);
  color: var(--color-text-primary, #0f0f0f);
  transition: all 0.15s;
  user-select: none;
}
.ff-yes-no-btn input { display: none; }
.ff-yes-no-btn:hover {
  background: var(--color-background-secondary, #f5f5f5);
}
.ff-yes-no-btn:has(input:checked) {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
}

/* ── NPS Score ── */
/*
  Required HTML structure:
  
    
      
      0
    
    ... repeat for 1–10 ...
  
  
    Not likelyVery likely
  
*/
.ff-nps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ff-nps-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.ff-nps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 40px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid var(--color-border-secondary, rgba(0,0,0,0.2));
  border-radius: 8px;
  background: var(--color-background-primary, #fff);
  color: var(--color-text-primary, #0f0f0f);
  transition: all 0.15s;
  user-select: none;
}
.ff-nps-btn:hover {
  background: var(--color-background-secondary, #f5f5f5);
  border-color: var(--color-border-primary, rgba(0,0,0,0.35));
}
.ff-nps-item input:checked + .ff-nps-btn {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.ff-nps-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-text-tertiary, #bbb);
}

/* ── Star Rating ── */
/*
  Required HTML structure (inputs listed highest-first for CSS sibling trick):
  
    
    
    ... repeat for 4 → 1 ...
  
*/
.ff-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 2px;
}
.ff-rating input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.ff-rating label {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: transform 0.1s;
}
.ff-rating label svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--color-border-primary, rgba(0,0,0,0.35));
  stroke-width: 1.5;
  stroke-linejoin: round;
  transition: fill 0.12s, stroke 0.12s;
}
.ff-rating label:hover svg,
.ff-rating label:hover ~ label svg,
.ff-rating input:checked ~ label svg {
  fill: #f59e0b;
  stroke: #d97706;
}
.ff-rating label:hover { transform: scale(1.15); }

/* ── File Upload ── */
.ff-file {
  width: 100%;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary, #6b6b6b);
}

/* ── Signature ── */
.ff-signature { overflow: hidden; }
.ff-signature-canvas {
  width: 100%;
  display: block;
  cursor: crosshair;
  border: 0.5px solid var(--color-border-secondary, rgba(0,0,0,0.2));
  border-radius: 8px;
  background: var(--color-background-primary, #fff);
}
.ff-signature-clear {
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-secondary, #6b6b6b);
  font-family: inherit;
}
.ff-signature-clear:hover {
  color: var(--color-text-primary, #0f0f0f);
}

/* ── Divider & Statement ── */
.ff-divider {
  border: none;
  border-top: 0.5px solid var(--color-border-tertiary, rgba(0,0,0,0.1));
  margin: 8px 0;
}
.ff-statement {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-secondary, #6b6b6b);
}

/* ── Submit ── */
.ff-submit-wrap { margin-top: 32px; }
.ff-submit {
  display: inline-block;
  padding: 11px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: #4f46e5;
  color: #fff;
  transition: opacity 0.2s, transform 0.2s;
}
.ff-submit:hover { opacity: 0.88; transform: translateY(-1px); }
.ff-submit:active { transform: translateY(0); opacity: 1; }
.ff-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
}

/* ── DPDP badge & hint ── */
.ff-dpdp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 100px;
  padding: 3px 12px;
  margin-bottom: 16px;
}
.ff-dpdp-hint {
  font-size: 11px;
  color: var(--color-text-tertiary, #bbb);
  margin-top: 8px;
  text-align: center;
}

/* ── Footer ── */
.ff-footer {
  margin-top: 48px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-tertiary, #bbb);
}

/* ── Cover Banner ── */
.ff-cover {
  width: 100%;
  height: 140px;
  background: var(--color-background-secondary, #e8e8e8);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  position: relative;
}
.ff-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.ff-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}

/* ── Logo (overlapping the cover) ── */
.ff-logo-wrap {
  display: flex;
  margin-top: -28px;
  margin-bottom: 16px;
  padding-left: 4px;
}
.ff-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2.5px solid var(--color-background-primary, #fff);
  background: var(--color-background-primary, #fff);
  object-fit: contain;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  display: block;
}

.ff-field-label.font-bold  { font-weight: 700; }
.ff-field-label.italic     { font-style: italic; }
.ff-field-label.underline  { text-decoration: underline; }