@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Modern Futuristic Glassmorphism for MBTI Personality Test */
  --bg-color: #0b1322;
  --bg-secondary: #0f1c30;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-hover-border: rgba(99, 102, 241, 0.45);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --accent-purple: #8b5cf6;
  --accent-purple-hover: #7c3aed;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --glass-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.65), 0 0 25px rgba(99, 102, 241, 0.1);
  --btn-shadow: 0 4px 18px 0 rgba(99, 102, 241, 0.35);
  --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(15, 28, 48, 0.65) 0%, transparent 100%);
  background-attachment: fixed;
  padding: 1.5rem;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Glassmorphism Card */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.8), rgba(139, 92, 246, 0.8), transparent);
}

.card:hover {
  border-color: var(--card-hover-border);
}

/* Header & Typography */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

h1 {
  font-size: 2.2rem;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #ffffff 40%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Badge Pill */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Instructions Box */
.instructions-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  text-align: left;
}

.instructions-box h3 {
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.instructions-box ul {
  list-style: none;
  padding: 0;
}

.instructions-box li {
  color: #cbd5e1;
  font-size: 0.98rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.6;
}

.instructions-box li svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: #818cf8;
}

.instructions-box p.important {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  color: #f1f5f9;
  font-size: 0.95rem;
}

/* Action Buttons */
.actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary, .btn-purple {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  box-shadow: var(--btn-shadow);
}

.btn-primary:hover, .btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px 0 rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--accent-purple-hover) 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.9);
}

/* Test Area */
.progress-container {
  margin-bottom: 1.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

/* Mandatory Instruction Banner (Prompt 3.3) */
.instruction-banner {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #c7d2fe;
  text-align: center;
  letter-spacing: 0.01em;
}

.question-text {
  font-size: 1.45rem;
  line-height: 1.5;
  color: #ffffff;
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 600;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Options Grid for 2 Choices (A and B) */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  outline: none;
}

.option-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.option-btn:active {
  transform: translateY(0);
}

.option-btn-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.option-btn:hover .option-letter {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.option-arrow {
  color: var(--text-subtle);
  font-size: 1.25rem;
  transition: var(--transition);
}

.option-btn:hover .option-arrow {
  color: #a5b4fc;
  transform: translateX(4px);
}

/* User Details Card in Reports */
.user-details-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  text-align: left;
}

.user-field-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.user-field-val {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

/* MBTI Result Badges & Profiles */
.mbti-type-hero {
  text-align: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.mbti-code-display {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #a5b4fc 0%, #ffffff 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.mbti-role-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.mbti-short-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* MBTI Dichotomy Breakdown Bars */
.dichotomy-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.dichotomy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.dichotomy-label-left {
  color: #818cf8;
}

.dichotomy-label-right {
  color: #c084fc;
}

.dichotomy-bar-wrapper {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}

.dichotomy-bar-left {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transition: width 0.6s ease;
}

.dichotomy-bar-right {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #c084fc);
  transition: width 0.6s ease;
}

/* Sections for Strength, Weakness, Advice */
.interpretation-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.interpretation-card h3 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #f1f5f9;
}

.interpretation-item {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: #cbd5e1;
  font-size: 0.98rem;
}

.interpretation-item strong {
  color: #ffffff;
  font-weight: 600;
}

.interpretation-item:last-child {
  margin-bottom: 0;
}

/* Clinical Table in Raport2 */
.clinical-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  margin-bottom: 1.5rem;
}

.clinical-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.clinical-table th {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--card-border);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.clinical-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.clinical-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.clinical-table tr:last-child td {
  border-bottom: none;
}

/* Disclaimer Box */
.disclaimer-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.disclaimer-box p {
  color: #fcd34d;
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.6;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

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

.hidden {
  display: none !important;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0;
  }

  .container {
    max-width: 100%;
    margin: 0;
  }

  .card {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .card::before {
    display: none !important;
  }

  .actions, .badge-pill, #btnDownloadPdf {
    display: none !important;
  }

  h1, h2, h3, h4, h5, .user-field-val, .mbti-role-title {
    color: #0f172a !important;
    -webkit-text-fill-color: initial !important;
  }

  .mbti-code-display {
    color: #4338ca !important;
    -webkit-text-fill-color: initial !important;
  }

  .mbti-type-hero, .user-details-card, .interpretation-card, .dichotomy-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
  }

  .interpretation-item, p, td {
    color: #334155 !important;
  }

  .clinical-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }

  .clinical-table td {
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .disclaimer-box {
    background: #fffbeb !important;
    border: 1px solid #fef3c7 !important;
  }

  .disclaimer-box p {
    color: #92400e !important;
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .card {
    padding: 1.5rem;
    border-radius: 18px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .question-text {
    font-size: 1.2rem;
  }

  .mbti-code-display {
    font-size: 2.75rem;
  }
}
