
/* Remove default Shiny page margins */
.container-fluid {
  padding: 0 !important;
}

body {
  margin: 0;
  background: white;
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

/* Overall layout */
.site-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* Header and footer containers */
.site-header,
.site-footer {
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  display: block;
  background: none;
}

/* Images fill the entire width */
.site-banner-image {
  display: block;
  width: 100%;
  height: auto;
}


.site-header h1 {
  font-size: 44px;
  margin: 0;
}

/* Middle of page */
.site-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 5%;
}

.site-content > .shiny-html-output {
  width: 100%;
}

/* Arrange the two buttons */
.home-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7%;
  width: 100%;
}

/* Large rectangular buttons */
.home-choice.btn {
  width: 100%;
  min-height: 205px;
  position: relative;
  border: 11px solid #d6d6d6;
  border-radius: 0;
  background: #f7f7f7;
  box-shadow: 0 0 12px #aaaaaa;
  color: #0051ad;
  text-align: center;
  white-space: normal;
  padding: 15px 15px 15px 55px;
}

/* Blue stripe at left */
.home-choice.btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  background: #0051ad;
}

/* Button heading */
.home-choice-title {
  font-size: clamp(24px, 2.7vw, 43px);
  font-weight: bold;
  margin-bottom: 8px;
}

/* Button description */
.home-choice-description {
  font-size: clamp(16px, 1.8vw, 29px);
  font-weight: normal;
  line-height: 1.25;
}

/* Button hover appearance */
.home-choice.btn:hover {
  background: #ebf2fc;
  border-color: #bcbcbc;
}

/* Keyboard focus */
.home-choice.btn:focus-visible {
  outline: 3px solid #0051ad;
  outline-offset: 3px;
}


/* Fix footer image sizing */
.site-footer {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

.site-footer .site-banner-image {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 0;
}


/* Narrow screens: stack buttons vertically */
@media (max-width: 800px) {
  .home-choices {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .home-choice.btn {
    min-height: 170px;
  }

  .site-header {
    height: 100px;
  }

  .site-footer {
    font-size: 18px;
  }
}


/* ===================================
   LOGIN PAGE
   =================================== */

.login-page {
  width: 100%;
  min-height: 65vh;
  display: flex;
  flex-direction: column;
}

/* Description at top */
.login-intro {
  text-align: center;
  color: #0051ad;
  font-size: 32px;
  font-weight: bold;
  margin: 0;
}

/* Area containing the login box */
.login-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px 0;
}

/* Gray login rectangle */
.login-card {
  background-color: #f7f7f7;
  border: 11px solid #dedede;
  box-shadow: 0 0 12px #aaaaaa;

  width: 630px;
  max-width: 100%;
  padding: 25px 50px;
}

/* Space between the two fields */
.login-field {
  margin-bottom: 40px;
  text-align: center;
}

.login-field:last-child {
  margin-bottom: 0;
}

/* Override Shiny's default input width */
.login-field .shiny-input-container {
  width: 100% !important;
}

/* Labels above inputs */
.login-field label {
  display: block;
  text-align: center;
  color: black;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
}

/* Input fields with underline */
.login-field .form-control {
  display: block;
  width: 245px;
  max-width: 100%;
  margin: 0 auto;

  background: transparent;
  border: none;
  border-bottom: 2px solid black;
  border-radius: 0;
  box-shadow: none;

  color: black;
  font-size: 24px;
  text-align: center;
}

/* Focus effect for typing */
.login-field .form-control:focus {
  border-bottom: 3px solid #0051ad;
  outline: none;
  box-shadow: none;
}

/* Bottom button arrangement */
.login-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding-bottom: 12px;
}

/* Blue Back and Continue buttons */
.login-action-btn.btn {
  background-color: #0051ad;
  color: white;
  border: none;
  border-radius: 0;

  width: 320px;
  max-width: 45%;
  min-height: 80px;

  font-size: 32px;
  font-weight: bold;
}

/* Hover appearance */
.login-action-btn.btn:hover {
  background-color: #003d85;
  color: white;
}

