/* ============================================================
   assets/css/style.css — Quiz App Global Styles
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --primary:       #6c63ff;
  --primary-dark:  #5548d9;
  --primary-light: #ede9ff;
  --accent:        #48c6ef;
  --accent2:       #f093fb;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --dark:          #0f0f1a;
  --surface:       #ffffff;
  --surface-2:     #f8f7ff;
  --border:        #e8e5ff;
  --text-main:     #1e1b3a;
  --text-muted:    #6b7280;
  --text-light:    #9ca3af;
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     22px;
  --radius-xl:     32px;
  --shadow-sm:     0 1px 4px rgba(108, 99, 255, .08);
  --shadow-md:     0 4px 24px rgba(108, 99, 255, .12);
  --shadow-lg:     0 12px 48px rgba(108, 99, 255, .18);
  --transition:    .25s cubic-bezier(.4, 0, .2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f0eeff 0%, #e8f4fd 50%, #fdf4ff 100%);
  min-height: 100vh;
  color: var(--text-main);
  line-height: 1.6;
}

/* ── Animated background blobs ── */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
  animation: blob-float 12s ease-in-out infinite alternate;
}
body::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6c63ff, #48c6ef);
  top: -150px; left: -150px;
}
body::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #f093fb, #f5576c);
  bottom: -120px; right: -100px;
  animation-delay: -6s;
}
@keyframes blob-float {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.1) translate(30px, 30px); }
}

/* ── Wrapper ── */
.quiz-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 64px;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 760px;
  overflow: hidden;
  animation: card-in .5s cubic-bezier(.22, 1, .36, 1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Card Header ── */
.card-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 40px 48px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.card-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.card-header .icon-badge {
  width: 72px; height: 72px;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  position: relative;
  animation: badge-pop .6s cubic-bezier(.22,1,.36,1) .2s both;
}
@keyframes badge-pop {
  from { opacity:0; transform:scale(.6) rotate(-15deg); }
  to   { opacity:1; transform:scale(1) rotate(0); }
}
.card-header h1, .card-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #fff;
  font-weight: 800;
  margin-bottom: 8px;
}
.card-header h1 { font-size: clamp(22px, 4vw, 30px); }
.card-header h2 { font-size: clamp(18px, 3.5vw, 24px); }
.card-header p  {
  color: rgba(255,255,255,.82);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Card Body ── */
.card-body { padding: 40px 48px; }
@media (max-width: 600px) {
  .card-header { padding: 32px 24px; }
  .card-body   { padding: 28px 20px; }
}

/* ── Progress Bar ── */
.progress-bar-wrap {
  width: 100%; max-width: 760px;
  margin-bottom: 28px;
}
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px; left: 50%;
  width: 100%; height: 3px;
  background: var(--border);
  z-index: 0;
}
.step-item.done:not(:last-child)::after,
.step-item.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.step-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #e9e5ff;
  border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  position: relative; z-index: 1;
  transition: var(--transition);
}
.step-item.active .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(108,99,255,.2);
}
.step-item.done .step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-light);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}
.step-item.active .step-label { color: var(--primary); }
.step-item.done  .step-label  { color: var(--success);  }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  border: none; cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,.12);
  opacity: 0;
  transition: var(--transition);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(108,99,255,.4); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-lg { font-size: 17px; padding: 16px 40px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

/* ── Form Styles ── */
.form-group { margin-bottom: 22px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(108,99,255,.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control.is-invalid {
  border-color: var(--danger);
  background: #fff5f5;
}
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}
textarea.form-control { resize: vertical; min-height: 130px; line-height: 1.6; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Quiz Question Card ── */
.question-card {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin-bottom: 24px;
  transition: var(--transition);
  animation: q-slide .4s cubic-bezier(.22,1,.36,1) both;
}
.question-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
@keyframes q-slide {
  from { opacity:0; transform:translateX(-20px); }
  to   { opacity:1; transform:translateX(0); }
}
.question-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 13px; font-weight: 700;
  border-radius: 50%;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.question-text {
  font-size: 15px; font-weight: 600; line-height: 1.55;
  color: var(--text-main);
  margin-bottom: 18px;
}

/* ── Radio Options ── */
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  position: relative;
}
.option-item input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.option-label {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  color: var(--text-main);
}
.option-label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.option-item input[type="radio"]:checked + .option-label {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}
.option-key {
  width: 28px; height: 28px;
  background: var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}
.option-item input[type="radio"]:checked + .option-label .option-key {
  background: var(--primary);
  color: #fff;
}

/* ── Section divider badge ── */
.section-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px; font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 28px;
}

/* ── Intro Page ── */
.intro-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 28px 0 36px;
}
.feature-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: var(--transition);
}
.feature-chip:hover { border-color: var(--primary); transform: translateY(-2px); }
.feature-chip .chip-icon { font-size: 24px; flex-shrink: 0; }
.feature-chip .chip-text { font-size: 13px; font-weight: 600; color: var(--text-main); }
.feature-chip .chip-sub  { font-size: 12px; color: var(--text-muted); }

/* ── Alert / Validation ── */
.alert {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: card-in .3s ease;
}
.alert-danger { background: #fff0f0; border: 1.5px solid #fca5a5; color: #b91c1c; }
.alert-success{ background: #f0fdf4; border: 1.5px solid #86efac; color: #166534; }

/* ── Thank You Page ── */
.thank-you-icon {
  font-size: 80px;
  display: block;
  text-align: center;
  margin-bottom: 20px;
  animation: pop-in .6s cubic-bezier(.22,1,.36,1);
}
@keyframes pop-in {
  0%  { transform: scale(0) rotate(-180deg); opacity:0; }
  80% { transform: scale(1.15) rotate(5deg); }
  100%{ transform: scale(1) rotate(0); opacity:1; }
}
.thank-you-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 30px; font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.thank-you-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto 32px;
}
.info-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 28px;
}
.info-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 13px; color: var(--text-muted); width: 130px; flex-shrink: 0; }
.info-value { font-size: 14px; font-weight: 600; color: var(--text-main); }

/* ── Navigation Buttons ── */
.nav-buttons {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 36px;
  gap: 12px;
}
.nav-buttons .btn { min-width: 160px; }

/* ── Loading overlay ── */
.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,15,26,.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  color: #fff;
  font-size: 16px; font-weight: 600;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 52px; height: 52px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 480px) {
  .nav-buttons { flex-direction: column-reverse; }
  .nav-buttons .btn { width: 100%; }
  .step-label { display: none; }
}
