/* ============================================================================
   SSI REQUEST — STYLESHEET
   ============================================================================
   GCWeb-compatible. 100% width fields. Responsive. Touch-friendly (44px).
   Progress bar. Step visibility. Print styles. High contrast support.
   ============================================================================ */


/* ==========================================================================
   STEP VISIBILITY
   ========================================================================== */

.step-hidden {
  display: none !important;
}


/* ==========================================================================
   FORM CONTROLS — 100% width, touch-friendly
   ========================================================================== */

/* Force all inputs, selects, textareas to full width */
#ssi-request .form-control {
  width: 100%;
  max-width: 100%;
  font-size: 16px;          /* Prevents iOS zoom on focus */
  line-height: 1.5;
  padding: 8px 12px;
  min-height: 44px;          /* WCAG 2.5.5 touch target */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#ssi-request .form-control:focus {
  border-color: #26374a;
  outline: 3px solid #26374a;
  outline-offset: 1px;
  box-shadow: none;          /* Override Bootstrap glow */
}

/* Select dropdowns */
#ssi-request select.form-control {
  min-height: 44px;
  padding-right: 30px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

/* Textarea */
#ssi-request textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* File inputs */
#ssi-request input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 0;
}

/* Override any inline max-width on postal/zip fields */
#ssi-request #ethi_invoicepostalcode,
#ssi-request #ethi_invoicepostalcodezipcode {
  max-width: 100%;
}


/* ==========================================================================
   RESPONSIVE GRID — Full width stacking
   ========================================================================== */

/* On mobile: all columns stack full width */
#ssi-request .row > [class*="col-"] {
  width: 100%;
  float: none;
}

/* On tablet+ (768px): allow side-by-side layout */
@media (min-width: 768px) {
  #ssi-request .row > .col-md-6 {
    width: 50%;
    float: left;
  }
  #ssi-request .row > .col-md-4 {
    width: 33.333%;
    float: left;
  }
  #ssi-request .row > .col-md-3 {
    width: 25%;
    float: left;
  }
}

/* Ensure form groups inside columns have proper spacing */
#ssi-request .row > [class*="col-"] > .form-group {
  padding-right: 0;
  padding-left: 0;
}

/* Row clearfix */
#ssi-request .row::after {
  content: "";
  display: table;
  clear: both;
}


/* ==========================================================================
   LABELS & REQUIRED MARKERS
   ========================================================================== */

#ssi-request label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #333;
}

/* Only the "(required)" text and the * asterisk are red, label text is black */
#ssi-request label.required {
  color: #d3080c;             /* Asterisk (*) via ::before inherits this */
}

#ssi-request .field-name {
  color: #333;                /* Label text forced black */
}

#ssi-request label .required,
#ssi-request strong.required {
  color: #d3080c;             /* "(required)" text red */
}

#ssi-request .help-block {
  font-size: 0.875em;
  color: #555;
  margin-top: 4px;
}


/* ==========================================================================
   FORM GROUP SPACING
   ========================================================================== */

#ssi-request .form-group {
  margin-bottom: 20px;
}


/* ==========================================================================
   RADIO BUTTONS — inline, touch-friendly
   ========================================================================== */

/* Reset any browser/Bootstrap padding on the radio group fieldset */
#ssi-request fieldset.form-group {
  padding: 0;
  padding-inline-start: 0;
  margin-inline-start: 0;
}

#ssi-request .radio-inline {
  display: inline-block;
  margin-right: 30px;
  padding: 8px 4px 8px 0;
  min-height: 44px;
  font-weight: normal;
  cursor: pointer;
  vertical-align: middle;
}

#ssi-request .radio-inline:first-of-type {
  padding-left: 0;          /* First radio aligns flush with fields above */
}

#ssi-request .radio-inline input[type="radio"] {
  margin: 0 8px 0 0;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}


/* ==========================================================================
   FIELDSET / LEGEND
   ========================================================================== */

#ssi-request fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

#ssi-request .step-panel > legend {
  font-size: 1.4em;
  font-weight: 700;
  color: #333;
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #af3c43;  /* GC accent */
}

#ssi-request .step-panel > legend:focus {
  outline: none;             /* No visible focus frame — focus is programmatic for SR announcement only */
}

/* Nested fieldset legends (e.g. radio group label) */
#ssi-request .step-panel fieldset > legend.field-label {
  font-size: 1em;
  font-weight: 600;
  color: #333;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 8px;
}


/* ==========================================================================
   PROGRESS INDICATOR
   ========================================================================== */

.ssi-progress-bar {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  counter-reset: step;
}

.ssi-step {
  flex: 1;
  text-align: center;
  position: relative;
  padding-top: 44px;
}

/* Connector line between steps */
.ssi-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -50%;
  right: 50%;
  height: 3px;
  background-color: #ccc;
  z-index: 0;
}

.ssi-step:first-child::before {
  display: none;
}

.ssi-step.completed::before,
.ssi-step.active::before {
  background-color: #278400;   /* GC green */
}

/* Step number circle */
.ssi-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #ccc;
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  border: 2px solid #ccc;
}

.ssi-step.active .ssi-step-num {
  background-color: #26374a;   /* GC dark blue */
  border-color: #26374a;
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #26374a;
}

.ssi-step.completed .ssi-step-num {
  background-color: #278400;
  border-color: #278400;
  color: #fff;
  font-size: 0;              /* Hide number text — checkmark shown via ::after */
}

/* Checkmark for completed steps */
.ssi-step.completed .ssi-step-num::after {
  content: '\2713';
  font-size: 16px;           /* Explicit size since parent font-size is 0 */
}

