/* ===========================
   Shared CSS — Rise People Tools
   =========================== */

/* === Tokens & Reset === */
:root {
  --rise-blue: #555DF2;
  --rise-blue-hover: #4D54DA;
  --rise-dark-blue: #09247C;
  --rise-heading: #0F151B;
  --rise-orange: #FFA31D;
  --rise-body: #2B333A;
  --rise-secondary: #636B73;
  --rise-bg: #F2F5FB;
  --rise-white: #FFFFFF;
  --rise-border: #DCE4EC;
  --rise-card-radius: 16px;
  --rise-btn-radius: 8px;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--rise-body);
  background: var(--rise-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* === Header === */
.header {
  display: flex;
  justify-content: center;
  padding: 8px 0 24px;
}
.header svg { height: 28px; width: auto; }

/* === Buttons === */
.btn-primary {
  background: var(--rise-blue);
  color: var(--rise-white);
  border: none;
  border-radius: var(--rise-btn-radius);
  padding: 14px 40px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--rise-blue-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible { outline: 3px solid var(--rise-blue); outline-offset: 2px; }

.btn-secondary {
  background: none;
  border: none;
  color: var(--rise-blue);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-secondary svg { border-bottom: 1px solid currentColor; }
.btn-secondary:hover { color: var(--rise-blue-hover); }
.btn-secondary:focus-visible { outline: 2px solid var(--rise-blue); outline-offset: 2px; }

/* === Index: Hero === */
.hero {
  text-align: center;
  padding: 32px 0 40px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--rise-heading);
  line-height: 1.3;
  margin-bottom: 12px;
}
.hero p {
  font-size: 16px;
  color: var(--rise-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}

/* === Index: Tools Grid === */
.tools {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-card {
  background: var(--rise-white);
  border-radius: var(--rise-card-radius);
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  text-decoration: none;
  color: inherit;
  border: 1.5px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: block;
}
.tool-card:hover {
  border-color: var(--rise-blue);
  box-shadow: 0 2px 8px rgba(85,93,242,0.1);
}
.tool-overline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rise-blue);
  margin-bottom: 6px;
}
.tool-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--rise-heading);
  margin-bottom: 6px;
}
.tool-desc {
  font-size: 15px;
  color: var(--rise-secondary);
  line-height: 1.5;
}
.tool-cta {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rise-blue);
}
.tool-card:hover .tool-cta { text-decoration: underline; }

/* === Quiz: Screens === */
.screen { display: none; flex-direction: column; align-items: center; flex: 1; }
.screen.active { display: flex; }

/* === Quiz: Landing === */
.landing-emojis {
  font-size: 48px;
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  margin-top: 32px;
}
.landing-card {
  background: var(--rise-white);
  border-radius: var(--rise-card-radius);
  padding: 48px 40px;
  text-align: center;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.landing-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--rise-heading);
  line-height: 1.2;
  margin-bottom: 16px;
}
.landing-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: var(--rise-secondary);
  margin-bottom: 8px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.landing-teaser {
  font-size: 14px;
  color: var(--rise-secondary);
  margin-bottom: 32px;
  font-weight: 600;
}

/* === Quiz: Progress === */
.progress-area {
  width: 100%;
  margin-bottom: 24px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--rise-secondary);
  margin-bottom: 8px;
}
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--rise-border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--rise-blue);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* === Quiz: Questions === */
.question-card {
  background: var(--rise-white);
  border-radius: var(--rise-card-radius);
  padding: 48px 40px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 8px;
}
.question-text {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--rise-heading);
  margin-bottom: 28px;
}
.answer-list { display: flex; flex-direction: column; gap: 12px; }
.answer-card {
  background: var(--rise-white);
  border: 1.5px solid var(--rise-border);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  user-select: none;
}
@media (hover: hover) {
  .answer-card:hover {
    border-color: var(--rise-blue);
    background: #F7F7FF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(85, 93, 242, 0.08);
  }
}
.answer-card:active {
  transform: scale(0.98);
}
.answer-card:focus-visible { outline: 2px solid var(--rise-blue); outline-offset: 2px; }
.answer-card.selected {
  border-color: var(--rise-blue);
  background: #EEEFFE;
}
.back-btn {
  background: none;
  border: none;
  color: var(--rise-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  align-self: flex-start;
}
.back-btn:hover { color: var(--rise-body); }

/* === Quiz: Screen Transitions === */
.question-card.slide-out-left {
  animation: slideOutLeft 0.25s ease forwards;
}
.question-card.slide-in-right {
  animation: slideInRight 0.25s ease forwards;
}
.question-card.slide-out-right {
  animation: slideOutRight 0.25s ease forwards;
}
.question-card.slide-in-left {
  animation: slideInLeft 0.25s ease forwards;
}
@keyframes slideOutLeft {
  to { opacity: 0; transform: translateX(-30px); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(30px); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === Quiz: Lead Capture === */
.lead-card {
  background: var(--rise-white);
  border-radius: var(--rise-card-radius);
  padding: 48px 40px;
  text-align: center;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.lead-emoji {
  font-size: 64px;
  margin-bottom: 24px;
}
.lead-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--rise-heading);
  margin-bottom: 8px;
}
.lead-subtitle {
  font-size: 15px;
  color: var(--rise-secondary);
  margin-bottom: 32px;
}
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--rise-border);
  border-radius: var(--rise-btn-radius);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--rise-body);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus {
  border-color: var(--rise-blue);
}
.form-group input.error {
  border-color: #E53E3E;
}
.form-error {
  font-size: 13px;
  color: #E53E3E;
  margin-top: 4px;
  display: none;
}
.form-group input.error + .form-error { display: block; }
.lead-form .btn-primary {
  width: 100%;
  margin-top: 8px;
}
.privacy-note {
  font-size: 12px;
  color: var(--rise-secondary);
  margin-top: 12px;
  text-align: center;
}
.checkbox-group { margin-top: 4px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--rise-secondary);
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--rise-blue);
  cursor: pointer;
}

