/* ==========================================================================
   USTP GUIDANCE AND COUNSELING SERVICES (GCS)
   OFFICIAL ISO FORMS STYLESHEET (DPM DOCUMENT SERIES)
   FM-USTP-GCS-01 TO FM-USTP-GCS-16
   ========================================================================== */

:root {
  --gcs-font-serif: "Times New Roman", Times, Georgia, serif;
  --gcs-font-sans:
    "Arial", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gcs-border-color: #000000;
  --gcs-text-color: #000000;
  --gcs-bg-sheet: #ffffff;
  --gcs-primary: #003366;
  --gcs-accent: #f39c12;
}

* {
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

body.gcs-form-body {
  margin: 0;
  padding: 0;
  background-color: #525659;
  font-family: var(--gcs-font-serif);
  color: var(--gcs-text-color);
  font-size: 10.5pt;
  line-height: 1.25;
}

/* ==========================================================================
   SCREEN CONTROLS TOOLBAR
   ========================================================================== */
.gcs-toolbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  color: #ffffff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  font-family: var(--gcs-font-sans);
}

.gcs-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gcs-toolbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.gcs-toolbar-brand img {
  height: 24px;
  width: auto;
}

.gcs-iso-badge {
  background: #0ea5e9;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.gcs-doc-code-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: monospace;
}

.gcs-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gcs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
}

.gcs-btn-secondary {
  background: #334155;
  color: #f1f5f9;
}
.gcs-btn-secondary:hover {
  background: #475569;
  color: #ffffff;
}

.gcs-btn-primary {
  background: #2563eb;
  color: #ffffff;
}
.gcs-btn-primary:hover {
  background: #1d4ed8;
}

.gcs-btn-success {
  background: #16a34a;
  color: #ffffff;
}
.gcs-btn-success:hover {
  background: #15803d;
}

/* ==========================================================================
   SHEET CONTAINERS & PAPER DIMENSIONS
   ========================================================================== */
.gcs-paper-viewport {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
  gap: 28px;
}

.gcs-sheet {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  box-sizing: border-box;
  color: #000000;
}

/* Portrait Sheets (A4 / Letter Tall) */
.gcs-sheet-portrait {
  width: 210mm;
  min-height: 297mm;
  padding: 10mm 14mm 10mm 14mm;
}

/* Landscape Sheets (A4 Landscape) */
.gcs-sheet-landscape {
  width: 297mm;
  min-height: 210mm;
  padding: 8mm 14mm 24mm 14mm;
  box-sizing: border-box;
  position: relative;
  background: #ffffff;
}

/* Page Break for Multi-page forms */
.gcs-page-break {
  page-break-after: always;
  break-after: page;
}

/* ==========================================================================
   OFFICIAL WORD DOCX HEADER & BANNER
   ========================================================================== */
.gcs-docx-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 16px;
}

.gcs-docx-banner-img {
  height: 64px;
  max-width: 480px;
  object-fit: contain;
  object-position: left center;
}

.gcs-docx-header-row.landscape .gcs-docx-banner-img {
  height: 68px;
  max-width: 620px;
}

/* 4-Row Document Code Table (Strict match to user sample image #001F5F header) */
.gcs-doc-code-box {
  width: 165px;
  border: 1px solid #000000;
  border-collapse: collapse;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7pt;
  line-height: 1.1;
  text-align: center;
  background: #ffffff;
  flex-shrink: 0;
}

.gcs-doc-code-box td {
  border: 1px solid #000000;
  padding: 1px 2px;
  text-align: center;
  vertical-align: middle;
}

.gcs-doc-code-box .doc-blue-header,
.gcs-doc-code-box .hdr-label {
  background-color: #001f5f !important;
  color: #ffffff !important;
  font-weight: bold;
  font-size: 6.5pt;
  padding: 1.5px 1px;
  letter-spacing: 0.2px;
}

