/* ==========================================================================
   שאלון תיקוף תוכן PABA & טופס קבלה - SCE
   עיצוב מודרני, נגיש, רספונסיבי ב-Vanilla CSS (RTL)
   ========================================================================== */

:root {
  --primary: #1e3a8a;          /* כחול נייבי עמוק */
  --primary-hover: #172554;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --secondary: #0d9488;        /* טורקיז עמוק */
  --secondary-light: #f0fdfa;
  --accent: #f59e0b;           /* ענבר */
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* סולם ציונים 1-5 */
  --score-1: #ef4444; /* אדום */
  --score-2: #f97316; /* כתום */
  --score-3: #eab308; /* צהוב */
  --score-4: #84cc16; /* ירוק-בהיר */
  --score-5: #10b981; /* אמרלד */

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.12), 0 8px 10px -6px rgb(0 0 0 / 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

img, svg, canvas, video {
  max-width: 100%;
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 800;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.brand-info h1 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
  line-height: 1.3;
}

.brand-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Tab Switcher in Header */
.nav-tabs-wrapper {
  display: flex;
  background-color: var(--bg-alt);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-normal);
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  background-color: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* ==========================================================================
   Sub-Header Sticky Progress & Quick Navigation (for PABA)
   ========================================================================== */
.paba-sticky-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.paba-sticky-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.progress-module {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.progress-track {
  flex: 1;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-percent {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 40px;
}

.quick-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.quick-nav-links::-webkit-scrollbar {
  display: none;
}

.quick-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  white-space: nowrap;
  transition: var(--transition-fast);
}

.quick-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-container {
  max-width: 1100px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.25rem 3rem;
  flex: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ==========================================================================
   Cards & Content Blocks
   ========================================================================== */
.intro-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border-top: 5px solid var(--primary);
}

.intro-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.intro-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.instructions-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.instructions-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dimensions-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.dim-item {
  background: white;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #dbeafe;
}

.dim-badge {
  display: inline-block;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}
.dim-badge.r { background: #fee2e2; color: #b91c1c; }
.dim-badge.a { background: #dbeafe; color: #1d4ed8; }
.dim-badge.s { background: #e0e7ff; color: #4338ca; }

.dim-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scale-legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--primary-border);
}

.scale-pill {
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: white;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.scale-pill .num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   Respondent Details Form
   ========================================================================== */
.form-section-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.section-card-header {
  border-bottom: 2px solid var(--bg-alt);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-card-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.part-badge {
  background: var(--bg-alt);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-label .req {
  color: var(--score-1);
}

.form-control {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea.form-control {
  min-height: 85px;
  resize: vertical;
}

.radio-group-inline {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.4rem;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.radio-label input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Questionnaire Part A & Item Cards
   ========================================================================== */
.battery-part-header {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin: 2.5rem 0 1.25rem;
  box-shadow: var(--shadow-md);
}

.battery-part-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.battery-part-header p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.division-header {
  background: #f1f5f9;
  border-right: 5px solid var(--secondary);
  padding: 0.85rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0 1rem;
}

.division-header h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

/* Item Evaluation Card */
.item-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.item-card.has-rating {
  border-right: 4px solid var(--secondary);
}

.item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.item-code-badge {
  font-size: 0.85rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #1e293b;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  white-space: nowrap;
}

.item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.item-question {
  background: #fff;
  border: 1px solid var(--primary-border);
  border-right: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  font-size: 0.95rem;
  white-space: pre-line;
}

.item-question-label {
  display: block;
  color: var(--primary);
  font-size: 0.84rem;
  margin-bottom: 0.25rem;
}

.item-question p {
  margin: 0;
}

.item-statement {
  background: var(--bg-alt);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  border-right: 3px solid #94a3b8;
}

/* Dimensions Rating Grid inside item */
.item-ratings-area {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid #f1f5f9;
}

.dimension-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dim-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 180px;
}

.dim-letter {
  font-weight: 800;
  font-size: 0.85rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.dim-letter.r { background: #dc2626; }
.dim-letter.a { background: #2563eb; }
.dim-letter.s { background: #4f46e5; }

.dim-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Rating Scale Selector (1-5) */
.rating-scale-btns {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.rating-pill {
  position: relative;
  cursor: pointer;
}

.rating-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-box {
  width: 38px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: white;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.rating-pill:hover .pill-box {
  border-color: #94a3b8;
  background: #f1f5f9;
  transform: translateY(-1px);
}

/* Rating Active Colors */
.rating-pill input[type="radio"]:checked + .pill-box[data-score="1"] {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.rating-pill input[type="radio"]:checked + .pill-box[data-score="2"] {
  background: #ffedd5;
  border-color: #f97316;
  color: #c2410c;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}
.rating-pill input[type="radio"]:checked + .pill-box[data-score="3"] {
  background: #fef9c3;
  border-color: #eab308;
  color: #854d0e;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}
.rating-pill input[type="radio"]:checked + .pill-box[data-score="4"] {
  background: #ecfccb;
  border-color: #84cc16;
  color: #3f6212;
  box-shadow: 0 0 0 2px rgba(132, 204, 22, 0.2);
}
.rating-pill input[type="radio"]:checked + .pill-box[data-score="5"] {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Item Comments Box */
.item-comment-field {
  position: relative;
}

.item-comment-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  min-height: 48px;
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
}

.item-comment-field textarea:focus {
  border-color: var(--border-focus);
  min-height: 70px;
}

.comment-hint {
  font-size: 0.75rem;
  color: #ea580c;
  margin-top: 0.25rem;
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.comment-hint.show {
  display: flex;
}

/* ==========================================================================
   Part B - Composite Scores
   ========================================================================== */
.composite-row {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.composite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.composite-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.composite-statement {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.composite-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Part C - Qualitative Questions
   ========================================================================== */
.qual-question-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.qual-question-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.qual-num {
  background: var(--primary-light);
  color: var(--primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   Receipt & Compensation Form (SCE)
   ========================================================================== */
.receipt-wrapper {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 850px;
  margin: 0 auto;
}

.receipt-institution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
}

.receipt-logo-text {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #1e293b;
  font-family: 'Rubik', sans-serif;
}

.receipt-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.receipt-main-title {
  text-align: center;
  font-size: 1.65rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  margin-bottom: 1.75rem;
  color: #0f172a;
}

/* Allow text selection / copy-paste everywhere in the receipt */
.receipt-wrapper {
  user-select: text;
  -webkit-user-select: text;
  line-height: 1.7;
}

.receipt-statement-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 1.05rem;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.receipt-section-block {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.receipt-section-label {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.receipt-fixed-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 1rem;
  color: #1e293b;
}

.receipt-check-icon {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--primary);
  font-weight: 900;
}

.receipt-static-val {
  display: inline-block;
  font-weight: 800;
  color: #0f172a;
  padding: 0.1rem 0.5rem;
  border-bottom: 2px solid #0f172a;
  background: rgba(226, 232, 240, 0.4);
  border-radius: 2px 2px 0 0;
  letter-spacing: 0.2px;
}

.receipt-static-val.researcher-highlight {
  font-size: 1.08rem;
  color: #1e3a8a;
  border-color: #1e3a8a;
}

.receipt-static-val.amount-highlight {
  font-size: 1.15rem;
  min-width: 45px;
  text-align: center;
  color: #0f172a;
}

.receipt-legal-block {
  background: #fffbeb;
  border-right: 4px solid var(--accent);
  padding: 1.1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: #78350f;
  line-height: 1.7;
  margin: 1.75rem 0;
}

.receipt-legal-block p + p {
  margin-top: 0.65rem;
}

/* Editable Participant Section */
.receipt-participant-section {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.receipt-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.receipt-input {
  background: #f8fafc;
  border: 1.5px solid #94a3b8;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.receipt-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

/* Digital Signature Pad */
.signature-section {
  margin-top: 1rem;
  border: 1.5px dashed #94a3b8;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: #fafafa;
}

.signature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.signature-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.canvas-container {
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  touch-action: none;
}

canvas#signatureCanvas {
  display: block;
  width: 100%;
  height: 180px;
  cursor: crosshair;
}

.canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-size: 0.9rem;
  color: #94a3b8;
  transition: opacity 0.2s;
}

.canvas-hint.hidden {
  opacity: 0;
}

.receipt-footer-notes {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* ==========================================================================
   Submit Buttons & Actions
   ========================================================================== */
.submit-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.btn-primary-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.9rem 2.5rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
  transition: all 0.2s ease;
}

.btn-primary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.35);
}

.btn-primary-large:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

/* ==========================================================================
   Modals & Alerts
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-window {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-sub);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideUp 0.3s ease;
}

.toast.success { background: #065f46; border-right: 4px solid #10b981; }
.toast.error { background: #991b1b; border-right: 4px solid #ef4444; }
.toast.info { background: #1e3a8a; border-right: 4px solid #3b82f6; }

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

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  /* Layout & Containers */
  .main-container {
    padding: 0 0.75rem 2rem;
    margin: 1rem auto;
    width: 100%;
    max-width: 100vw;
  }

  /* Header & Navigation */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
  }

  .brand-area {
    justify-content: center;
    text-align: center;
  }

  .brand-info h1 {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  .nav-tabs-wrapper {
    width: 100%;
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem;
    gap: 0.35rem;
  }

  .nav-tabs-wrapper::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 1 0 auto;
    justify-content: center;
    white-space: nowrap;
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
    gap: 0.35rem;
  }

  .tab-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  /* Sub-header Sticky Progress Bar */
  .paba-sticky-bar {
    padding: 0.5rem 0.75rem;
  }

  .paba-sticky-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .progress-module {
    min-width: 0;
    width: 100%;
  }

  .quick-nav-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding-bottom: 2px;
  }

  .quick-nav-links::-webkit-scrollbar {
    display: none;
  }

  .quick-link {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }

  .autosave-status {
    font-size: 0.72rem;
    justify-content: flex-end;
  }

  /* Cards & General Content */
  .intro-card {
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
  }

  .intro-card h2 {
    font-size: 1.25rem;
  }

  .intro-lead {
    font-size: 0.95rem;
  }

  .instructions-box {
    padding: 1rem 0.75rem;
  }

  .form-section-card {
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
  }

  .battery-part-header {
    padding: 1rem 0.85rem;
    margin: 1.5rem 0 1rem;
  }

  .battery-part-header h3 {
    font-size: 1.15rem;
  }

  .division-header {
    padding: 0.65rem 0.85rem;
  }

  .division-header h4 {
    font-size: 1.05rem;
  }

  /* Item Cards & 1-5 Rating */
  .item-card {
    padding: 1rem 0.85rem;
    margin-bottom: 0.85rem;
  }

  .dimension-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .dim-info {
    min-width: 0;
    width: 100%;
  }

  .rating-scale-btns {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
  }

  .rating-pill {
    flex: 1;
    min-width: 0;
    display: flex;
  }

  .pill-box {
    width: 100%;
    height: 38px;
    font-size: 0.95rem;
    padding: 0;
  }

  /* Part B - Composite Scores */
  .composite-row {
    padding: 1rem 0.85rem;
  }

  .composite-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .composite-actions .rating-scale-btns {
    width: 100%;
  }

  /* Part C - Qualitative Questions */
  .qual-question-card {
    padding: 1rem 0.85rem;
  }

  /* Receipt & Compensation Form */
  .receipt-wrapper {
    padding: 1.25rem 0.85rem;
  }

  .receipt-institution-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .receipt-main-title {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
  }

  .receipt-statement-row {
    padding: 0.75rem 0.6rem;
    font-size: 0.95rem;
    gap: 0.4rem;
  }

  .receipt-participant-section {
    padding: 1rem 0.75rem;
  }

  .receipt-inputs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .signature-section {
    padding: 0.85rem 0.6rem;
  }

  /* Action Buttons & Modals */
  .submit-card {
    padding: 1.5rem 1rem;
    margin-top: 1.75rem;
  }

  .btn-primary-large {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
  }

  .modal-window {
    width: 95vw;
    max-width: 95vw;
    padding: 1.25rem 1rem;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 0 0.5rem 1.5rem;
  }

  .brand-info h1 {
    font-size: 1rem;
  }

  .tab-btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.76rem;
  }

  .item-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .pill-box {
    height: 36px;
    font-size: 0.9rem;
  }

  .receipt-logo-text {
    font-size: 1.45rem;
  }

  .receipt-main-title {
    font-size: 1.2rem;
  }
}

/* ================= Print & PDF Generation Styles ================= */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .site-header,
  .tab-nav,
  .floating-progress-card,
  .modal-backdrop,
  .toast-container,
  .site-footer,
  #pabaValidationView,
  #protocolView,
  #btnSubmitReceipt,
  #btnPrintReceiptBtn,
  #btnClearSignature,
  #canvasHint {
    display: none !important;
  }

  /* When printing specifically the receipt */
  #receiptView {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .receipt-wrapper {
    box-shadow: none !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 4px !important;
    padding: 1.5rem 2rem !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .receipt-institution-header {
    border-bottom: 2px solid #065f46 !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 1.25rem !important;
  }

  .receipt-logo-text {
    color: #065f46 !important;
  }

  .receipt-main-title {
    margin: 1rem 0 1.25rem 0 !important;
    font-size: 1.8rem !important;
  }

  .receipt-static-val {
    border-bottom: 1.5px solid #000000 !important;
    background: transparent !important;
  }

  .receipt-legal-block {
    background: #f8fafc !important;
    border-right: 3px solid #64748b !important;
    color: #334155 !important;
    padding: 0.75rem 1rem !important;
    margin: 1.25rem 0 !important;
    font-size: 0.85rem !important;
  }

  .receipt-inputs-grid {
    margin-bottom: 1rem !important;
    gap: 1rem !important;
  }

  .receipt-input {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1.5px solid #0f172a !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0.25rem 0.1rem !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
  }

  .signature-section {
    background: #ffffff !important;
    border: 1px dashed #64748b !important;
    padding: 0.75rem !important;
    margin-top: 0.5rem !important;
  }

  .canvas-container {
    border: 1px solid #cbd5e1 !important;
  }

  canvas#signatureCanvas {
    height: 140px !important;
  }

  .receipt-footer-notes {
    margin-top: 1.5rem !important;
    padding-top: 0.75rem !important;
    font-size: 0.78rem !important;
  }
}

