/* ============================================================
   OPERATION SAVES — Form Pages
   Builds on styles.css design tokens. Used by /forms/* pages.
   ============================================================ */

/* --- Page layout --- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.form-header {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.form-header-brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.form-header-logo {
  height: 38px;
  width: 38px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

.form-header-back {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.form-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
}

/* --- Form card --- */
.form-card {
  width: 100%;
  max-width: 520px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  padding: 28px 24px 32px;
}

.form-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.form-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* --- Fields --- */
.form-field {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e5e7eb;
  font-size: 15px;
  font-family: inherit;
  background: white;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--blue);
}

.form-input[type="file"] {
  padding: 9px 12px;
  background: #f9fafb;
  cursor: pointer;
}

textarea.form-input {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* --- Dual-input file fields (upload + camera) --- */
.file-input-group {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.file-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.file-btn:active { opacity: 0.7; }
.file-btn-camera {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}
.file-selected-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}
.file-selected-count.has-files {
  color: var(--blue);
  font-weight: 600;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Divider --- */
.form-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}

/* --- Coming soon notice --- */
.form-notice {
  background: var(--blue-light);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

/* --- Submit button --- */
.form-submit {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--blue);
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 8px;
}

.form-submit:hover           { opacity: 0.88; }
.form-submit:active          { transform: scale(0.98); }
.form-submit:disabled        { opacity: 0.55; cursor: not-allowed; transform: none; }

/* --- Hint text --- */
.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Inline error --- */
.form-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.form-error.hidden { display: none; }

/* ============================================================
   MULTI-STEP FORM — Adoption Application
   Prefixed aa- for step chrome; generic names for reusable components
   ============================================================ */

/* --- Step visibility --- */
.aa-step { display: none; }
.aa-step.active {
  display: block;
  animation: stepFadeIn 0.22s ease;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Progress bar --- */
.aa-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-bottom: 14px;
  overflow: hidden;
}
.aa-progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.aa-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.aa-step-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

/* --- Pill radio buttons --- */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.pill {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.pill-label {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: white;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  cursor: pointer;
  line-height: 1.4;
}
.pill input[type="radio"]:checked ~ .pill-label {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}
.pill-group.error .pill-label {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* --- Conditional groups --- */
.conditional-group {
  display: none;
  padding-left: 14px;
  border-left: 3px solid var(--blue-light);
  margin-top: 14px;
}
.conditional-group.visible {
  display: block;
  animation: stepFadeIn 0.2s ease;
}

/* --- Sub-section title --- */
.form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 22px 0 14px;
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
}
.form-section-title.no-border {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* --- Two-column field row --- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 400px) {
  .form-row { grid-template-columns: 1fr; }
}

/* --- Pet repeater cards --- */
.pet-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 14px 14px 10px;
  margin-bottom: 10px;
}
.pet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pet-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pet-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
  font-family: inherit;
  transition: color 0.15s;
}
.pet-remove-btn:hover { color: var(--red); }
.pet-add-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #d1d5db;
  background: white;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
  transition: border-color 0.15s;
}
.pet-add-btn:hover { border-color: var(--blue); }

/* --- Agreement checkboxes --- */
.agree-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.agree-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e5e7eb;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.agree-item:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-light);
}
.agree-item.error {
  border-color: var(--red) !important;
  background: var(--red-light) !important;
}
.agree-check {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--blue);
}
.agree-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* --- Review summary --- */
.review-block {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.review-block-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.review-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}
.review-row:last-child { border-bottom: none; }
.review-key { color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.review-val { color: var(--text-primary); font-weight: 600; text-align: right; word-break: break-word; max-width: 58%; }

/* --- Step navigation buttons --- */
.aa-nav {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
}
.aa-back-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e5e7eb;
  background: white;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
.aa-back-btn:hover { border-color: #9ca3af; }
.aa-next-btn {
  flex: 2;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--blue);
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.aa-next-btn:hover { opacity: 0.88; }
.aa-submit-btn {
  flex: 2;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--green);
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.aa-submit-btn:hover { opacity: 0.88; }
.aa-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* --- Field error state --- */
.form-input.error { border-color: var(--red) !important; }
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}
.form-input.error, .pill-group.error { animation: fieldShake 0.35s ease; }

/* --- Preamble list --- */
.preamble-list {
  padding-left: 20px;
  margin-bottom: 18px;
}
.preamble-list li {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 10px;
}
.preamble-list li:last-child { margin-bottom: 0; }

/* --- Success screen --- */
.success-card {
  text-align: center;
  padding: 36px 20px 40px;
}
.success-icon {
  font-size: 52px;
  margin-bottom: 14px;
  line-height: 1;
}
.success-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}
.success-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}
.success-ref {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.success-ref strong { color: var(--text-primary); }
.success-link {
  font-size: 14px;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

/* ============================================================
   NEW COMPONENT STYLES — Range slider, Checkbox pills,
   Canvas signature, Additional applicant accordion
   ============================================================ */

/* --- Range slider --- */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.range-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--blue);
  cursor: pointer;
}
.range-val {
  min-width: 52px;
  text-align: center;
  padding: 4px 10px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Multi-select checkbox pills --- */
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.check-item {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.check-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.check-label {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: white;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  cursor: pointer;
  line-height: 1.4;
}
.check-item input[type="checkbox"]:checked ~ .check-label {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}
.check-group.error .check-label {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* --- Canvas signature pad --- */
.sig-wrap {
  margin-top: 6px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
  transition: border-color 0.2s;
}
.sig-wrap.error {
  border-color: var(--red);
  animation: fieldShake 0.35s ease;
}
.sig-canvas {
  display: block;
  width: 100%;
  height: 160px;
  touch-action: none;
  cursor: crosshair;
}
.sig-clear {
  display: block;
  width: 100%;
  padding: 7px;
  border: none;
  border-top: 1px solid #f0f0f0;
  background: #f9fafb;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.sig-clear:hover { background: #f0f2f5; }

/* --- Additional applicant accordion --- */
.applicant-2-toggle {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #d1d5db;
  background: white;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  margin-top: 8px;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.applicant-2-toggle:hover { border-color: var(--blue); }
.applicant-2-toggle .toggle-icon { transition: transform 0.2s; display: inline-block; }
.applicant-2-toggle.open .toggle-icon { transform: rotate(180deg); }

.applicant-2-section {
  display: none;
  padding-left: 14px;
  border-left: 3px solid var(--blue-light);
  margin-top: 14px;
}
.applicant-2-section.visible {
  display: block;
  animation: stepFadeIn 0.2s ease;
}
