/* =============================================
   TypePop — 공통 스타일시트
   Mobile-first, 360px base, 320px minimum
   Desktop card container: 480~520px centered
   ============================================= */

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

/* --- CSS Variables --- */
:root {
  --primary: #7C3AED;
  --primary-hover: #6D28D9;
  --primary-light: #F5F3FF;
  --primary-border: #DDD6FE;
  --accent: #EC4899;
  --accent-light: #FDF2F8;
  --bg: #F0EBFF;
  --bg-alt: #FAF9FF;
  --card-bg: #FFFFFF;
  --text: #1F2937;
  --text-sub: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --success: #10B981;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(124,58,237,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(124,58,237,0.14), 0 2px 8px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

/* --- Base --- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Page wrapper --- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* --- Card Container (mobile: 100%, desktop: 480~520px centered) --- */
.card-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 540px) {
  .card-container {
    padding: 0 24px;
  }
}

/* --- Site Header --- */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header .header-inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.site-header .logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.site-header .logo span {
  color: var(--accent);
}

/* --- Main content --- */
.main-content {
  flex: 1;
  padding: 24px 0 40px;
}

/* --- Card --- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card + .card {
  margin-top: 16px;
}

.card-body {
  padding: 24px 20px;
}

.card-header {
  padding: 20px 20px 0;
}

/* --- Test card (home) --- */
.test-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, #FDF4FF 100%);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
  margin-bottom: 16px;
  text-decoration: none;
  display: block;
  transition: box-shadow 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.test-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

.test-card-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.test-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.test-card-desc {
  font-size: 0.875rem;
  color: var(--text-sub);
  margin-bottom: 14px;
  line-height: 1.5;
}

.test-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #9333EA 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,0.3);
  width: 100%;
  min-height: 52px;
  font-size: 1.0625rem;
  border-radius: var(--radius-md);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #7C3AED 100%);
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid var(--primary-border);
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-md);
}

