@import url("https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,700;0,900;1,800;1,900&family=DM+Sans:wght@300;400;500&display=swap");

/* ── Variables ── */
:root {
  --bg: #0f1b35;
  --bg-card: #152040;
  --bg-input: #1a2a50;
  --bg-radio: #1a2a50;
  --bg-radio-on: #4ade80;
  --green-btn: #4ade80;
  --green-dark: #22c55e;
  --text-primary: #e8f0fe;
  --text-label: #c5d3f0;
  --text-muted: #6b80b0;
  --border-input: rgba(255, 255, 255, 0.08);
  --radius-input: 12px;
  --radius-btn: 50px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
}

/* ── Body ── */
body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background-image:
    radial-gradient(
      ellipse 70% 50% at 50% 0%,
      rgba(74, 127, 220, 0.18) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 40% 35% at 90% 95%,
      rgba(244, 124, 32, 0.1) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 35% 30% at 5% 80%,
      rgba(74, 127, 220, 0.08) 0%,
      transparent 60%
    );
}

/* ── Card ── */
.card {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  background: var(--bg-card);
  border-radius: 28px;
  padding: 2.25rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 32px 80px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ── Logo ── */
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.logo img {
  height: 90px;
  width: auto;
  filter: drop-shadow(0 6px 18px rgba(244, 124, 32, 0.5));
  animation: float 3.8s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-7px);
  }
}

.logo p {
  font-family: "Nunito", sans-serif;
  font-size: 1.9rem;
  font-weight: 900;
  font-style: italic;
  color: #fff;
  text-shadow: 0 2px 20px rgba(244, 124, 32, 0.3);
}

/* ── Question blocks ── */
.question {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.question:nth-of-type(1) {
  animation-delay: 0.08s;
}
.question:nth-of-type(2) {
  animation-delay: 0.16s;
}
.question:nth-of-type(3) {
  animation-delay: 0.24s;
}

/* Question heading label — first label in each .question */
.question > label:first-child {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-label);
  line-height: 1.35;
  padding-left: 2px;
}

/* ── Textarea (question 1) ── */
.question textarea {
  width: 100%;
  height: 100px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-input);
  padding: 0.85rem 1rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.92rem;
  color: var(--text-primary);
  outline: none;
  resize: none;
  line-height: 1.5;
  transition:
    border-color 0.22s,
    box-shadow 0.22s,
    background 0.22s;
}

.question textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.question textarea:focus {
  border-color: rgba(100, 160, 255, 0.45);
  background: #1f3060;
  box-shadow: 0 0 0 3px rgba(74, 127, 220, 0.15);
}

/* ── Radio pill group ── */
/* Hide the native radio inputs */
.question input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Turn each radio+label pair into a row */
.question:has(input[type="radio"]) {
  flex-direction: column;
}

/* The pill labels sit in a flex row */
.question input[type="radio"] + label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.2rem;
  background: var(--bg-radio);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 50px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  user-select: none;
}

/* Dot indicator inside pill */
.question input[type="radio"] + label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  transition:
    background 0.2s,
    border-color 0.2s;
}

/* Checked state */
.question input[type="radio"]:checked + label {
  background: rgba(74, 222, 128, 0.12);
  border-color: var(--green-btn);
  color: var(--green-btn);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.question input[type="radio"]:checked + label::before {
  background: var(--green-btn);
  border-color: var(--green-btn);
}

/* Hover state */
.question input[type="radio"] + label:hover {
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--text-primary);
}

/* Pills side by side */
.radio-group {
  display: flex;
  gap: 0.75rem;
}

/* ── Result section ── */
.result {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-label);
  line-height: 1.35;
  padding-left: 2px;
}

.result p {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-input);
  white-space: pre-wrap; /* Preserve line breaks if any */
}

.result strong {
  color: var(--green-btn);
  font-weight: 700;
}

/* ── Back Button ── */
#back-btn,
#search-btn {
  display: block;
  width: 82%;
  margin: 0.4rem auto 0;
  padding: 1rem 2rem;
  background: linear-gradient(
    160deg,
    var(--green-btn) 0%,
    var(--green-dark) 100%
  );
  border: none;
  border-radius: var(--radius-btn);
  font-family: "Nunito", sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #0a1628;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
  box-shadow: 0 6px 28px rgba(74, 222, 128, 0.35);
  animation: fadeUp 0.55s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#back-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18) 0%,
    transparent 55%
  );
  border-radius: inherit;
  pointer-events: none;
}

#back-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 36px rgba(74, 222, 128, 0.5);
}

#back-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(74, 222, 128, 0.25);
}

/* ── Responsive ── */
@media (max-width: 420px) {
  .card {
    padding: 1.75rem 1.25rem 1.75rem;
    border-radius: 22px;
  }
  .logo img {
    height: 75px;
  }
  .logo p {
    font-size: 1.65rem;
  }
  .question > label:first-child {
    font-size: 0.93rem;
  }
  .question textarea {
    height: 86px;
    font-size: 0.88rem;
  }
  #search-btn,
  #back-btn {
    width: 88%;
    font-size: 1.15rem;
  }
}

@media (max-width: 340px) {
  .card {
    padding: 1.5rem 1rem;
  }
  .logo p {
    font-size: 1.45rem;
  }
  #search-btn,
  #back-btn {
    width: 94%;
  }
  .radio-group {
    flex-direction: column;
  }
}
