/* =========================
   Global Base
========================= */

html, body {
  margin: 0;
  padding-top: clamp(40px, 14vh, 40px);
  height: 100%;
  background: #FFFFFF;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue",
               Arial, sans-serif;
  color: #222;
  background-color: #d6f3f3;
  font-size: clamp(14px, 1.6vw, 18px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

/* =========================
   Fixed Top Bar
========================= */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background-color: #003a80;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0.75rem 4vw;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 1000;
  padding-left: clamp(20px, 3.5vw, 0.75in);
  padding-right: clamp(20px, 3.5vw, 0.75in);
}

.logo {
  height: 80%;
  max-height: 100%;
  width: auto;
  margin-right: auto;
}

.tagline {
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* =========================
   Container / Page Layout
========================= */

.container {
  background-color: #d6f3f3;

  width: min(calc(100% - 2rem), 2240px);
  margin: clamp(84px, 10vh, 140px) auto 2rem auto;

  padding: clamp(1rem, 2.5vw, 2.5rem) clamp(1rem, 2.5vw, 2.5rem) 8rem;

  box-sizing: border-box;
  border-radius: 12px;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(1rem, 2vw, 2rem);

  text-align: left;
}

/* =========================
   Headings
========================= */
h1 {
  color: #c62715;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 0.25rem;
  font-weight: 800;
  white-space: nowrap;
  text-align: center;
}

h2 {
  color: #003a80;
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  margin-top: 0;
  margin-bottom: .25rem;
  text-align: center;
  white-space: nowrap;
}

/* =========================
   Hero (new)
========================= */

.hero {
    background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  padding: clamp(1rem, 2vw, 1.5rem);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: center;
}

.hero-media {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-copy h1 {
  text-align: left;
  white-space: normal;
  margin-top: 0;
}

.hero-subhead {
  margin: 0.5rem 0 1rem 0;
  line-height: 1.5;
  max-width: 60ch;
}

.hero-cta {
  margin-top: 0.25rem;
}

.cta-link {
  display: inline-block;
  background-color: #24CC56;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  font-weight: 800;
  transition: background 0.2s ease, transform 0.1s ease;
}

.cta-link:hover {
  background-color: #20b34d;
  transform: translateY(-1px);
}

/* =========================
   Hero Image
========================= */
.hero-image {
  display: block;
  width: 100%;
  max-width: 180px;   /* smaller Socrates image */
  height: auto;
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.hipaa-image {
  display: block;
  width: clamp(160px, 25vw, 300px);
  height: auto;
  margin: 0 auto 1.25rem auto;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* =========================
   Upload Section
========================= */
.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.file-label {
  background-color: #24CC56;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  transition: background 0.2s ease, transform 0.1s ease;
}
.file-label:hover {
  background-color: #20b34d;
  transform: translateY(-1px);
}

input[type="file"] {
  display: none !important;
}

/* =========================
   Buttons
========================= */
.button-row {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

button {
  background-color: #24CC56;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
button:hover {
  background-color: #20b34d;
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.help-btn {
  background-color: #E53935;
}

.logout-btn {
  margin-left: 0.75rem;
}

/* =========================
   Spinner
========================= */
.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #24CC56;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =========================
   Flowchart + Outputs
========================= */
#questions-output,
#answers-output,
#flowchart-output {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: left;
  box-shadow: none;
  background-color: #d6f3f3;
}

#flowchart-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  width: 100%;
  margin-top: 1rem;
}

.flowchart-group {
  width: 100%;
  padding: 1rem 0;
  border-top: 3px solid #eee;
}

.flowchart-group h2 {
  margin-bottom: 1rem;
  text-align: center;
  font-size: 1.3rem;
  color: #333;
}

.flow-table {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: relative;
  width: 100%;
}

.flow-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
  position: relative;
  background: #fff;
  border: 3px solid #333;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  padding: 1rem 1.5rem;
}
.flow-row::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 0;
  height: 2.5rem;
  border-left: 3px solid #333;
}
.flow-row::before {
  content: "";
  position: absolute;
  left: calc(50% - 5px);
  bottom: -2.5rem;
  border: 6px solid transparent;
  border-top: 8px solid #333;
}
.flow-row:last-child::after,
.flow-row:last-child::before {
  display: none;
}

.cell {
  flex: 1;
  word-wrap: break-word;
  color: #222;
}
.cell.id, .cell.next {
  flex: 0 0 3rem;
  text-align: center;
  font-weight: bold;
  color: #333;
}
.cell.label {
  flex: 0 0 10rem;
  font-weight: 600;
  color: #444;
}
.cell.content {
  flex: 1;
  line-height: 1.4;
}

.flow-row:nth-child(1)  { background:#e0f7fa; border-color:#00acc1; }
.flow-row:nth-child(2)  { background:#e8f5e9; border-color:#43a047; }
.flow-row:nth-child(3)  { background:#fff3e0; border-color:#fb8c00; }
.flow-row:nth-child(4)  { background:#f3e5f5; border-color:#8e24aa; }
.flow-row:nth-child(5)  { background:#e8eaf6; border-color:#3949ab; }
.flow-row:nth-child(6)  { background:#fce4ec; border-color:#d81b60; }
.flow-row:nth-child(7)  { background:#f1f8e9; border-color:#7cb342; }

.flow-row:hover {
  filter: brightness(0.97);
  transform: translateY(-2px);
  transition: all 0.15s ease;
}

/* =========================
   Responsive
========================= */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-media {
    justify-content: flex-start;
  }
  .hero-image { width: 100%; max-width: 180px; }
}

@media (max-width: 600px) {
  .container { padding: 1.5rem 5vw; }
  .button-row { flex-direction: column; align-items: stretch; }
  button { width: 100%; }
  h1 { white-space: normal; }
   .hero-image { max-width: 180px; width: 100%; }
  .hero-copy h1 { text-align: left; }
}

/* =========================
   Footer (self-contained full-width mirror)
========================= */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #003a80;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.1rem 4vw;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
  z-index: 900;
}

.footer-logo {
  height: 70px;
  width: auto;
}

.footer-tagline {
  font-size: clamp(12px, 2vw, 16px);
  font-weight: 800;
  letter-spacing: 0.4px;
}

.footer a,
.footer a:visited,
.footer a:hover,
.footer a:active {
  color: #fff;
  text-decoration: none;
}

/* =========================
   Authentication Specifics
========================= */

#message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  background-color: #f0f0f0;
}

#message.visible {
  display: block !important;
}

input[type="email"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

#flowchart-container { margin-top: 1rem !important; }
#questions-container,
#flowchart-container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
#answers-container {
  display: none !important;
}
#answers-output {
  display: none !important;
}
.container {
  margin-top: 3px !important;
  gap: 1rem !important;
}