.gcs-doc-code-box .doc-code-title,
.gcs-doc-code-box .code-val {
  font-size: 9.5pt;
  font-weight: bold;
  color: #000000;
  background-color: #ffffff;
  padding: 2px 1px;
  letter-spacing: 0.3px;
}

.gcs-doc-code-box .doc-sub-val,
.gcs-doc-code-box .sub-val {
  font-size: 7pt;
  color: #000000;
  background-color: #ffffff;
  padding: 1.5px 1px;
}

/* Appointment Log Specific Layout (Exact Match to User DOCX / Image Sample) */
.appointment-header-container {
  position: relative;
  width: 100%;
  margin-bottom: 8px;
}

.appointment-header-center {
  text-align: center;
  margin: 0 auto;
  max-width: 460px;
}

.appointment-header-logo {
  width: 390px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.appointment-header-dept {
  font-family: "Times New Roman", Times, serif;
  font-size: 10.5pt;
  font-weight: bold;
  letter-spacing: 0.3px;
  margin-top: 6px;
  text-align: center;
  color: #000000;
}

.appointment-header-title {
  font-family: "Times New Roman", Times, serif;
  font-size: 10.5pt;
  font-weight: bold;
  letter-spacing: 0.3px;
  margin-top: 4px;
  text-align: center;
  color: #000000;
}

.appointment-doc-box-wrap {
  position: absolute;
  top: 0;
  right: 0;
}

.appointment-meta-wrap {
  margin-top: 8px;
  margin-bottom: 6px;
  font-family: "Times New Roman", Times, serif;
  font-size: 8.5pt;
  color: #000000;
}

.appointment-meta-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 2px;
  height: 18px;
}

.appointment-meta-label {
  font-weight: bold;
  display: inline-block;
  width: 245px;
  flex-shrink: 0;
  white-space: nowrap;
}

.appointment-meta-colon {
  font-weight: bold;
  margin: 0 8px 0 2px;
  width: 8px;
  text-align: center;
  flex-shrink: 0;
}

.appointment-meta-underline {
  display: inline-block;
  border-bottom: 1px solid #000000;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  vertical-align: bottom;
}

.appointment-sublines-wrap {
  display: flex;
  gap: 36px;
  margin-top: 3px;
  margin-left: 45px;
}

.appointment-sublines-col {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.appointment-subline-item {
  border-bottom: 1px solid #000000;
  height: 14px;
  width: 100%;
}

.appointment-table-exact {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #000000;
  font-family: "Times New Roman", Times, serif;
  margin-top: 6px;
  margin-bottom: 4px;
}

.appointment-table-exact th,
.appointment-table-exact td {
  border: 1px solid #000000;
  vertical-align: middle;
}

.appointment-table-exact th {
  font-weight: bold;
  text-align: center;
  font-size: 8.5pt;
  padding: 4px 2px;
  background-color: #ffffff;
  line-height: 1.15;
}

.appointment-table-exact td {
  font-size: 8pt;
  padding: 2px 4px;
  height: 22px;
  box-sizing: border-box;
  line-height: 1.15;
}

.appointment-footer-exact {
  position: absolute;
  bottom: 6mm;
  left: 14mm;
  right: 14mm;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  box-sizing: border-box;
}

.appointment-footer-text {
  flex: 1;
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 7.2pt;
  line-height: 1.3;
  color: #000000;
  padding-left: 90px; /* offset for balanced centering */
}

.appointment-footer-socotec {
  width: 88px;
  height: auto;
  flex-shrink: 0;
}

/* PDS & Official Form Portrait Footer (Centered Address with Right SOCOTEC Seal) */
.pds-official-footer {
  position: absolute;
  bottom: 8mm;
  left: 14mm;
  right: 14mm;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.pds-official-footer-text {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 8pt;
  color: #000000;
  line-height: 1.35;
  width: 100%;
  padding-right: 125px;
  padding-left: 125px;
  box-sizing: border-box;
}

.pds-official-footer-stamp {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.pds-official-footer-stamp img {
  height: 58px;
  width: auto;
  display: block;
}

/* Department & Form Titles */
.gcs-docx-dept-title {
  text-align: center;
  font-family: var(--gcs-font-sans);
  font-weight: 700;
  font-size: 11pt;
  letter-spacing: 0.5px;
  margin: 4px 0 2px;
  text-transform: uppercase;
}

.gcs-docx-form-title {
  text-align: center;
  font-family: var(--gcs-font-sans);
  font-weight: 700;
  font-size: 13pt;
  letter-spacing: 0.8px;
  margin: 2px 0 10px;
  text-transform: uppercase;
}

.gcs-docx-form-subtitle {
  text-align: center;
  font-family: var(--gcs-font-sans);
  font-style: italic;
  font-size: 9.5pt;
  margin: -6px 0 10px;
}

/* ==========================================================================
   OFFICIAL WORD DOCX FOOTER
   ========================================================================== */
.gcs-docx-footer {
  position: absolute;
  bottom: 8mm;
  left: 14mm;
  right: 14mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--gcs-font-sans);
  font-size: 7.5pt;
  line-height: 1.25;
  border-top: 0.5px solid rgba(0, 0, 0, 0.25);
  padding-top: 4px;
}

.gcs-docx-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gcs-docx-footer-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.gcs-docx-footer-text {
  color: #111111;
}

.gcs-docx-footer-link {
  color: #003366;
  text-decoration: none;
}

/* ==========================================================================
   WORD DOCX FORM ELEMENTS & TABLES
   ========================================================================== */
.gcs-word-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--gcs-font-sans);
  font-size: 8.5pt;
  line-height: 1.2;
  margin: 8px 0;
}

