/* ============================================================
   Amnis Beacon Intake Form - Front End Styles
   Update --ai-primary to match your brand color
   ============================================================ */

:root {
  --ai-primary:      #0047AB;
  --ai-primary-dark: #003080;
  --ai-primary-light:#f0f5ff;
  --ai-error:        #cc0000;
  --ai-success:      #1a7a1a;
  --ai-border:       #d0d0d0;
  --ai-text:         #111111;
  --ai-text-muted:   #555555;
  --ai-bg:           #ffffff;
  --ai-bg-section:   #fafafa;
  --ai-radius:       6px;
}

.amnis-intake-wrap {
  max-width: 780px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ai-text);
}

/* ── Progress Bar ── */
.ai-progress-wrap {
  margin-bottom: 36px;
}

.ai-progress-track {
  background: #e5e5e5;
  height: 6px;
  border-radius: 3px;
  margin-bottom: 14px;
  overflow: hidden;
}

.ai-progress-fill {
  background: var(--ai-primary);
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.ai-progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.ai-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  text-align: center;
}

.ai-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e5e5;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s;
}

.ai-progress-step.active .ai-step-dot,
.ai-progress-step.done .ai-step-dot {
  background: var(--ai-primary);
  color: #fff;
}

.ai-step-label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.ai-progress-step.active .ai-step-label,
.ai-progress-step.done .ai-step-label {
  color: var(--ai-primary);
}

@media (max-width: 540px) {
  .ai-step-label { display: none; }
  .ai-step-dot   { width: 22px; height: 22px; font-size: 11px; }
}

/* ── Messages ── */
.ai-messages {
  padding: 12px 16px;
  border-radius: var(--ai-radius);
  margin-bottom: 20px;
  font-size: 14px;
}

.ai-messages.error   { background: #fff0f0; border-left: 4px solid var(--ai-error); color: #700; }
.ai-messages.success { background: #f0fff0; border-left: 4px solid var(--ai-success); color: #080; }

/* ── Step panels ── */
.ai-step { display: none; }
.ai-step--active { display: block; }

.ai-step-header {
  margin-bottom: 28px;
}

.ai-step-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ai-text);
}

.ai-step-header p {
  font-size: 15px;
  color: var(--ai-text-muted);
  margin: 0;
}

/* ── Sections ── */
.ai-section {
  background: var(--ai-bg-section);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.ai-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ai-primary);
  color: var(--ai-primary);
}

/* ── Fields ── */
.ai-field {
  margin-bottom: 20px;
}

.ai-field:last-child { margin-bottom: 0; }

.ai-field > label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 7px;
  color: #222;
}

.ai-req { color: var(--ai-error); }

.ai-field input[type="text"],
.ai-field input[type="email"],
.ai-field input[type="tel"],
.ai-field input[type="url"],
.ai-field input[type="date"],
.ai-field select,
.ai-field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--ai-border);
  border-radius: 4px;
  font-size: 15px;
  background: #fff;
  color: var(--ai-text);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.ai-field select {
  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 fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.ai-field input:focus,
.ai-field select:focus,
.ai-field textarea:focus {
  border-color: var(--ai-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,71,171,0.12);
}

.ai-field textarea {
  min-height: 90px;
  resize: vertical;
}

/* ── Two-col row ── */
.ai-row.ai-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 540px) {
  .ai-row.ai-two-col { grid-template-columns: 1fr; }
}

/* ── Radio buttons ── */
.ai-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  font-size: 15px;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--ai-border);
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}

.ai-radio:hover {
  border-color: var(--ai-primary);
  background: var(--ai-primary-light);
}

.ai-radio input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--ai-primary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.ai-radio input[type="radio"]:checked + span,
.ai-radio:has(input:checked) {
  color: var(--ai-primary);
}

.ai-radio:has(input:checked) {
  border-color: var(--ai-primary);
  background: var(--ai-primary-light);
  font-weight: 600;
}

/* ── Checkboxes ── */
.ai-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-checkbox-group--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

@media (max-width: 540px) {
  .ai-checkbox-group--grid { grid-template-columns: 1fr; }
}

.ai-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  padding: 7px 10px;
  border: 1px solid var(--ai-border);
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}

.ai-checkbox:hover {
  border-color: var(--ai-primary);
  background: var(--ai-primary-light);
}

.ai-checkbox:has(input:checked) {
  border-color: var(--ai-primary);
  background: var(--ai-primary-light);
  font-weight: 600;
}

.ai-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ai-primary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

/* ── Error messages ── */
.ai-error {
  display: block;
  color: var(--ai-error);
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

.ai-field.has-error input,
.ai-field.has-error select,
.ai-field.has-error textarea {
  border-color: var(--ai-error);
  box-shadow: 0 0 0 3px rgba(204,0,0,0.1);
}

/* ── Note box ── */
.ai-note {
  background: var(--ai-primary-light);
  border-left: 4px solid var(--ai-primary);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  border-radius: 0 4px 4px 0;
  color: #333;
}

/* ── Terms ── */
.ai-section--terms {
  background: #fff;
}

.ai-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}

.ai-terms-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--ai-primary);
}

/* ── Navigation buttons ── */
.ai-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}

.ai-btn {
  padding: 13px 32px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.1s;
}

.ai-btn:active { transform: scale(0.98); }

.ai-btn--prev {
  background: transparent;
  border: 2px solid var(--ai-border);
  color: var(--ai-text-muted);
}

.ai-btn--prev:hover {
  border-color: var(--ai-primary);
  color: var(--ai-primary);
}

.ai-btn--next,
.ai-btn--submit {
  background: var(--ai-primary);
  color: #fff;
  margin-left: auto;
}

.ai-btn--next:hover,
.ai-btn--submit:hover {
  background: var(--ai-primary-dark);
}

.ai-btn--submit {
  background: #1a7a1a;
}

.ai-btn--submit:hover { background: #155a15; }

.ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Success screen ── */
.ai-success {
  text-align: center;
  padding: 60px 32px;
  background: var(--ai-bg-section);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
}

.ai-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #1a7a1a;
  color: #fff;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.ai-success h2 {
  font-size: 26px;
  margin-bottom: 12px;
}

.ai-success p {
  font-size: 16px;
  color: var(--ai-text-muted);
  max-width: 480px;
  margin: 0 auto 12px;
  line-height: 1.6;
}

.ai-success-note {
  font-size: 14px !important;
  background: var(--ai-primary-light);
  border-left: 4px solid var(--ai-primary);
  padding: 10px 16px;
  border-radius: 0 4px 4px 0;
  text-align: left;
  color: #333 !important;
  max-width: 480px;
  margin: 20px auto 0 !important;
}
