/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

/* ================= ANIMATED BACKGROUND ================= */
body {
  background: linear-gradient(
    300deg,
    #0a0a09,
    #111110,
    #141412,
    #111110,
    #0e0e0d,
    #121211
  );
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  color: #f0eeea;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ================= CONTAINER ================= */
.container {
  background: rgba(18, 18, 16, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.05);
}

/* ================= FADE/SLIDE IN ON LOAD ================= */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

h1 {
  text-align: center;
  font-size: 2.2em;
  margin-bottom: 5px;
  color: #f0eeea;
  text-shadow: 0 0 24px rgba(45, 184, 101, 0.2);
}

.subtitle {
  text-align: center;
  margin-bottom: 25px;
  color: #888880;
  font-weight: 500;
}

#surveyForm .section {
  opacity: 0;
  animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  margin-bottom: 20px;
}

#surveyForm .section:nth-child(1) { animation-delay: 0.20s; }
#surveyForm .section:nth-child(2) { animation-delay: 0.28s; }
#surveyForm .section:nth-child(3) { animation-delay: 0.36s; }
#surveyForm .section:nth-child(4) { animation-delay: 0.44s; }
#surveyForm .section:nth-child(5) { animation-delay: 0.52s; }

#warningMsg, #submitBtn, #progressContainer {
  opacity: 0;
  animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.58s forwards;
}

/* ================= TYPOGRAPHY ================= */
label, p {
  font-weight: bold;
  font-size: 1.05em;
}

/* ================= INPUTS ================= */
input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  margin-top: 5px;
  border-radius: 12px;
  border: 1px solid #2e2e2a;
  background: #1c1c1a;
  color: #f0eeea;
  font-size: 1em;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #2db865;
  background: #1e221e;
  box-shadow: 0 0 0 3px rgba(45, 184, 101, 0.13);
}

/* ================= OPTIONS / BUTTONS ================= */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.option {
  flex: 1 1 calc(50% - 10px);
  padding: 14px;
  border-radius: 15px;
  border: 1px solid #2e2e2a;
  cursor: pointer;
  font-weight: bold;
  background: #1c1c1a;
  color: #f0eeea;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.2s ease;
}

.option::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(45, 184, 101, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.option:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 184, 101, 0.2);
  background: #222220;
  border-color: #2db865;
}

.option:hover::after { opacity: 1; }

.option:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(45, 184, 101, 0.12);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.option.selected {
  transform: scale(1.04) translateY(-1px);
  box-shadow: 0 6px 22px rgba(45, 184, 101, 0.3);
  background: #1a2a1e;
  border-color: #2db865;
}

.option.selected::after { opacity: 1; }

/* ================= SUBMIT BUTTON ================= */
#submitBtn {
  width: 100%;
  padding: 16px;
  font-weight: bold;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  background: #252522;
  color: #f0eeea;
  font-size: 1em;
  margin-top: 10px;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background 0.2s ease;
}

#submitBtn:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 8px 28px rgba(45, 184, 101, 0.2);
  background: #2e2e2a;
}

#submitBtn:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* ================= MISC ================= */
.hidden { display: none; }

/* ================= PROGRESS BAR ================= */
#progressContainer {
  background: #1c1c1a;
  border-radius: 20px;
  height: 14px;
  width: 100%;
  margin-top: 20px;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2db865, #55cc44);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
  box-shadow: 0 0 15px rgba(45, 184, 101, 0.45);
}

/* ================= WARNING ================= */
#warningMsg {
  color: #ff6666;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
  transition: opacity 0.3s;
}

#warningMsg.visible {
  display: block;
  opacity: 1;
}

/* ================= THANK YOU ================= */
#thankYou {
  text-align: center;
  padding: 20px;
  border-radius: 20px;
}

#thankYou h2 {
  font-size: 1.8em;
  margin-bottom: 10px;
}

#thankYou p {
  font-size: 1em;
  color: #888880;
}