.login-action-btn.btn:focus-visible {
  outline: 3px solid #003d85;
  outline-offset: 3px;
}

/* Responsive layout for smaller screens */
@media (max-width: 700px) {
  .login-page {
    min-height: 520px;
  }

  .login-intro {
    font-size: 24px;
  }

  .login-card {
    padding: 25px 20px;
  }

  .login-field label {
    font-size: 22px;
  }

  .login-action-btn.btn {
    font-size: 22px;
    min-height: 60px;
  }
}


/* ===================================
   SMALLER PAGE LAYOUT
   =================================== */

/* Less empty padding around page content */
.site-content {
  padding: 12px 3%;
}

/* Allow pages to fill available space */
.site-content > .shiny-html-output {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Smaller home screen buttons */
.home-choice.btn {
  min-height: 150px;
  padding: 10px 12px 10px 45px;
  border-width: 7px;
}

.home-choice.btn::before {
  width: 30px;
}

.home-choice-title {
  font-size: clamp(20px, 2vw, 32px);
}

.home-choice-description {
  font-size: clamp(15px, 1.4vw, 22px);
}

/* Smaller login page */
.login-page {
  min-height: 0;
  flex: 1;
}

.login-intro {
  font-size: 25px;
}

/* Less vertical spacing */
.login-center {
  padding: 12px 0;
}

/* Smaller login rectangle */
.login-card {
  width: 480px;
  max-width: 100%;
  padding: 16px 30px;
  border-width: 7px;
}

/* Smaller login inputs */
.login-field {
  margin-bottom: 18px;
}

.login-field label {
  font-size: 20px;
  margin-bottom: 8px;
}

.login-field .form-control {
  width: 210px;
  height: 34px;
  font-size: 18px;
}

/* Smaller Back and Continue buttons */
.login-action-btn.btn {
  width: 230px;
  min-height: 55px;
  font-size: 23px;
}

/* Extra adjustments for short screens */
@media (max-height: 650px) {
  .login-center {
    padding: 5px 0;
  }

  .login-card {
    padding: 10px 20px;
  }

  .login-field {
    margin-bottom: 10px;
  }

  .login-action-btn.btn {
    min-height: 45px;
  }
}

/* =====================================
   SURVEY PAGES
   ===================================== */

.survey-page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

/* Main page heading */
.survey-heading {
  color: #0051ad;
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  margin: 15px 0 30px;
}

/* Introductory text */
.survey-instructions {
  font-size: 16px;
  margin-bottom: 35px;
}

.survey-instructions p {
  margin-bottom: 15px;
}

/* Allows the table to scroll on small screens */
.survey-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

/* Survey table */
.survey-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Table grid lines */
.survey-table th,
.survey-table td {
  border: 3px solid #9aaaff;
}

/* Column widths */
.survey-table th:first-child {
  width: 50%;
}

.survey-table th:not(:first-child) {
  width: 10%;
}

/* Header row */
.survey-table thead th {
  background-color: #0051ad;
  color: white;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.2;
  padding: 12px 5px;
}

/* Question text */
.survey-question {
  background: #f4f4f4;
  text-align: center;
  padding: 12px;
  font-size: 16px;
}

.survey-question strong {
  display: block;
  font-weight: bold;
}

/* Radio button section */
.survey-radio-cell {
  padding: 0 !important;
  background: #f4f4f4;
}

/* Remove Shiny's default spacing */
.survey-radio-cell .shiny-input-container {
  width: 100% !important;
  margin: 0;
}

/* Hide repeated labels without hiding from screen readers */
.survey-radio-cell .control-label,
.survey-radio-cell .radio-inline span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Arrange five circles evenly */
.survey-radio-cell .shiny-options-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
}

/* Each response occupies one column */
.survey-radio-cell .radio-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 75px;
  padding: 0 !important;
  margin: 0 !important;
  border-left: 3px solid #9aaaff;
  cursor: pointer;
}

.survey-radio-cell .radio-inline:first-child {
  border-left: none;
}

