/* Schooh Career Discovery - Styles
   Design philosophy: Simple, serious, parent-trustworthy, kid-friendly */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #5B21B6;
  --primary-light: #EDE9FE;
  --primary-dark: #4C1D95;
  --accent: #F59E0B;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #18181B;
  --text-light: #52525B;
  --text-muted: #71717A;
  --border: #E4E4E7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* === Top Bar === */
.topbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.topbar .logo span {
  color: var(--primary);
}

.topbar .right {
  font-size: 14px;
  color: var(--text-muted);
}

/* === Screens (only one visible at a time) === */
.screen {
  display: none;
  flex: 1;
  padding: 32px 0;
  animation: fadeIn 0.4s ease;
}
.screen.active { display: block; }

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

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

/* === Intro Screen === */
.intro-hero {
  text-align: center;
  padding: 24px 0 32px;
}

.intro-eyebrow {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.intro-headline {
  font-size: 38px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text);
}

.intro-headline .highlight {
  background: linear-gradient(120deg, var(--primary), #7C3AED);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-subheadline {
  font-size: 17px;
  color: var(--text-light);
  max-width: 500px;
  margin: 0 auto 32px;
}

.intro-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-muted);
}

.intro-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.intro-cta {
  display: inline-block;
  background: var(--text);
  color: white;
  padding: 16px 32px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
  font-family: inherit;
}

.intro-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.intro-cta:active {
  transform: translateY(0);
}

/* Archetype preview grid */
.archetype-preview {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.archetype-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.archetype-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: left;
  transition: all 0.2s;
}

