/* ===== Pharmalogic assessment — scoped styles (g1af- prefix kept so the existing JS is untouched) ===== */
.g1af-scope, .g1af-scope * { box-sizing: border-box; }
.g1af-scope {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #23282B;
  background: linear-gradient(180deg, #F7F3F8 0%, #FFFFFF 420px);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 3rem;
}
.g1af-scope a { color: #6F2874; }
.g1af-scope a:hover { color: #4F1A53; }
.g1af-scope button, .g1af-scope input, .g1af-scope select, .g1af-scope textarea { font-family: inherit; }

@keyframes g1afIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes g1afFade { from { opacity: 0; } to { opacity: 1; } }

.g1af-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.75rem 1rem 0.5rem; max-width: 900px; margin: 0 auto;
  animation: g1afFade .6s ease both;
}
.g1af-logo { height: 40px; width: auto; max-width: 240px; object-fit: contain; display: block; }

.g1af-progress {
  display: flex; align-items: center; position: relative;
  max-width: 900px; margin: 0 auto; padding: 1rem;
  animation: g1afFade .6s .1s ease both;
}
.g1af-progress::before { display: none; }
.g1af-progress-step {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; position: relative; z-index: 2;
  background: #E6E0E8; transition: background .35s ease, box-shadow .35s ease, transform .35s ease;
}
.g1af-progress-step.active { background: #6F2874; }
.g1af-progress-step.current { background: #6F2874; box-shadow: 0 0 0 5px #EFE8F1; transform: scale(1.15); }
.g1af-progress-line { flex: 1; height: 2px; background: #E6E0E8; transition: background .5s ease; }
.g1af-progress-step.active + .g1af-progress-line { background: #6F2874; }

.g1af-main { padding: 1.75rem 0 0; }
.g1af-container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.g1af-step {
  background: #fff; border-radius: 28px; padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 24px 60px rgba(35,40,43,.08); border: 1px solid #EFEAF1;
  animation: g1afIn .55s cubic-bezier(.2,.7,.2,1) both;
}
.g1af-step[hidden] { display: none !important; }
.g1af-scope [hidden] { display: none !important; }

.g1af-step-header { margin-bottom: 2rem; }
.g1af-step-badge {
  display: inline-flex; align-items: center; gap: 10px;
  color: #6F2874; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 0.9rem; background: transparent; padding: 0; border-radius: 0;
}
.g1af-step-badge::before { content: ''; display: block; width: 28px; height: 2px; background: #AA8AB8; }
.g1af-step-header h1 { font-weight: 600; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 0.6rem; font-size: 34px; color: #23282B; }
.g1af-step-header p { line-height: 1.65; margin: 0; color: #4E5459; font-weight: 300; font-size: 16px; }

.g1af-fields { display: flex; flex-direction: column; gap: 1.25rem; }
.g1af-flex { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.g1af-flex-1 { flex: 1 1 240px; min-width: 0; }
.g1af-field-container { display: flex; flex-direction: column; }

.g1af-input, .g1af-textarea, .g1af-select {
  background: #fff; width: 100%; padding: 0.95rem 1.1rem;
  border: 1px solid #E6E0E8; border-radius: 14px; font-size: 16px; color: #23282B;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
  outline: none; appearance: none; -webkit-appearance: none;
}
.g1af-input::placeholder, .g1af-textarea::placeholder { color: #A7ADB1; font-weight: 300; }
.g1af-input:hover, .g1af-textarea:hover, .g1af-select:hover { border-color: #AA8AB8; }
.g1af-input:focus, .g1af-textarea:focus, .g1af-select:focus { border-color: #6F2874; box-shadow: 0 0 0 4px #EFE8F1; }
.g1af-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236F2874' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.75rem; cursor: pointer;
}
.g1af-select:invalid, .g1af-select option[value=""] { color: #A7ADB1; }
.g1af-textarea { resize: vertical; min-height: 96px; }
.g1af-input.g1af-error, .g1af-textarea.g1af-error, .g1af-select.g1af-error { border-color: #C0392B; box-shadow: 0 0 0 4px rgba(192,57,43,.08); }

.g1af-field-error { color: #C0392B; font-size: 0.85rem; margin-top: 0.4rem; }
.g1af-field-error:empty { display: none; }
.g1af-step-error {
  color: #8E2A20; font-size: 0.92rem; padding: 0.85rem 1.1rem;
  background: #FBEFED; border: 1px solid #F2D6D2; border-radius: 14px;
  animation: g1afIn .4s ease both;
}

.g1af-upload-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0.85rem 1.4rem; border: 1.5px dashed #AA8AB8; border-radius: 999px;
  background: #F7F3F8; color: #6F2874; font-weight: 600; font-size: 15px; cursor: pointer; width: fit-content;
  transition: background .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.g1af-upload-btn::before {
  content: ''; width: 18px; height: 18px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236F2874' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V5M7 10l5-5 5 5'/%3E%3Cpath d='M4 17v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2'/%3E%3C/svg%3E") center/contain no-repeat;
}
.g1af-upload-btn:hover { background: #EFE8F1; border-color: #6F2874; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(111,40,116,.14); }
.g1af-file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.g1af-file-chosen { margin-top: 0.5rem; font-size: 0.85rem; color: #6F2874; display: block; font-weight: 500; }

.g1af-question-item { margin-bottom: 0.25rem; }
.g1af-question-header { display: flex; gap: 0.6rem; margin-bottom: 0.85rem; align-items: flex-start; }
.g1af-question-number { font-size: 17px; font-weight: 600; color: #AA8AB8; min-width: 24px; line-height: 1.5; }
.g1af-question-number:empty { display: none; }
.g1af-question-title { line-height: 1.45; flex: 1; font-weight: 500; font-size: 17px; color: #23282B; }
.g1af-question-subtitle { margin-top: 0.25rem; font-size: 0.9rem; color: #A7ADB1; font-weight: 300; }

.g1af-checkbox-group, .g1af-radio-group { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.g1af-inline-group { flex-direction: row; flex-wrap: wrap; gap: 0.6rem; }
.g1af-inline-group .g1af-radio-item, .g1af-inline-group .g1af-checkbox-item { flex: 0 1 auto; padding: 0.7rem 1.15rem; border-radius: 999px; min-width: 96px; }
.g1af-inline-group .g1af-radio-item span, .g1af-inline-group .g1af-checkbox-item span { flex: 0 0 auto; white-space: nowrap; }
.g1af-fields { gap: 1rem; }
.g1af-flex { gap: 1rem; }
.g1af-question-item { padding-top: 0.5rem; }
.g1af-question-item + .g1af-question-item { border-top: 1px solid #F3EEF4; padding-top: 1.25rem; }
@media (max-width: 480px) { .g1af-inline-group .g1af-radio-item, .g1af-inline-group .g1af-checkbox-item { flex: 1 1 calc(50% - 0.3rem); justify-content: flex-start; } .g1af-inline-group .g1af-radio-item span, .g1af-inline-group .g1af-checkbox-item span { white-space: normal; } }
.g1af-checkbox-item, .g1af-radio-item {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1.1rem; cursor: pointer;
  background: #fff; border: 1px solid #E6E0E8; border-radius: 14px; color: #23282B; font-size: 16px;
  transition: border-color .25s ease, background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.g1af-checkbox-item:hover, .g1af-radio-item:hover { border-color: #AA8AB8; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(111,40,116,.08); }
.g1af-checkbox-item:has(input:checked), .g1af-radio-item:has(input:checked) { background: #EFE8F1; border-color: #6F2874; }
.g1af-checkbox-item input, .g1af-radio-item input {
  width: 20px; height: 20px; flex-shrink: 0; margin: 0; accent-color: #6F2874; cursor: pointer;
}
.g1af-checkbox-item span, .g1af-radio-item span, .g1af-checkbox-item label, .g1af-radio-item label { font-size: 16px; color: #23282B; cursor: pointer; flex: 1; margin: 0; line-height: 1.4; }

.g1af-checkbox-inline { display: flex; align-items: flex-start; gap: 0.75rem; }
.g1af-checkbox-inline input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: #6F2874; cursor: pointer; }
.g1af-checkbox-inline label { font-size: 15px; line-height: 1.55; color: #23282B; font-weight: 300; cursor: pointer; }

.g1af-consent-box { background: #F7F3F8; padding: 1.4rem; border-radius: 18px; border: 1px solid #EFEAF1; display: flex; flex-direction: column; gap: 1rem; }

.g1af-info-message { background: #F7F3F8; border: 1px solid #EFEAF1; border-radius: 16px; padding: 1.25rem; text-align: center; color: #6F2874; font-weight: 400; }
.g1af-info-message p { margin: 0; }

.g1af-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: 1.5rem; gap: 1rem; border-top: 1px solid #EFEAF1; }
.g1af-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.85rem 1.75rem; border-radius: 999px; font-size: 16px; font-weight: 600; cursor: pointer; border: none;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
}
.g1af-btn-back { background: transparent; color: #23282B; border: 1px solid #E6E0E8; }
.g1af-btn-back:hover:not(:disabled) { border-color: #6F2874; color: #6F2874; }
.g1af-btn-back:disabled { opacity: 0.35; cursor: not-allowed; }
.g1af-btn-next, .g1af-btn-submit { background: #6F2874; color: #fff; }
.g1af-btn-next:hover:not(:disabled), .g1af-btn-submit:hover:not(:disabled) { background: #5A1F5E; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(111,40,116,.3); }
.g1af-btn-submit:disabled { background: #A7ADB1; cursor: not-allowed; }
.g1af-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px #EFE8F1; }

.g1af-sig-box { border: 1px solid #E6E0E8; border-radius: 16px; padding: 10px; background: #fff; max-width: 480px; }
.g1af-sig-canvas { touch-action: none; display: block; width: 100%; height: 160px; background: #F7F3F8; border-radius: 10px; cursor: crosshair; }
.g1af-sig-clear { margin-top: 0.6rem; padding: 0.5rem 1.1rem; font-size: 14px; }
.g1af-sig-note { margin-top: 0.5rem; font-size: 0.82rem; color: #6F2874; font-weight: 500; }

.g1af-readonly { background: #F7F3F8; padding: 0.95rem 1.1rem; border-radius: 14px; color: #23282B; border: 1px solid #EFEAF1; }

.g1af-success { text-align: center; padding: 3.5rem 1.5rem; }
.g1af-success-icon {
  width: 80px; height: 80px; background: #6F2874; color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; font-size: 2rem; font-weight: 600;
  box-shadow: 0 0 0 12px #EFE8F1; animation: g1afIn .6s .1s cubic-bezier(.2,.7,.2,1) both;
}
.g1af-success h1 { font-weight: 600; letter-spacing: -.02em; font-size: 32px; margin: 0 0 1rem; }
.g1af-success p { line-height: 1.65; max-width: 520px; margin: 0 auto 1.5rem; color: #4E5459; font-weight: 300; }
.g1af-download-link { display: inline-block; margin-top: 0.5rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
  .g1af-step { border-radius: 20px; }
  .g1af-step-header h1 { font-size: 26px; }
  .g1af-question-title { font-size: 16px; }
  .g1af-nav { flex-direction: column-reverse; align-items: stretch; }
  .g1af-btn { justify-content: center; }
}

.g1af-question-hint { margin: 0 0 .75rem; font-size: .875rem; line-height: 1.45; color: #6B6470; }