/* The unselected circle */
.survey-radio-cell input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;

  position: static;
  width: 32px;
  height: 32px;
  margin: 0 !important;

  border: 1.5px solid #222;
  border-radius: 50%;
  background: transparent;

  cursor: pointer;
}

/* The selected circle turns blue */
.survey-radio-cell input[type="radio"]:checked {
  background-color: #0051ad;
  border-color: #0051ad;
}

/* Keyboard accessibility */
.survey-radio-cell input[type="radio"]:focus-visible {
  outline: 3px solid #6e91eb;
  outline-offset: 3px;
}

/* Back and Continue */
.survey-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0 30px;
}

.survey-actions .login-action-btn.btn {
  width: 240px;
  max-width: 45%;
  min-height: 55px;
  font-size: 24px;
}

/* Small screens */
@media (max-width: 700px) {
  .survey-heading {
    font-size: 22px;
  }

  .survey-instructions {
    font-size: 14px;
  }

  .survey-actions .login-action-btn.btn {
    min-height: 45px;
    font-size: 19px;
  }
}


/* =====================================
   SURVEY PART 2 - YES/NO QUESTIONS
   ===================================== */

.yesno-page {
  width: 100%;
}

/* Instructions */
.yesno-instructions {
  font-size: 17px;
  margin-bottom: 20px;
}

/* Container for all eight questions */
.yesno-table {
  width: 100%;
  background: #f4f4f4;
  border: 3px solid #9aaaff;
}

/* Individual question rows */
.yesno-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: stretch;

  min-height: 65px;
  border-bottom: 2px solid #9aaaff;
}

.yesno-row:last-child {
  border-bottom: none;
}

/* Question text */
.yesno-question {
  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 10px 20px;
  text-align: center;
  font-size: 16px;
}

.yesno-question strong {
  font-weight: bold;
}

/* Yes/No area */
.yesno-controls {
  border-left: 2px solid #9aaaff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

/* Remove Shiny input spacing */
.yesno-controls .shiny-input-container {
  width: 100% !important;
  margin: 0;
}

/* Put the options beside each other */
.yesno-controls .shiny-options-group {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

/* Yes and No labels */
.yesno-controls .radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin: 0 !important;
  padding: 0 !important;

  font-size: 18px;
  cursor: pointer;
}

/* Unselected radio buttons */
.yesno-controls input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;

  position: static;
  width: 25px;
  height: 25px;
  flex-shrink: 0;

  margin: 0 !important;
  border: 1.5px solid #222;
  border-radius: 50%;
  background: transparent;

  cursor: pointer;
}

/* Selected button turns blue */
.yesno-controls input[type="radio"]:checked {
  background: #0051ad;
  border-color: #0051ad;
}

.yesno-controls input[type="radio"]:focus-visible {
  outline: 3px solid #6e91eb;
  outline-offset: 3px;
}

/* Opinion Count at bottom */
.opinion-count {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;

  margin-top: 20px;
  font-size: 24px;
  color: #0051ad;
  font-weight: bold;
}

.opinion-count .shiny-text-output {
  display: inline-block;
  min-width: 40px;
  text-align: center;
  color: black;
}

/* Smaller screens */
@media (max-width: 650px) {
  .yesno-row {
    grid-template-columns: minmax(0, 1fr) 160px;
  }

  .yesno-question {
    font-size: 14px;
    padding: 8px;
  }

  .yesno-controls .radio-inline {
    font-size: 14px;
    gap: 4px;
  }

  .yesno-controls input[type="radio"] {
    width: 19px;
    height: 19px;
  }

  .opinion-count {
    font-size: 19px;
  }
}


/* =====================================
   SURVEY PART 3
   ===================================== */

.section3-page {
  width: 100%;
}

/* Instructions */
.s3-instructions {
  font-size: 16px;
  margin: 15px 0 30px;
}