.btn-secondary:hover {
  background: var(--primary-border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  min-height: 44px;
}

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

/* --- Landing hero section --- */
.landing-hero {
  text-align: center;
  padding: 32px 20px 24px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.landing-brand {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.landing-emoji {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.landing-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.landing-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 14px;
}

.landing-desc {
  font-size: 0.9375rem;
  color: var(--text-sub);
  line-height: 1.65;
  margin-bottom: 28px;
}

.landing-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--text-light);
}

.meta-icon {
  font-size: 0.875rem;
}

/* --- Ad slot placeholder --- */
.ad-slot {
  background: var(--bg-alt);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

.ad-slot-text {
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* --- Section title --- */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* --- Page hero (inner pages) --- */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #9333EA 100%);
  color: #fff;
  padding: 36px 20px 32px;
  text-align: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 24px;
}

.page-hero-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
  display: block;
}

.page-hero-label {
  font-size: 0.8125rem;
  opacity: 0.8;
  margin-bottom: 8px;
}

.page-hero-title {
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

/* --- Result placeholder --- */
.result-placeholder {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 16px;
}

.result-placeholder-badge {
  display: inline-block;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  margin-bottom: 16px;
}

.result-placeholder-text {
  font-size: 0.9375rem;
  color: var(--text-sub);
  line-height: 1.65;
}

/* --- Privacy / Contact page --- */
.prose-page {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px 20px;
}

.prose-page h1 {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.prose-page .updated {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.prose-page p {
  font-size: 0.9375rem;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* --- Site Footer --- */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 20px 16px;
  text-align: center;
}

.site-footer .footer-inner {
  max-width: 520px;
  margin: 0 auto;
}

.site-footer .footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.site-footer .footer-links a {
  font-size: 0.8125rem;
  color: var(--text-sub);
  text-decoration: none;
}

.site-footer .footer-links a:hover {
  color: var(--primary);
}

.site-footer .footer-copy {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* --- Home section heading --- */
.home-intro {
  padding: 24px 0 16px;
}

.home-intro-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.home-intro-sub {
  font-size: 0.9375rem;
  color: var(--text-sub);
}

/* --- Test area (placeholder anchor target) --- */
#test-area {
  scroll-margin-top: 70px;
}

.test-area-placeholder {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 2px dashed var(--primary-border);
  padding: 32px 20px;
  text-align: center;
  margin-top: 24px;
}

.test-area-placeholder p {
  font-size: 0.9375rem;
  color: var(--text-sub);
  margin-top: 8px;
}

/* --- Name match placeholder --- */
.coming-soon-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 48px 20px;
  text-align: center;
}

.coming-soon-emoji {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.coming-soon-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.coming-soon-desc {
  font-size: 0.9375rem;
  color: var(--text-sub);
  line-height: 1.65;
}

/* --- Desktop adjustments --- */
@media (min-width: 540px) {
  .main-content {
    padding: 32px 0 56px;
  }

  .landing-hero {
    padding: 40px 32px 32px;
  }

  .landing-title {
    font-size: 1.75rem;
  }

  .card-body {
    padding: 28px 24px;
  }

  .page-hero {
    padding: 44px 32px 40px;
    border-radius: 0 0 32px 32px;
  }

  .page-hero-title {
    font-size: 2rem;
  }

  .result-placeholder,
  .prose-page {
    padding: 40px 32px;
  }
}

/* --- Result page --- */
.result-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #9333EA 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 32px 20px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.result-hero-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
  line-height: 1;
}

.result-hero-label {
  font-size: 0.8125rem;
  opacity: 0.85;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.result-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.result-hero-subtitle {
  font-size: 0.9375rem;
  opacity: 0.9;
  margin-bottom: 14px;
  font-weight: 500;
}

.result-hero-summary {
  font-size: 0.9375rem;
  line-height: 1.65;
  opacity: 0.92;
  max-width: 360px;
  margin: 0 auto;
}

@media (min-width: 540px) {
  .result-hero {
    padding: 40px 32px 36px;
  }

  .result-hero-title {
    font-size: 2rem;
  }
}

/* --- Traits list --- */
.result-traits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-trait {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
}

.trait-dot {
  flex-shrink: 0;
  color: var(--primary);
  font-size: 0.5rem;
  margin-top: 6px;
}

/* --- Friend image --- */
.result-friend-image {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-sub);
  border-left: 3px solid var(--primary-border);
  padding-left: 14px;
  margin: 0;
  font-style: italic;
}

/* --- Free insight --- */
.result-free-insight p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.result-free-insight p:last-child {
  margin-bottom: 0;
}

/* --- Share section --- */
.result-share-section {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.result-share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.share-btn:active {
  transform: scale(0.97);
}

.share-btn--kakao {
  background: #FEE500;
  border-color: #FEE500;
  color: #3A1D1D;
}

.share-btn--twitter {
  background: #000;
  border-color: #000;
  color: #fff;
}

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

.share-btn--save {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-sub);
}

/* --- Upsell --- */
.result-upsell {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
  border: 1.5px solid var(--primary-border);
}

@media (min-width: 540px) {
  .result-upsell {
    padding: 28px 24px;
  }
}

.premium-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.premium-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text);
  padding: 6px 0;
}


.premium-item-icon {
  flex-shrink: 0;
  font-size: 0.875rem;
  width: 20px;
  text-align: center;
}

.upsell-teaser {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.upsell-teaser p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
}

.upsell-cta {
  letter-spacing: 0.01em;
}

.upsell-sub {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* --- Other tests --- */
.other-tests-section {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.other-test-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}

.other-test-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.other-test-card:first-child {
  padding-top: 0;
}

.other-test-card:hover:not(.other-test-card--coming) {
  color: var(--primary);
}

.other-test-card--coming {
  opacity: 0.5;
  cursor: default;
}

.other-test-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.other-test-info {
  flex: 1;
  min-width: 0;
}

.other-test-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.3;
}

.other-test-desc {
  font-size: 0.8125rem;
  color: var(--text-sub);
  line-height: 1.4;
}

.other-test-arrow {
  font-size: 1rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.other-test-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-light);
  background: var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}

/* --- Result actions --- */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 8px;
}

/* --- Share grid mobile (≤359px) --- */
@media (max-width: 359px) {
  .result-share-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Result disclaimer --- */
.result-disclaimer {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.6;
  margin-top: 20px;
  padding: 0 8px 16px;
}

/* --- Test question UI --- */
.test-area-active {
  margin-top: 24px;
}

.q-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.q-num {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.03em;
}

.q-restart-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.q-restart-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border);
}

.q-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--primary-border);
  border-radius: 999px;
  overflow: hidden;
}

.q-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #9333EA 100%);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.q-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
}

.q-text {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 20px;
  letter-spacing: -0.2px;
}

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

.q-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.q-option:active {
  transform: scale(0.98);
}

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

.q-option:disabled {
  cursor: default;
  opacity: 0.5;
}

.q-option--selected {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(124,58,237,0.15);
}

.q-option-label {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
}

.q-option--selected .q-option-label {
  background: var(--primary);
}

.q-option:disabled:not(.q-option--selected) .q-option-label {
  background: var(--border);
}

.q-option-text {
  flex: 1;
}

@media (min-width: 540px) {
  .q-card {
    padding: 28px 24px;
  }

  .q-text {
    font-size: 1.125rem;
  }

  .q-option {
    min-height: 60px;
    padding: 16px 20px;
  }
}

/* --- Upsell card list --- */
.upsell-section-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.upsell-intro {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

.upsell-item-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upsell-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.upsell-item-icon {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 2px;
  line-height: 1;
  opacity: 0.85;
}

.upsell-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.4;
}

.upsell-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

/* --- Utility --- */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