.gcs-word-table th,
.gcs-word-table td {
  border: 1px solid #000000;
  padding: 4px 6px;
  vertical-align: middle;
}

.gcs-word-table th {
  background: #f8fafc;
  font-weight: 700;
  text-align: center;
}

.gcs-box-check {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.2px solid #000000;
  margin-right: 5px;
  vertical-align: middle;
  background: #ffffff;
}

.gcs-ruled-row {
  border-bottom: 1px solid #000000;
  height: 22px;
  margin-bottom: 2px;
}

.gcs-stamp-code {
  font-size: 9pt;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.gcs-stamp-label {
  font-size: 6.5pt;
  font-weight: normal;
}

.gcs-stamp-val {
  font-size: 7.5pt;
  font-weight: 500;
}

/* ==========================================================================
   UNIVERSITY HEADER BLOCK
   ========================================================================== */
.gcs-univ-header {
  text-align: center;
  position: relative;
  margin-bottom: 8px;
  padding-bottom: 4px;
}

.gcs-univ-header.has-top-stamp {
  /* reserve right margin for top-right stamp */
  padding-right: 66mm;
}

.gcs-univ-logos {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gcs-univ-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.gcs-univ-title {
  font-family: var(--gcs-font-serif);
  font-size: 11pt;
  font-weight: bold;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 1px;
}

.gcs-univ-campuses {
  font-family: var(--gcs-font-serif);
  font-size: 7pt;
  color: #222222;
  margin-bottom: 2px;
}

.gcs-univ-address {
  font-family: var(--gcs-font-sans);
  font-size: 7pt;
  color: #111111;
  margin-bottom: 2px;
}

.gcs-univ-contact {
  font-family: var(--gcs-font-sans);
  font-size: 6.5pt;
  color: #111111;
  margin-bottom: 4px;
}

.gcs-dept-title {
  font-family: var(--gcs-font-sans);
  font-size: 9.5pt;
  font-weight: bold;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.gcs-form-title {
  font-family: var(--gcs-font-sans);
  font-size: 12pt;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 8px 0 4px;
  text-align: center;
}

.gcs-form-subtitle {
  font-family: var(--gcs-font-sans);
  font-size: 9pt;
  font-style: italic;
  text-align: center;
  margin-bottom: 8px;
}

/* ==========================================================================
   FORM TABLES & GRIDS
   ========================================================================== */
.gcs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 9pt;
}

.gcs-table th,
.gcs-table td {
  border: 1px solid #000000;
  padding: 3px 5px;
  vertical-align: middle;
}

.gcs-table th {
  background-color: #f8fafc;
  font-weight: bold;
  text-align: center;
  font-family: var(--gcs-font-sans);
  font-size: 8pt;
}

.gcs-table-compact td,
.gcs-table-compact th {
  padding: 2px 4px;
  font-size: 8pt;
}

.gcs-table-center td {
  text-align: center;
}

/* Blank ruled rows for printable physical logs */
.gcs-row-ruled {
  height: 22px;
}

/* Fillable Underlined Inputs */
.gcs-line {
  display: inline-block;
  border-bottom: 1px solid #000000;
  min-height: 16px;
  padding: 0 4px;
  vertical-align: bottom;
  font-family: var(--gcs-font-sans);
  font-weight: 500;
}

.gcs-line-fill {
  width: 100%;
}

.gcs-ruled-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 10px 0;
}

.gcs-ruled-line {
  border-bottom: 1px solid #000000;
  width: 100%;
  height: 18px;
  font-family: var(--gcs-font-sans);
  font-size: 9.5pt;
  padding-left: 4px;
}

/* Checkboxes and Radios */
.gcs-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 12px;
  font-size: 9pt;
}

