/* =============================
   MoneyMind Quiz Styles (Revised)
   - Fixed mobile clipping on result title
   - Cleaned up container & result spacing
   - Applied new brand color scheme
   ============================= */

:root {
  --bg: #f1f0ee;
  --card: #ffffff;
  --accent: #b11a21;
  --accent-2: #e0474c;
  --muted: #6b7280;
  --success: #7acfd6;
  --danger: #e53e3e;
  --surface-shadow: 0 8px 30px rgba(28, 43, 64, 0.08);
  --glass: rgba(255, 255, 255, 0.7);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 720px;
  --gap: 1rem;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  margin: 0;
  padding: 2rem;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg), #eef3f8);
  color: #0f1724;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* containers */
.quiz-container, .result-container {
  width: 100%;
  max-width: var(--max-width);
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--surface-shadow);
  margin: 1rem;
  border: 1px solid rgba(43, 108, 176, 0.06);
  animation: floatUp 320ms ease both;
}

/* extra space for result container */
.result-container {
  padding-top: 2.5rem;
  overflow: visible;
}

/* header */
.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
h1 {
  margin: 0;
  color: var(--accent);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.subtitle {
  color: var(--muted);
  margin-top: 0.4rem;
  font-size: 0.95rem;
  text-align: center;
}

/* card header accent */
.top-accent {
  width: 100%;
  height: 6px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  margin-bottom: 1rem;
}

/* question */
#question-text {
  font-size: 1.125rem;
  margin: 0 0 0.5rem 0;
  color: #123d6b;
}

/* answers */
#answers-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
  list-style: none;
  padding: 0;
}

#answers-container li {
  list-style: none;
  margin: 0;
}
input[type="radio"] {
  display: none;
}
.answer-label {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
  border: 1px solid rgba(15, 23, 36, 0.06);
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.03);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 180ms ease, border-color 180ms ease;
  font-size: 1rem;
  color: #0b2340;
}
.answer-label:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(16, 24, 40, 0.06);
}
input[type="radio"]:checked + .answer-label {
  background: linear-gradient(180deg, #fbecec, #f8dede);
  border: 1px solid rgba(177, 26, 33, 0.4);
  box-shadow: 0 10px 30px rgba(177, 26, 33, 0.08);
  transform: translateY(-2px);
  font-weight: 600;
}

/* primary action buttons (unified style) */
#next-button,
.answer-button {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 180ms ease, opacity 150ms ease;
  box-shadow: 0 8px 20px rgba(177, 26, 33, 0.25);
}
#next-button:hover,
.answer-button:hover {
  transform: translateY(-3px);
}
#next-button:disabled,
.answer-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* likert scale */
.likert-scale {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 0.5rem;
}
.likert-scale label {
  flex: 1;
  text-align: center;
  padding: 0.65rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 36, 0.06);
  background: #fbfdff;
  cursor: pointer;
  font-size: 0.95rem;
}
.likert-scale input[type="radio"]:checked + label {
  background: linear-gradient(90deg, #ffd6d8, #fbb7bb);
  border-color: rgba(177, 26, 33, 0.4);
  font-weight: 700;
}

/* result title */
.archetype-title {
  display: inline-block;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff4f4, #ffe9e9);
  color: var(--accent);
  font-weight: 700;
  text-transform: capitalize;
  margin-top: 1.4rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(177, 26, 33, 0.06);
}

/* subscribe */
#subscribe-area input[type="email"],
#subscribe-email {
  width: 100%;
  padding: 1.1rem 1rem;
  font-size: 1.05rem;
  border: 2px solid rgba(177, 26, 33, 0.25);
  border-radius: 12px;
  background: #fff;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}
#subscribe-area input[type="email"]:focus,
#subscribe-email:focus {
  outline: none;
  border-color: rgba(177, 26, 33, 0.6);
  box-shadow: 0 0 0 4px rgba(177, 26, 33, 0.12);
}

#subscribe-area button,
#subscribe-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .02em;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(177, 26, 33, 0.25);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease, opacity 120ms ease;
}
#subscribe-area button:hover,
#subscribe-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(177, 26, 33, 0.28);
}
#subscribe-area button:active,
#subscribe-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(177, 26, 33, 0.22);
}
#subscribe-area button:disabled,
#subscribe-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

/* responsive */
@media (max-width: 520px) {
  :root {
    font-size: 15px;
  }
  .quiz-container, .result-container {
    padding: 1rem;
  }
  h1 {
    font-size: 1.25rem;
  }
  #next-button,
  .answer-button {
    font-size: 0.98rem;
    padding: 0.8rem;
  }
  #subscribe-area input[type="email"],
  #subscribe-email {
    font-size: 1.06rem;
    padding: 1.1rem 1rem;
  }
  #subscribe-area button,
  #subscribe-btn {
    font-size: 1.06rem;
    padding: 1.05rem 1.25rem;
  }
}

/* animation */
@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* secondary button (neutral style) */
.secondary-button {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  color: #374151;
  background: #e5e7eb;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
  text-decoration: none;
  text-align: center;
}
.secondary-button:hover {
  background: #d1d5db;
  transform: translateY(-2px);
}
.secondary-button:active {
  transform: translateY(0);
}

/* accessibility */
.answer-label:focus, .answer-label:focus-visible {
  outline: 3px solid rgba(177, 26, 33, 0.2);
  outline-offset: 3px;
}
@media (max-width: 520px){
  body{
    align-items: flex-start;
    padding-top: calc(1rem + env(safe-area-inset-top));
  }
  .result-container{
    padding-top: calc(2rem + env(safe-area-inset-top));
  }
  h1, .archetype-title{
    margin-top: 1rem;
    line-height: 1.35;
  }
}
