/* ============================================================
   SGIR RIGS — feedback.css
   Public-facing feedback portal styles
   ============================================================ */

/* ── Body / Background ─────────────────────────────────────────────────── */
.feedback-body {
  background: linear-gradient(135deg,
    #0d1f0d 0%,
    #1B3A1B 40%,
    #245924 70%,
    #1a3a1a 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.feedback-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(27, 58, 27, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(68, 185, 68, 0.2);
}

.feedback-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feedback-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px 8px;
}

.logo-icon-fallback {
  width: 40px;
  height: 40px;
  background: var(--accent-500);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-company {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.logo-tagline {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}

.header-admin-link {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  transition: color 0.2s;
}
.header-admin-link:hover { color: var(--accent-500); text-decoration: none; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.feedback-hero {
  padding: 48px 24px 32px;
  text-align: center;
}

.feedback-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin: 0;
}

/* ── Main container ────────────────────────────────────────────────────── */
.feedback-main {
  flex: 1;
  padding: 0 16px 48px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
}

/* ── Department Grid ───────────────────────────────────────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 640px)  { .dept-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .dept-grid { grid-template-columns: repeat(4, 1fr); } }

/* Department card */
.dept-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              background 0.2s, border-color 0.2s, box-shadow 0.25s;
  backdrop-filter: blur(6px);
}

.dept-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.13);
  border-color: rgba(68,185,68,0.6);
  box-shadow: 0 12px 36px rgba(0,0,0,0.35), 0 0 0 1px rgba(68,185,68,0.3);
  text-decoration: none;
}

.dept-card:active { transform: translateY(-2px) scale(0.98); }

.dept-card-icon {
  font-size: 2.25rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
  transition: transform 0.25s;
}
.dept-card:hover .dept-card-icon { transform: scale(1.1); }

.dept-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}

.dept-card-arrow {
  font-size: 0.875rem;
  color: rgba(255,255,255,0);
  transition: color 0.2s, transform 0.2s;
}
.dept-card:hover .dept-card-arrow {
  color: var(--accent-400);
  transform: translateX(3px);
}

/* Ripple */
.dept-card-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(68,185,68,0.25);
  width: 0; height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

/* ── Form wrapper ──────────────────────────────────────────────────────── */
.form-wrapper {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 0 40px;
}