/* ================= RESULTS SUMMARY ================= */
#resultsSummary {
  margin-top: 20px;
  padding: 20px;
  background: rgba(14, 14, 12, 0.88);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.question-summary {
  margin-bottom: 20px;
  opacity: 0;
  animation: slideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#Q1-summary { animation-delay: 0.1s; }
#Q2-summary { animation-delay: 0.25s; }
#Q3-summary { animation-delay: 0.4s; }

.question-summary h3 {
  font-size: 1.05em;
  margin-bottom: 6px;
  color: #d8d5ce;
}

.dispatch-msg {
  font-size: 0.95em;
  font-weight: bold;
  color: #2db865;
  margin-bottom: 8px;
}

.user-answer-label {
  font-size: 0.9em;
  color: #888880;
  margin-bottom: 6px;
}

/* ================= RESULT BAR ================= */
.result-bar {
  position: relative;
  height: 22px;
  background: #1c1c1a;
  border-radius: 12px;
  margin-top: 5px;
  overflow: hidden;
}

.result-fill {
  height: 100%;
  background: linear-gradient(90deg, #c8a84b, #e8c240);
  width: 0%;
  border-radius: 12px;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 0.82em;
  font-weight: bold;
  color: #1a1a0a;
  white-space: nowrap;
  min-width: 36px;
  box-shadow: 0 0 12px rgba(200, 168, 75, 0.35);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 380px) {
  .option { flex: 1 1 100%; }
}

/* ================= UNANSWERED ================= */
.section.unanswered {
  border: 2px solid #ff6666;
  border-radius: 15px;
  padding: 12px;
  transition: border 0.3s;
}

/* ================= CONFETTI ================= */
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ================= INTRO SCREEN ================= */
#introScreen {
  opacity: 0;
  animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

#introScreen h1 {
  opacity: 1;
  animation: none;
}

#introScreen .subtitle {
  opacity: 1;
  animation: none;
  margin-bottom: 22px;
}

.intro-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  opacity: 0;
  animation: slideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#intro-purpose         { animation-delay: 0.18s; }
#intro-instructions    { animation-delay: 0.28s; }
#intro-confidentiality { animation-delay: 0.38s; }

.intro-icon {
  font-size: 0.7em;
  font-weight: bold;
  color: #2db865;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  margin-top: 4px;
  opacity: 0.85;
}

.intro-body h3 {
  font-size: 0.95em;
  font-weight: bold;
  color: #c8c4bc;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.intro-body p,
.intro-body ol {
  font-size: 0.92em;
  color: #888880;
  font-weight: normal;
  line-height: 1.6;
}

.intro-body ol {
  padding-left: 16px;
}

.intro-body ol li {
  margin-bottom: 3px;
}

#beginBtn {
  width: 100%;
  padding: 16px;
  font-weight: bold;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #1a3a22, #2db865);
  color: #f0eeea;
  font-size: 1em;
  margin-top: 18px;
  opacity: 0;
  animation: slideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.48s forwards;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background 0.2s ease;
}

#beginBtn:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 8px 28px rgba(45, 184, 101, 0.35);
  background: linear-gradient(135deg, #224a2a, #3dca72);
}

#beginBtn:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* Transition animation for screen swap */
@keyframes fadeSlideOut {
  to { opacity: 0; transform: translateY(-16px); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-out {
  animation: fadeSlideOut 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#surveyWrapper {
  animation: fadeSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.form-title {
  text-align: center;
  font-size: 2.2em;
  margin-bottom: 5px;
  color: #f0eeea;
  text-shadow: 0 0 24px rgba(45, 184, 101, 0.2);
}

.form-subtitle {
  text-align: center;
  margin-bottom: 25px;
  color: #888880;
  font-weight: 500;
}

/* ================= SHARING STATION ================= */
#sharingStation {
  margin-top: 20px;
  padding: 20px;
  background: rgba(14, 14, 12, 0.88);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

.sharing-title {
  font-size: 1em;
  font-weight: bold;
  color: #f0eeea;
  margin-bottom: 4px;
}

.sharing-sub {
  font-size: 0.88em;
  color: #777770;
  font-weight: normal;
  margin-bottom: 14px;
}

.sharing-sub strong {
  color: #2db865;
  font-weight: bold;
}

.sharing-progress-label {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-bottom: 8px;
}

#responseCount {
  font-size: 1.5em;
  font-weight: bold;
  color: #2db865;
  line-height: 1;
  transition: all 0.3s ease;
}

.sharing-goal {
  font-size: 0.85em;
  color: #555550;
}

.sharing-bar-track {
  background: #1c1c1a;
  border-radius: 12px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 0;
}

#sharingBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2db865, #55cc44);
  border-radius: 12px;
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(45, 184, 101, 0.3);
}

/* Expanded after submit */
#sharingActions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  opacity: 0;
  animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sharing-cta {
  font-size: 0.88em;
  color: #777770;
  font-weight: normal;
  text-align: center;
  margin-bottom: 14px;
}

#copyLinkBtn {
  width: 100%;
  padding: 13px;
  font-weight: bold;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  background: #252522;
  color: #c8c4bc;
  font-size: 0.95em;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
  transition:
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

#copyLinkBtn:hover {
  transform: scale(1.03) translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: #2e2e2a;
  border-color: rgba(255, 255, 255, 0.15);
}

#copyLinkBtn:active {
  transform: scale(0.97);
}

#copyLinkBtn.copied {
  background: #1a2a1e;
  border-color: rgba(45, 184, 101, 0.4);
  color: #2db865;
}

#qrContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-label {
  font-size: 0.82em;
  color: #555550;
  text-align: center;
  font-weight: normal;
}

#qrCode {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #fff;
  padding: 8px;
  display: block;
}