.archetype-tile-emoji {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.archetype-tile-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.archetype-tile-tag {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* === Question Screen === */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 -20px 24px;
  border-radius: 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7C3AED);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.question-text {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.question-subtext {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  line-height: 1.4;
  position: relative;
  animation: slideIn 0.3s ease backwards;
}

.option:nth-child(1) { animation-delay: 0.05s; }
.option:nth-child(2) { animation-delay: 0.10s; }
.option:nth-child(3) { animation-delay: 0.15s; }
.option:nth-child(4) { animation-delay: 0.20s; }
.option:nth-child(5) { animation-delay: 0.25s; }
.option:nth-child(6) { animation-delay: 0.30s; }
.option:nth-child(7) { animation-delay: 0.35s; }
.option:nth-child(8) { animation-delay: 0.40s; }

.option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.option:active {
  transform: scale(0.99);
}

.question-nav {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 500;
}

.btn-back:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* === Loading Screen === */
.loading-screen {
  text-align: center;
  padding: 80px 20px;
}

.loading-emoji {
  font-size: 48px;
  margin-bottom: 24px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

.loading-headline {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.loading-text {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto;
}

.loading-steps {
  margin-top: 32px;
  text-align: left;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.loading-step {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.4;
  transition: opacity 0.4s;
}

.loading-step.done {
  opacity: 1;
  color: var(--text);
}

.loading-step.done::before {
  content: '✓';
  color: #10B981;
  font-weight: bold;
}

.loading-step:not(.done)::before {
  content: '○';
  color: var(--text-muted);
}

/* === Result Screen === */
.result-screen {
  padding-top: 16px;
}

.result-eyebrow {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.result-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--archetype-color, var(--primary));
}

.result-emoji {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.result-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  color: var(--archetype-color, var(--text));
}

.result-tagline {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.result-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0;
}

.result-match-meta {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.result-meta-block {
  flex: 1;
}

.result-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.result-meta-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.result-meta-value.match {
  color: var(--archetype-color, var(--primary));
}

/* Career list */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.section-card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.career-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.career-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.career-title {
  font-size: 14px;
  font-weight: 600;
}

.career-salary {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
}

/* Premium card */
.premium-card {
  background: linear-gradient(135deg, #18181B, #27272A);
  color: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.premium-card::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 80px;
  opacity: 0.1;
}

.premium-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.premium-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.premium-desc {
  font-size: 14px;
  color: #D4D4D8;
  margin-bottom: 16px;
  line-height: 1.5;
}

.premium-features {
  list-style: none;
  margin-bottom: 20px;
}

.premium-features li {
  font-size: 13px;
  color: #E4E4E7;
  padding: 4px 0;
  padding-left: 22px;
  position: relative;
}

.premium-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10B981;
  font-weight: bold;
}

.premium-cta {
  background: white;
  color: #18181B;
  border: none;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: transform 0.15s;
}

.premium-cta:hover { transform: translateY(-1px); }

.premium-price {
  font-size: 13px;
  color: #A1A1AA;
  margin-top: 8px;
  text-align: center;
}

.premium-price-strike {
  text-decoration: line-through;
  margin-right: 8px;
}

/* Share section */
.share-section {
  margin: 24px 0;
  text-align: center;
}

.share-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.share-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s;
}

.share-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.share-btn.whatsapp {
  background: #25D366;
  color: white;
  border-color: #25D366;
}

/* Footer CTAs */
.footer-cta {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  margin-top: 12px;
  display: block;
  width: 100%;
  font-weight: 500;
}

.btn-text:hover { color: var(--text); }

/* Footer */
.footer {
  text-align: center;
  padding: 32px 20px 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 480px) {
  .intro-headline { font-size: 30px; }
  .intro-subheadline { font-size: 15px; }
  .question-text { font-size: 20px; }
  .result-name { font-size: 26px; }
  .archetype-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 16px; }
}

/* === AI Insights Section === */
.ai-insights-card {
  background: linear-gradient(135deg, #FAFAFA 0%, #F4F0FA 100%);
  border: 1px solid var(--primary-light);
}

.ai-insights-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.ai-loading-pulse {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: ai-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

.ai-narrative {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.ai-section {
  padding: 12px 0;
}

.ai-section + .ai-section {
  border-top: 1px solid rgba(0,0,0,0.04);
}

.ai-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ai-section p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.ai-next-step {
  margin-top: 8px;
  background: var(--primary-light);
  border-radius: 12px;
  padding: 14px 16px !important;
  border: none !important;
}

.ai-next-step .ai-section-label {
  color: var(--primary);
}

/* === AI Chat === */
.ai-chat-card {
  border: 2px solid var(--primary);
  background: var(--surface);
}

.ai-chat-messages {
  max-height: 360px;
  overflow-y: auto;
  margin: 14px 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-chat-messages:empty {
  margin: 0;
  padding: 0;
}

.ai-chat-msg {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 88%;
  animation: fadeIn 0.3s;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ai-chat-msg.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-chat-msg.bot {
  background: var(--bg);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.ai-chat-msg.bot.thinking {
  color: var(--text-muted);
  font-style: italic;
}

.ai-chat-msg.bot.thinking::after {
  content: '...';
  animation: ai-thinking 1.5s steps(4) infinite;
}

@keyframes ai-thinking {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

.ai-chat-input-wrap {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ai-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.ai-chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.ai-chat-send {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.ai-chat-send:hover { transform: scale(1.05); }
.ai-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.ai-chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.ai-chat-tip {
  opacity: 0.8;
  font-size: 11px;
}

@media (max-width: 480px) {
  .ai-chat-tip { display: none; }
}

/* === Sign-up Hero (PRIMARY CTA on result page) === */
.signup-hero {
  background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 100%);
  color: white;
  border-radius: 24px;
  padding: 32px 28px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.signup-hero::before {
  content: '✨';
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 100px;
  opacity: 0.1;
}

.signup-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #FCD34D;
  margin-bottom: 12px;
}

.signup-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
  color: white;
}

.signup-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.signup-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.signup-features li {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  padding: 6px 0;
}

.signup-cta {
  width: 100%;
  background: white;
  color: #18181B;
  border: none;
  border-radius: 16px;
  padding: 18px 20px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.signup-cta:hover { transform: translateY(-1px); }

.signup-cta-main {
  font-size: 16px;
}

.signup-cta-sub {
  font-size: 11px;
  color: #71717A;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.signup-alternative {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.signup-alternative a {
  color: #FCD34D;
  font-weight: 600;
  text-decoration: none;
}

/* === Locked content cards === */
.locked-card {
  position: relative;
  background: var(--surface);
  border: 1.5px dashed var(--border);
}

.locked-content {
  text-align: center;
  padding: 24px 12px;
}

.locked-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.locked-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
  margin-bottom: 14px;
}

.locked-text strong {
  color: var(--primary-dark);
  font-weight: 700;
}

.btn-text-cta {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  font-family: inherit;
}

.btn-text-cta:hover {
  text-decoration: underline;
}

/* Hidden canvas for card generation */
.share-canvas {
  position: fixed;
  top: -9999px;
  left: -9999px;
  pointer-events: none;
}