/* ── Form card ─────────────────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px;
  background: linear-gradient(135deg, #1B3A1B, #245924);
  border-bottom: none;
}

.form-card-icon { font-size: 2rem; }

.form-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.form-card-subtitle {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.65);
  margin: 0;
}

/* Safety card accent */
.form-card--safety .form-card-header { background: linear-gradient(135deg, #7c1d1d, #b91c1c); }
.form-card--safety .progress-bar-fill--safety { background: #ef4444; }

/* Medical card accent */
.form-card--medical .form-card-header { background: linear-gradient(135deg, #1e3a5f, #2563eb); }
.form-card--medical .progress-bar-fill--medical { background: #3b82f6; }

.form-card-body { padding: 28px; }

/* ── Progress bar ──────────────────────────────────────────────────────── */
.progress-bar-wrap {
  height: 4px;
  background: rgba(0,0,0,0.08);
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-500);
  border-radius: 0 2px 2px 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Step indicator ────────────────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e2e8e2;
  color: #9aaa9a;
  border: 2px solid #e2e8e2;
  transition: all 0.3s;
  flex-shrink: 0;
}

.step-dot.active {
  background: var(--primary-700);
  border-color: var(--primary-700);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(27,58,27,0.18);
}

.step-dot.completed {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: var(--primary-900);
}

.step-line {
  flex: 1;
  max-width: 40px;
  height: 2px;
  background: #e2e8e2;
  transition: background 0.3s;
}

/* ── Form steps ────────────────────────────────────────────────────────── */
.form-step {
  display: none;
  animation: fadeInUp 0.3s ease forwards;
}
.form-step.active { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.step-desc {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.medical-title { color: #1e3a5f; }

/* ── Step actions ──────────────────────────────────────────────────────── */
.step-actions {
  margin-top: 24px;
}

.step-actions.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Star rating ───────────────────────────────────────────────────────── */
.star-rating-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.star-btn {
  background: none;
  border: none;
  font-size: 2.5rem;
  color: #d1d5db;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s, transform 0.15s;
  line-height: 1;
}

.star-btn:hover,
.star-btn.hovered { color: #f59e0b; transform: scale(1.15); }

.star-btn.selected { color: #f59e0b; }
.star-btn.selected:not(:hover) { transform: scale(1.05); }

/* ── Category chips ────────────────────────────────────────────────────── */
.category-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}

.cat-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.cat-chip:hover {
  border-color: var(--accent-500);
  background: rgba(68,185,68,0.05);
}

.cat-chip.selected {
  border-color: var(--accent-500);
  background: rgba(68,185,68,0.08);
  box-shadow: 0 0 0 3px rgba(68,185,68,0.15);
}

.cat-icon { font-size: 1.5rem; flex-shrink: 0; }
.cat-label { font-size: 1rem; font-weight: 700; color: #1e293b; }
.cat-desc  { font-size: 0.8125rem; color: #64748b; margin: 0; }

/* ── Textarea with char counter ────────────────────────────────────────── */
.textarea-wrap { position: relative; }

.form-textarea {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: #fafafa;
  color: #1e293b;
  min-height: 110px;
}

.form-textarea:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px rgba(68,185,68,0.18);
  background: #fff;
}

.char-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
}

/* ── Anonymous toggle ──────────────────────────────────────────────────── */
.anon-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f8faf8;
  border: 1.5px solid #e2e8e2;
  border-radius: 12px;
  margin-bottom: 16px;
}

.anon-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.anon-icon { font-size: 1.2rem; }
.anon-toggle-label strong { display: block; font-size: 0.9375rem; color: #1e293b; }
.anon-toggle-label small  { display: block; font-size: 0.8rem; color: #64748b; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-500); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Contact fields slide-down */
.contact-fields {
  overflow: hidden;
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Safety Observation specific ───────────────────────────────────────── */
.swa-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: 10px;
  margin-bottom: 20px;
  animation: fadeInUp 0.3s ease;
}

.swa-warning-icon { font-size: 1.75rem; flex-shrink: 0; }
.swa-warning strong { display: block; color: #991b1b; font-size: 0.9rem; margin-bottom: 4px; }
.swa-warning p { color: #b91c1c; font-size: 0.85rem; margin: 0; line-height: 1.4; }

.status-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.status-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.status-chip:hover { border-color: var(--accent-500); }
.status-chip.active {
  border-color: var(--accent-500);
  background: rgba(68,185,68,0.07);
  box-shadow: 0 0 0 3px rgba(68,185,68,0.15);
}
.status-chip--close.active { border-color: #22c55e; background: rgba(34,197,94,0.07); }

.status-icon  { font-size: 1.5rem; }
.status-label { font-weight: 700; color: #1e293b; font-size: 0.9375rem; }
.status-desc  { font-size: 0.8rem; color: #64748b; }

/* Observation type cards */
.obs-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

@media (min-width: 480px) { .obs-type-grid { grid-template-columns: repeat(3, 1fr); } }

.obs-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.obs-type-card:hover { border-color: #94a3b8; }
.obs-type-card input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.obs-type-card:has(input:checked) {
  border-color: var(--accent-500);
  background: rgba(68,185,68,0.08);
}
.obs-type-card--swa:has(input:checked) { border-color: #ef4444; background: rgba(239,68,68,0.06); }
.obs-type-card--safe:has(input:checked) { border-color: #22c55e; background: rgba(34,197,94,0.06); }

.obs-type-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.obs-type-icon  { font-size: 1.5rem; }
.obs-type-label { font-size: 0.8rem; font-weight: 600; color: #374151; text-align: center; }
.obs-type-check {
  position: absolute;
  top: 6px; right: 8px;
  font-size: 0.75rem;
  color: var(--accent-500);
  opacity: 0;
  font-weight: 800;
  transition: opacity 0.2s;
}
.obs-type-card:has(input:checked) .obs-type-check { opacity: 1; }

/* ── Medical form specific ─────────────────────────────────────────────── */
.reason-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 480px) { .reason-grid { grid-template-columns: repeat(3, 1fr); } }

.reason-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.reason-chip:hover { border-color: #3b82f6; background: rgba(59,130,246,0.04); }
.reason-chip:has(input:checked) { border-color: #3b82f6; background: rgba(59,130,246,0.08); }
.reason-chip input { display: none; }

.yesno-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.yesno-row--3 > .yesno-btn,
.yesno-row--4 > .yesno-btn { flex: 1; }

.yesno-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
  min-width: 70px;
  color: #374151;
}
.yesno-btn:hover { border-color: #3b82f6; background: rgba(59,130,246,0.05); }
.yesno-btn:has(input:checked) { border-color: #3b82f6; background: rgba(59,130,246,0.1); color: #1e40af; }
.yesno-btn.active { border-color: #3b82f6; background: rgba(59,130,246,0.1); color: #1e40af; }
.yesno-btn input { display: none; }

.likert-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.likert-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.2s;
  color: #374151;
  min-width: 80px;
}
.likert-btn:hover { border-color: #3b82f6; }
.likert-btn:has(input:checked) { border-color: #3b82f6; background: rgba(59,130,246,0.1); color: #1d4ed8; }
.likert-btn input { display: none; }

.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rating-btn {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.2s;
  color: #374151;
}
.rating-btn:hover { border-color: #f59e0b; background: rgba(245,158,11,0.08); }
.rating-btn:has(input:checked) { border-color: #f59e0b; background: rgba(245,158,11,0.12); color: #92400e; }
.rating-btn input { display: none; }
.rating-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-left: 4px;
}

/* ── Submit button ─────────────────────────────────────────────────────── */
.btn-next,
.btn-prev { width: 100%; }

/* ── Success page ──────────────────────────────────────────────────────── */
.feedback-body--success {
  align-items: center;
  justify-content: center;
}

.success-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  width: 100%;
}

.success-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: fadeInScale 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Animated SVG checkmark */
.success-check-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
}

.success-svg {
  width: 100px;
  height: 100px;
  position: relative;
  z-index: 2;
}

.success-circle {
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  animation: drawCircle 0.7s ease 0.1s forwards;
}

.success-check {
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  animation: drawCheck 0.4s ease 0.75s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* Ripple pulse */
.success-ripple {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(68,185,68,0.3);
  animation: ripplePulse 2s ease-out 1s infinite;
}
.success-ripple--2 { animation-delay: 1.5s; }

@keyframes ripplePulse {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.success-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.success-logo { height: 36px; width: auto; }
.success-brand-icon {
  width: 36px; height: 36px;
  background: var(--accent-500);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.success-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-700);
}

.success-title {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.04em;
}

.success-message {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 24px;
}

.success-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.success-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
}
.success-meta-icon { font-size: 1rem; }

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.feedback-footer {
  padding: 20px 24px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.feedback-footer p {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* ── Responsive tweaks ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .form-card-body  { padding: 20px 16px; }
  .success-card    { padding: 36px 24px; }
  .category-chips  { gap: 8px; }
  .step-actions.two-col { grid-template-columns: 1fr 1fr; gap: 8px; }
  .step-title { font-size: 1.125rem; }
}