/* === Quiz: Results === */
.results-card {
  background: var(--rise-white);
  border-radius: var(--rise-card-radius);
  padding: 48px 40px;
  text-align: center;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.result-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  opacity: 0;
  transform: scale(0.5);
  animation: popIn 0.5s ease 0.2s forwards;
}
@keyframes popIn {
  to { opacity: 1; transform: scale(1); }
}
.result-pre-title {
  font-size: 14px;
  color: var(--rise-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.5s forwards;
}
.result-type-name {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--rise-heading);
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.6s forwards;
}
.result-tagline {
  font-size: 18px;
  color: var(--rise-secondary);
  font-style: italic;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.7s forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.9s forwards;
}
.badge-pill {
  background: #FFF3E0;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  color: #B87200;
  font-weight: 600;
  white-space: nowrap;
}
.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.4s ease 1.1s forwards;
}
.result-actions .btn-primary { width: 100%; max-width: 320px; }
.result-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* === Quiz: Profile Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: var(--rise-white);
  border-radius: var(--rise-card-radius);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px 32px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--rise-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.modal-close:hover { background: var(--rise-bg); }
.modal-type-name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--rise-heading);
  margin-bottom: 16px;
}
.modal-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--rise-body);
  margin-bottom: 24px;
}
.modal-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-section-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--rise-body);
  margin-bottom: 24px;
}

/* === Quiz: Types Grid === */
.types-grid-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--rise-heading);
  margin-bottom: 8px;
}
.types-grid-subtitle {
  font-size: 15px;
  color: var(--rise-secondary);
  margin-bottom: 24px;
  text-align: center;
}
.types-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
}
.type-grid-card {
  background: var(--rise-white);
  border: 1.5px solid var(--rise-border);
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.type-grid-card:hover {
  border-color: var(--rise-blue);
  box-shadow: 0 2px 8px rgba(85, 93, 242, 0.08);
}
.type-grid-card.is-you {
  border-color: var(--rise-blue);
  background: #F7F7FF;
}
.type-grid-emoji { font-size: 36px; margin-bottom: 8px; }
.type-grid-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}
.type-grid-tagline {
  font-size: 12px;
  color: var(--rise-secondary);
  font-style: italic;
}
.you-badge {
  display: inline-block;
  background: var(--rise-blue);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* === Quiz: Share === */
.share-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: var(--rise-btn-radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--rise-border);
  background: var(--rise-white);
  color: var(--rise-body);
  transition: background 0.2s, border-color 0.2s;
}
.share-btn:hover { border-color: var(--rise-blue); background: #F7F7FF; }
.share-btn:focus-visible { outline: 2px solid var(--rise-blue); outline-offset: 2px; }
.share-btn.linkedin { background: #0A66C2; color: white; border-color: #0A66C2; }
.share-btn.linkedin:hover { background: #004182; border-color: #004182; }
.share-btn.x-twitter { background: #000000; color: white; border-color: #000000; }
.share-btn.x-twitter:hover { background: #333333; border-color: #333333; }
.share-btn.copied { background: #48BB78; color: white; border-color: #48BB78; }

/* === Quiz: Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--rise-body);
  color: white;
  padding: 12px 24px;
  border-radius: var(--rise-btn-radius);
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  transition: transform 0.3s ease;
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* === Footer === */
.footer {
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--rise-secondary);
  border-top: 1px solid var(--rise-border);
  margin-top: auto;
}
.footer a {
  color: var(--rise-blue);
  text-decoration: none;
  font-weight: 600;
}
.footer a:hover { text-decoration: underline; }
.footer-logo { margin-bottom: 8px; }
.footer-logo svg { height: 24px; width: auto; opacity: 0.8; }

/* === Quiz: Shared Result View === */
.shared-notice {
  background: #FFFBEB;
  border: 1px solid #FED7AA;
  border-radius: var(--rise-btn-radius);
  padding: 12px 20px;
  font-size: 14px;
  color: #92400E;
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
}

/* === Responsive === */
@media (min-width: 680px) {
  .types-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 600px) {
  /* Index */
  .hero h1 { font-size: 26px; }
  .tool-card { padding: 24px 20px; }
  .tool-name { font-size: 18px; }

  /* Quiz */
  .landing-title { font-size: 28px; }
  .landing-card { padding: 32px 24px; }
  .question-card { padding: 32px 24px; }
  .question-text { font-size: 22px; }
  .lead-card { padding: 32px 24px; }
  .results-card { padding: 32px 24px; }
  .result-type-name { font-size: 28px; }
  .types-grid { grid-template-columns: 1fr; }
  .modal-content { padding: 32px 20px; margin: 16px; }
  .landing-emojis { font-size: 40px; }
  .result-emoji { font-size: 64px; }
  .lead-emoji { font-size: 48px; }
}
