/* ==========================================
   APPOINTMENT FORM CUSTOM STYLES
   ========================================== */

/* Page layout adjustments */
.appointment-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.appointment-card {
  padding: 40px;
  background: var(--bg-light);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
}

/* Step/Section Headings */
.form-section {
  margin-bottom: 45px;
  position: relative;
}

.form-section:not(:last-child) {
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 30px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.section-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.1rem;
}

.section-title {
  font-size: 1.4rem;
  color: var(--primary-dark);
  font-family: var(--font-headings);
  font-weight: 600;
  margin: 0;
}

/* Services Grid Checkcards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 15px;
}

.service-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background-color: var(--bg-neutral);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.service-card:hover {
  background-color: #F1F5F9;
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.service-card.selected {
  background-color: rgba(10, 25, 49, 0.04);
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(10, 25, 49, 0.05);
}

.service-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.service-card-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 500;
}

.service-card.selected .service-card-text {
  color: var(--primary-dark);
  font-weight: 600;
}

/* Signature & Seal Components */
.signoff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 25px;
}

@media (max-width: 768px) {
  .signoff-container {
    grid-template-columns: 1fr;
  }
}

.signature-box, .seal-box {
  background-color: var(--bg-neutral);
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 20px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.signature-box.active-drawing {
  border-color: var(--primary-color);
}

.signature-label, .seal-label {
  font-family: var(--font-headings);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.signature-canvas-container {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
  width: 100%;
  max-width: 400px;
  height: 150px;
  position: relative;
  touch-action: none; /* Prevents scrolling while signing */
}

.signature-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.signature-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  justify-content: flex-end;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-fast);
}

.btn-outline-danger {
  background: transparent;
  color: #EF4444;
  border: 1px solid #EF4444;
}

.btn-outline-danger:hover {
  background: #EF4444;
  color: white;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
}

/* Seal Uploader */
.seal-upload-zone {
  width: 100%;
  max-width: 400px;
  height: 150px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

.seal-upload-zone:hover {
  border-color: var(--primary-color);
  background-color: rgba(10, 25, 49, 0.01);
}

.seal-upload-zone i {
  font-size: 2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.seal-upload-zone span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.seal-upload-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.seal-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

/* Actions Section */
.appointment-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
  align-items: center;
}

.action-buttons-group {
  display: flex;
  gap: 15px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 600px) {
  .action-buttons-group {
    flex-direction: column;
  }
  .action-buttons-group .btn {
    width: 100%;
  }
}

/* Info Alert */
.info-alert {
  background-color: rgba(211, 18, 56, 0.1);
  border-left: 4px solid var(--accent-color);
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 30px;
  font-size: 0.92rem;
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.info-alert i {
  color: var(--accent-dark);
  font-size: 1.1rem;
  margin-top: 3px;
}

/* Toast message styling override/addition */
.toast-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary-dark);
  color: white;
  padding: 16px 24px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================
   PRINT STYLES: HIDES FORM AND PRINTS FORMAL REQUISITION
   ========================================================== */
#print-requisition-letter {
  display: none;
}

@media print {
  /* Hide elements */
  body, html {
    background: white !important;
    color: black !important;
    font-size: 12pt !important;
    padding-top: 0 !important;
  }
  
  #header-placeholder,
  #footer-placeholder,
  .subpage-hero,
  .whatsapp-float,
  .appointment-card,
  .appointment-actions,
  .info-alert,
  .back-home-nav,
  .section-partition {
    display: none !important;
  }

  /* Show Requisition Letter */
  #print-requisition-letter {
    display: block !important;
    font-family: 'Times New Roman', Times, serif;
    color: #111;
    line-height: 1.5;
    padding: 0 20px 20px 20px;
    background: white;
  }

  /* Letterhead Spacer */
  .letter-letterhead-spacer {
    height: 38mm; /* Exactly 38mm space at top for pre-printed institutional letterhead */
    width: 100%;
    display: block;
  }

  .letter-date {
    text-align: right;
    margin-bottom: 12px;
    font-size: 11pt;
  }

  .letter-recipient {
    margin-bottom: 12px;
    font-size: 11pt;
    line-height: 1.4;
  }

  .letter-subject {
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 12px;
    text-align: center;
    font-size: 11pt;
    text-transform: uppercase;
  }

  .letter-body {
    margin-bottom: 12px;
    text-align: justify;
    font-size: 10.5pt;
    line-height: 1.4;
  }

  .letter-body p {
    text-indent: 30px;
    margin-bottom: 8px;
  }

  /* Details Table */
  .letter-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 10pt;
  }

  .letter-table th, .letter-table td {
    border: 1px solid #777;
    padding: 6px 10px;
    text-align: left;
    vertical-align: middle;
  }

  .letter-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    width: 35%;
  }

  .services-list-print {
    margin: 0;
    padding-left: 15px;
  }

  .services-list-print li {
    margin-bottom: 2px;
  }

  /* Signatures section at bottom right */
  .letter-signoff-row {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    page-break-inside: avoid;
  }

  .letter-signature-container {
    width: 220px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .print-seal-wrapper {
    height: 70px;
    width: 100px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
  }

  .print-seal-wrapper img {
    max-height: 70px;
    max-width: 100px;
    object-fit: contain;
  }

  .print-sig-wrapper {
    height: 45px;
    width: 150px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .print-sig-wrapper img {
    max-height: 45px;
    max-width: 150px;
    object-fit: contain;
  }

  .letter-signoff-line {
    border-top: 1px solid #333;
    width: 100%;
    margin-top: 3px;
    padding-top: 3px;
    font-size: 10.5pt;
    font-weight: bold;
  }

  .letter-signoff-designation {
    font-size: 9.5pt;
    color: #444;
  }
}
