/* Base layout and resets */
html, body {
  height: auto;
  min-height: 100%;
  padding: 0;
  overflow-x: hidden; /* ✅ Prevent horizontal scrolling */
  overflow-y: auto;   /* ✅ Ensure viewport controls vertical scroll */
  background-color: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.info-icon {
  width: 24px;
  height: 24px;
}

hr {
  width: 100%;
  height: 1px;
  border: none;
  margin: 0;
  background: #bfc3c8;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  background-color: #fff;
  padding: 20px clamp(16px, 5vw, 24px);
  box-sizing: border-box;
}

.container--hero {
  padding: 20px clamp(16px, 5vw, 24px);
}

/* Responsive layout toggles */
.layout-0-under-450 {
  display: none;
}

@media (max-width: 450px) {
  .layout-0 {
    display: none !important;
  }
  .layout-0-under-450 {
    display: table !important;
  }
}

/* Spacing utilities */
.pt10 { padding-top: 10px; }
.py10 { padding: 10px 0; }
.py20 { padding: 20px 0; }
.px20 { padding: 0 20px; }
.p7 { padding: 7px; }
.p0 { padding: 0; }
.py31p13 { padding-top: 31px; padding-bottom: 31px; }
.spacer-24 { height: 24px; font-size: 0; line-height: 0; }

/* Text defaults */
.text-table {
  color: #000;
  font-style: normal;
  font-weight: normal;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  direction: ltr;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  border-collapse: collapse;
}

/* Button */
.btn {
  display: inline-block;
  width: auto;
  min-width: 120px;
  height: 50px;
  text-decoration: none;
  box-sizing: border-box;
  padding: 0;
  background: transparent;
  margin: 0 auto;
}

.btn__label {
  display: inline-block;
  background-color: #ce2d4f;
  color: #fff;
  font-size: clamp(1rem, 3vw, 1.1875rem);
  font-weight: bold;
  line-height: clamp(2.5rem, 5vw, 3.125rem);
  padding: 0 clamp(1rem, 5vw, 1.375rem);
  border-radius: 100px;
  text-align: center;
  box-sizing: border-box;
}

/* CTA Area */
.cta-area {
  margin-top: 20px;
  text-align: center;
}

/* Text helpers */
.bold { font-weight: 700; }
.ls-004neg { letter-spacing: -0.04em; }
.ls-003neg { letter-spacing: -0.03em; }
.text-center { text-align: center; }
.bg-black { background-color: transparent !important; color: inherit !important; }

/* Width helpers */
.maxw-420 { max-width: 420px; }
.maxw-480 { max-width: 480px; }
.maxw-522 { max-width: 522px; }
.maxw-560 { max-width: 560px; }
.maxw-600 { max-width: 600px; }

table[class^="maxw-"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

table.maxw-164 {
  text-align: center;
}

td {
  text-align: center;
}

.chat-input-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box; /* ✅ Added for proper sizing */
}

#chatInput {
  width: 100%;
  min-height: clamp(200px, 20vh, 260px);
  padding: clamp(14px, 2vw, 18px) clamp(16px, 2.5vw, 20px);
  border: 1px solid #f5f5f5;
  border-radius: 8px 8px 20px 20px;
  font-family: 'Open Sans', sans-serif;
  font-size: clamp(0.9375rem, 2.25vw, 1.25rem);
  line-height: 1.4;
  resize: none;
  overflow-y: hidden;
  background-color: #1a1a1a;
  color: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
  outline: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#chatInput::placeholder {
  font-size: clamp(0.9375rem, 2.25vw, 1.25rem);
  color: #888888;
}

#chatInput::-webkit-scrollbar {
  display: none;
}

/* Responsive divider */
.divider {
  width: min(100%, 720px); /* Never exceeds 720px, but fills smaller containers */
  height: 1px;
  background-color: #bfc3c8;
  margin-block: clamp(40px, 5vw, 40px) auto;
  margin-inline: auto;
}

/* Word count - already in previous CSS */
#wordCount {
  position: absolute;
  bottom: -25px;
  right: calc(clamp(16px, 5vw, 24px) + 15px);
  font-size: clamp(10px, 2vw, 12px); /* ✅ Add responsive font size */
  color: #000000;
  font-family: 'Open Sans', sans-serif;
}

.submit-button {
  width: 50px;
  height: 50px;
  background-color: #ce2d4f;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.submit-button:hover {
  background-color: #b02543;
}

#submitButton {
  position: absolute;
  bottom: 40px;
  right: 40px;
}

/* Footer */
.container-footer {
    background-color: #000;
    width: 100%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* ✅ vertical centering */
    align-items: center;
    padding: 0 clamp(16px, 5vw, 24px);
}

.footer-inner {
  width: 100%;
  max-width: 800px;
  padding-inline: clamp(16px, 5vw, 24px);
}

.footer-headline {
    color: #f6f5f1;
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: pre-wrap;
    line-height: 1.2;
    text-align: left;
    width: 90%;
}

.footer-muted {
    color: #bfc3c8;
    font-size: clamp(0.8125rem, 2vw, 0.8125rem);
    letter-spacing: -0.01em;
    white-space: inherit;
    line-height: 1.15;
    text-align: left;
    width: 90%;
    overflow-wrap: normal;         /* default: wrap only at spaces */
    word-break: keep-all;          /* prevents breaking inside words */
}

.footer-legal {
  color: #fff;
  font-size: clamp(0.8125rem, 2vw, 0.8125rem);
  letter-spacing: -0.01em;
  white-space: inherit;
  text-align: left;
  width: 90%;
  overflow-wrap: normal;
  word-break: keep-all;
}