/* Step label text */
.ssi-step-label {
  display: block;
  font-size: 0.8em;
  color: #666;
  margin-top: 4px;
  line-height: 1.3;
}

.ssi-step.active .ssi-step-label {
  color: #26374a;
  font-weight: 700;
}

.ssi-step.completed .ssi-step-label {
  color: #278400;
}


/* ==========================================================================
   NAVIGATION BUTTONS
   ========================================================================== */

.step-nav {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.step-nav .btn {
  min-height: 44px;
  min-width: 120px;
  font-size: 1em;
}

.step-nav .btn-primary {
  background-color: #26374a;
  border-color: #26374a;
}

.step-nav .btn-primary:hover,
.step-nav .btn-primary:focus {
  background-color: #1c2b3a;
  border-color: #1c2b3a;
}

.step-nav .btn-success {
  background-color: #278400;
  border-color: #278400;
}

.step-nav .btn-success:hover,
.step-nav .btn-success:focus {
  background-color: #1e6a00;
  border-color: #1e6a00;
}

#btn-submit {
  min-width: 140px;
  font-weight: 600;
}


/* ==========================================================================
   IS SECTION (conditional — visible when CCG = Yes)
   ========================================================================== */

#is-section {
  background: #f5f7fa;
  border: 1px solid #dde3ea;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 20px;
}


/* ==========================================================================
   reCAPTCHA BADGE
   ========================================================================== */

.grecaptcha-badge {
  z-index: 1;
}


/* ==========================================================================
   REVIEW SUMMARY (Step 5)
   ========================================================================== */

.review-heading {
  font-size: 1.1em;
  font-weight: 700;
  color: #26374a;
  margin-top: 20px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ddd;
}

#review-content .table {
  width: 100%;
}

#review-content .table th {
  width: 40%;
  font-weight: 600;
  vertical-align: top;
}

#review-content .table td {
  vertical-align: top;
}


/* ==========================================================================
   VALIDATION ERROR STYLING (supplements wb-frmvld)
   ========================================================================== */

#ssi-request .has-error .form-control {
  border-color: #d3080c;
}

#ssi-request .has-error .form-control:focus {
  border-color: #d3080c;
  outline-color: #d3080c;
}

#ssi-request .file-error {
  display: block;
  margin-top: 4px;
}

#ssi-request .file-error .label-danger {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.875em;
}


/* ==========================================================================
   FILE WARNING (language toggle restore)
   ========================================================================== */

.file-warning {
  font-size: 0.85em;
}


/* ==========================================================================
   FILE UPLOAD UI — filename display + delete button
   ========================================================================== */

.ssi-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.ssi-file-icon {
  color: #26374a;
  font-size: 1.1em;
  flex-shrink: 0;
}

.ssi-file-name {
  font-weight: 600;
  color: #333;
  word-break: break-all;
  flex: 1;
}

.ssi-file-size {
  color: #666;
  font-size: 0.875em;
  white-space: nowrap;
  flex-shrink: 0;
}

.ssi-file-delete {
  flex-shrink: 0;
  margin-left: auto;
}

.ssi-file-delete .glyphicon {
  margin-right: 3px;
}

/* Mobile: stack vertically */
@media (max-width: 767px) {
  .ssi-file-info {
    flex-wrap: wrap;
  }

  .ssi-file-delete {
    width: 100%;
    margin-top: 6px;
    margin-left: 0;
  }
}


/* ==========================================================================
   RESPONSIVE — MOBILE (< 768px)
   ========================================================================== */

@media (max-width: 767px) {
  /* Progress bar: smaller circles, shorter labels */
  .ssi-step-num {
    width: 28px;
    height: 28px;
    font-size: 0.8em;
  }

  .ssi-step {
    padding-top: 36px;
  }

  .ssi-step::before {
    top: 14px;
  }

  .ssi-step-label {
    font-size: 0.65em;
  }

  /* Radio buttons: stack vertically on mobile */
  .radio-inline {
    display: block;
    margin-bottom: 8px;
  }

  /* Stack navigation buttons */
  .step-nav .btn {
    width: 100%;
    margin-bottom: 10px;
    float: none !important;
  }

  /* Review table: stack label/value */
  #review-content .table th,
  #review-content .table td {
    display: block;
    width: 100%;
  }

  #review-content .table th {
    border-bottom: none;
    padding-bottom: 0;
  }
}


/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  .step-nav,
  .ssi-progress-bar,
  #recaptcha-container,
  .grecaptcha-badge {
    display: none !important;
  }

  .step-panel {
    display: block !important;
    page-break-inside: avoid;
  }

  .step-hidden {
    display: block !important;
  }

  .step-panel > legend {
    border-bottom: 1px solid #000;
  }

  #ssi-request .form-control {
    border: 1px solid #999;
    min-height: auto;
  }

  #is-section {
    background: none;
    border: 1px solid #ccc;
  }
}


/* ==========================================================================
   HIGH CONTRAST / FORCED COLORS
   ========================================================================== */

@media (forced-colors: active) {
  .ssi-step-num {
    border: 2px solid ButtonText;
  }

  .ssi-step.active .ssi-step-num {
    border: 3px solid Highlight;
    box-shadow: none;
  }

  .ssi-step.completed .ssi-step-num {
    border: 2px solid ButtonText;
  }

  #ssi-request .form-control:focus {
    outline: 3px solid Highlight;
  }

  .ssi-step::before {
    background-color: ButtonText;
  }
}