/* All three panels */
.s3-panels {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Each question panel */
.s3-panel {
  display: grid;
  grid-template-columns:
    minmax(0, 2fr) minmax(260px, 1fr);

  background: #f4f4f4;
  border: 3px solid #9aaaff;
}

/* Left question area */
.s3-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 15px 20px;
  font-size: 16px;
}

.s3-question strong {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}

.s3-question p {
  margin: 0;
}

/* Right answer column */
.s3-choices {
  display: flex;
  border-left: 3px solid #9aaaff;
  min-width: 0;
}

/* Shiny radio input container */
.s3-choices .shiny-input-container {
  display: flex;
  flex-direction: column;
  width: 100% !important;
  margin: 0;
}

/* Visually hide group title,
   but preserve it for accessibility */
.s3-choices .control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Stack the response options */
.s3-choices .shiny-options-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Individual answer rows */
.s3-choices .radio {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 60px;

  margin: 0 !important;
}

/* Lines between answer choices */
.s3-choices .radio + .radio {
  border-top: 3px solid #9aaaff;
}

/* Answer label and circle */
.s3-choices .radio label {
  display: flex;
  align-items: center;
  gap: 12px;

  width: 100%;
  min-height: 60px;
  padding: 10px 14px;

  font-size: 16px;
  font-weight: normal;
  white-space: normal;
  cursor: pointer;
}

/* Unselected circle */
.s3-choices input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;

  position: static;
  width: 30px;
  height: 30px;
  flex-shrink: 0;

  margin: 0 !important;
  border: 1.5px solid #222;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

/* Selected circle */
.s3-choices input[type="radio"]:checked {
  background: #0051ad;
  border-color: #0051ad;
}

.s3-choices input[type="radio"]:focus-visible {
  outline: 3px solid #6e91eb;
  outline-offset: 3px;
}


/* =====================================
   OPTIONAL WRITTEN RESPONSE
   ===================================== */

.s3-written {
  display: grid;
  grid-template-columns:
    minmax(0, 2fr) minmax(260px, 1fr);

  background: #f4f4f4;
  border: 3px solid #9aaaff;

  margin-top: 25px;
}

/* Left description */
.s3-written-prompt {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 15px;
  text-align: center;
  font-size: 16px;
}

.s3-written-prompt p {
  margin: 0;
}

/* Right text entry area */
.s3-written-entry {
  border-left: 3px solid #9aaaff;

  display: flex;
  align-items: center;
  padding: 15px;
}

.s3-written-entry .shiny-input-container {
  width: 100% !important;
  margin: 0;
}

/* Growing text box */
.s3-written-entry textarea.form-control {
  width: 100%;
  min-height: 60px;
  max-height: 350px;

  field-sizing: content;
  resize: vertical;

  background: transparent;
  border: none;
  border-bottom: 2px solid #333;
  border-radius: 0;
  box-shadow: none;

  font-size: 16px;
  line-height: 1.5;
  padding: 8px;
}

/* When selected for typing */
.s3-written-entry textarea:focus {
  outline: none;
  border-bottom: 3px solid #0051ad;
  box-shadow: none;
}

/* Small screen layout */
@media (max-width: 700px) {

  .s3-panel,
  .s3-written {
    grid-template-columns: 1fr;
  }

  .s3-choices,
  .s3-written-entry {
    border-left: none;
    border-top: 3px solid #9aaaff;
  }

  .s3-question {
    padding: 15px;
  }

  .s3-choices .radio {
    min-height: 48px;
  }
}

/*            NewNew ||||||||||||||||||


/* =====================================
   FIX UNEVEN ANSWER ROWS IN SURVEY 3
   ===================================== */

/* Make every answer row the same height */
.s3-choices .shiny-options-group {
  display: grid;
  grid-auto-rows: minmax(65px, 1fr);
  width: 100%;
  flex: 1;
}

/* Remove Shiny's default row spacing */
.s3-choices .radio {
  display: flex;
  flex: none;
  min-height: 0;
  margin: 0 !important;
  padding: 0;
}

/* Center the circle and text in each row */
.s3-choices .radio label {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  box-sizing: border-box;
}