/* Hero container */
.hero-container {
    width: 100%;
    max-width: 800px;
    min-height: 480px;
    background-color: #000;
    border-radius: 20px 20px 8px 8px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-sizing: border-box;
    display: flex; /* ✅ Add this */
    flex-direction: column; /* ✅ Add this */
}

/* Hero overlay */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 50vh;
    padding-top: 20px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.hero-image-overlay {
    width: clamp(40px, 20vw, 80px);
    height: auto;
    margin-bottom: clamp(20px, 10vw, 50px); /* Responsive gap between image and text */
}

.hero-overlay-text {
  color: #fff;
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
  max-width: 640px;
  word-spacing: 0.05em;
  padding: 0 clamp(16px, 5vw, 24px);
  z-index: 3;
}

.hero-horizontal {
    position: relative;
    display: flex;
    gap: clamp(20px, 5vw, 40px);
    padding: clamp(40px, 5vw, 80px) clamp(20px, 5vw, 60px) clamp(20px, 5vw, 40px);
}

.question-image {
    width: clamp(20px, 20vw, 40px);
    height: auto;
    flex: 0 0 15%;
    margin-bottom: clamp(20px, 10vw, 50px); /* Responsive gap between image and text */
}

.hero-question {
  flex: 0 0 65%;
  text-align: justify;
  color: #ffffff;
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  font-weight: 600;
  word-spacing: 0.05em;
  padding: clamp(10px, 5vw, 25px);
  background-color: #1a1a1a;
  border-radius: 24px 4px 24px 24px;
}

/* Hero text */
.hero-text {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 clamp(16px, 5vw, 24px);
    box-sizing: border-box;
    color: #000;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    line-height: 1.6;
}

.hero-answer {
    flex: 0 0 90%;
    white-space: pre-line;
    font-size: clamp(0.9375rem, 2.25vw, 1.25rem);
    text-align: justify;
    font-weight: 500;
    padding-left: clamp(20px, 5vw, 50px);
    padding-right: clamp(20px, 5vw, 50px);
    padding-bottom: clamp(20px, 5vw, 50px);
    color: #ffffff;
    line-height: clamp(1.4, 2vw, 1.75);
}

.hero-disclaimer {
    flex: 0 0 90%;
    white-space: pre-line;
    font-size: clamp(0.703125rem, 1.6875vw, 0.9375rem);
    text-align: justify;
    font-weight: 500;
    padding-left: clamp(20px, 5vw, 50px);
    padding-right: clamp(20px, 5vw, 50px);
    padding-bottom: clamp(20px, 5vw, 50px);
    color: #ffffff;
    line-height: clamp(1.4, 2vw, 1.75);
}

/* Info Panel Styling */
#infoPanel {
  display: none; /* Initially hidden */
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  height: auto; /* Height adjusts to content */
  max-height: calc(100vh - 40px); /* Prevents overflow on small screens */
  background-color: #b02543;
  color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 20px; /* Padding above and below content */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  text-align: justify;
  box-sizing: border-box;
  overflow: hidden; /* No scrolling */
}

#infoButton {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
}

#infoButton img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.info-panel-text {
  margin: 10px 0 0;
  font-size: clamp(0.8125rem, 1.75vw, 1rem);
}

.info-panel-text-bold {
  font-weight: bold;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-upload .header {
  text-align: center;
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: clamp(24px, 5vw, 32px);
  cursor: pointer;
  color: #000;
}

.page-upload .hero-container {
  min-height: auto;
}

.page-upload .upload-container {
  padding: 0;
  gap: 0;
}

.page-upload .upload-body {
  padding: clamp(0px, 1vw, 8px) 0 clamp(8px, 2vw, 16px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.upload-input-container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 50px) 0 clamp(16px, 4vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 14px); /* 50% reduction */
  box-sizing: border-box;
  justify-content: center;
}

.page-upload .upload-form {
  max-width: 800px;
  margin: 0 auto;
}

.upload-dropzone {
  background-color: #262626;
  border: none; /* Remove all dotted/dashed borders */
  border-radius: 8px 8px 8px 8px;
  padding: clamp(18px, 4vw, 24px);
  text-align: left;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vw, 20px);
  /* Reduce dropzone height by ~10% */
  min-height: clamp(162px, 18vh, 234px);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  align-items: flex-start;
  /* Double the previous below space */
  margin-bottom: clamp(10px, 2vw, 14px);
}

.upload-dropzone.is-dragover {
  border: none; /* Keep border removed even on dragover */
  background-color: #262626;
}

.upload-dropzone__title {
  margin: 0;
  font-size: clamp(1.0625rem, 3vw, 1.375rem);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.file-instruction {
  color: #ffffff;
}

.file-browse-button {
  color: #ce2d4f;
  cursor: pointer;
  text-transform: uppercase;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  color: #ffffff;
  width: 100%;
}

.upload-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-file__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file__remove {
  background-color: #ce2d4f; /* match submit button */
  color: #ffffff;
  border: none;
  border-radius: 4px; /* match submit button radius */
  padding: 8px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.upload-file__remove:hover {
  background-color: #b02543; /* match submit hover */
  color: #ffffff;
}

.upload-file__remove:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.upload-message {
  margin: 0;
  font-size: clamp(0.8125rem, 2.25vw, 0.9375rem);
  color: #bfc3c8;
  text-align: justify;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 14px); /* 50% reduction */
  width: 100%;
}

.upload-textarea {
  margin: 0;
  position: relative;
}

.upload-submit {
  position: absolute;
  bottom: 40px;
  right: 40px;
}

.upload-submit:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.upload-submit.is-loading {
  cursor: wait;
}

.upload-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

a:link {
  color: #808080; /* default link color */
}
a:visited {
  color: #808080; /* grey after click */
}
a:hover {
  color: #808080; /* hover color */
}
a:active {
  color: #808080; /* active click color */
}