.gcs-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #000000;
  text-align: center;
  line-height: 11px;
  font-size: 9pt;
  font-weight: bold;
  vertical-align: middle;
}

.gcs-box.checked::after {
  content: "✓";
}

/* ==========================================================================
   CONFIDENTIALITY & NOTICE BOXES
   ========================================================================== */
.gcs-notice-box {
  border: 1px solid #333333;
  padding: 6px 10px;
  font-size: 8pt;
  line-height: 1.25;
  margin: 6px 0 10px;
  text-align: justify;
  background: #fafafa;
}

.gcs-notice-title {
  font-weight: bold;
  margin-bottom: 3px;
  text-transform: uppercase;
}

/* Signatures */
.gcs-sign-row {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 16px;
}

.gcs-sign-block {
  text-align: center;
  min-width: 220px;
}

.gcs-sign-line {
  border-top: 1px solid #000000;
  margin-top: 36px;
  padding-top: 3px;
  font-weight: bold;
  font-size: 8.5pt;
}

.gcs-sign-label {
  font-size: 7.5pt;
  font-style: italic;
}

/* Photo box for PDS */
.gcs-photo-box {
  position: absolute;
  top: 10mm;
  right: 78mm;
  width: 2in;
  height: 2in;
  border: 1px solid #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 8pt;
  background: #ffffff;
}

.gcs-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   PRINT MEDIA RULES (PERFECT HARD-COPY OUTPUT)
   ========================================================================== */
@media print {
  body.gcs-form-body {
    background-color: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .gcs-toolbar,
  .no-print,
  .no-print * {
    display: none !important;
  }

  /* Preserve colors, backgrounds, and headers when printing or saving to PDF */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .gcs-paper-viewport {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
  }

  .gcs-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    border: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .gcs-sheet-portrait {
    width: 100% !important;
    min-height: auto !important;
    padding: 6mm 10mm 6mm 10mm !important;
  }

  .gcs-sheet-landscape {
    width: 100% !important;
    max-width: 100% !important;
    height: 196mm !important;
    min-height: 196mm !important;
    max-height: 196mm !important;
    padding: 2mm 8mm 20mm 8mm !important;
    position: relative !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .appointment-footer-exact {
    position: absolute !important;
    bottom: 3mm !important;
    left: 8mm !important;
    right: 8mm !important;
    margin: 0 !important;
  }

  .gcs-page-break {
    page-break-after: always !important;
    break-after: page !important;
  }
}
