 :root {
      --gold: #C9A84C;
      --gold-light: #F0D080;
      --gold-dark: #8B6914;
      --emerald: #1A6B4A;
      --emerald-light: #2E9B6E;
      --emerald-dark: #0D3D29;
      --cream: #FAF6EE;
      --ink: #1A1209;
      --red-correct: #1A6B4A;
      --red-wrong: #9B2335;
      --surface: #FFFDF7;
      --border: #E8DDB5;
      --shadow: rgba(26,18,9,0.18);
    }

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

    body {
      font-family: 'DM Sans', sans-serif;
      background: var(--cream);
      color: var(--ink);
      min-height: 100vh;
      background-image:
        radial-gradient(ellipse at 10% 10%, rgba(201,168,76,0.13) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 90%, rgba(26,107,74,0.10) 0%, transparent 55%);
    }

    /* ── Header ── */
    .site-header {
      background: linear-gradient(135deg, var(--emerald-dark) 0%, var(--emerald) 60%, var(--emerald-dark) 100%);
      color: var(--gold-light);
      text-align: center;
      padding: 28px 20px 22px;
      position: relative;
      overflow: hidden;
      border-bottom: 4px solid var(--gold);
    }
    .site-header::before {
      content: '';
      position: absolute; inset: 0;
      background: repeating-linear-gradient(
        45deg, transparent, transparent 18px,
        rgba(201,168,76,0.07) 18px, rgba(201,168,76,0.07) 19px
      );
    }
    .site-header h1 {
      font-family: 'Playfair Display', serif;
      font-size: clamp(1.2rem, 3vw, 1.8rem);
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      position: relative;
      color:#F0D080;
    }
    .site-header h2 {
      font-family: 'DM Sans', sans-serif;
      font-size: clamp(0.85rem, 2vw, 1.1rem);
      font-weight: 500;
      opacity: 0.85;
      margin-top: 6px;
      position: relative;
      letter-spacing: 0.12em;
      color:#F0D080;
    }
    .header-divider {
      display: flex; align-items: center; justify-content: center; gap: 10px;
      margin: 10px auto 0; max-width: 400px; position: relative;
    }
    .header-divider-line { flex: 1; height: 1px; background: var(--gold); opacity: 0.6; }
    .header-divider-gem { color: var(--gold); font-size: 12px; }

    /* ── Main container ── */
    .main-wrap {
      max-width: 760px;
      margin: 32px auto 60px;
      padding: 0 16px;
    }

    /* ── Card ── */
    .card {
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 18px;
      box-shadow: 0 8px 40px var(--shadow);
      overflow: hidden;
    }

    /* ── Registration ── */
    .reg-section {
      padding: 36px 40px 32px;
    }
    .reg-section h3 {
      font-family: 'Playfair Display', serif;
      font-size: 1.3rem;
      color: var(--emerald);
      margin-bottom: 24px;
      display: flex; align-items: center; gap: 10px;
    }
    .reg-section h3::after {
      content: ''; flex: 1; height: 1px;
      background: linear-gradient(90deg, var(--gold), transparent);
    }
    .form-field { margin-bottom: 20px; }
    .form-field label {
      display: block;
      font-size: 0.82rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--emerald-dark);
      margin-bottom: 7px;
    }
    .form-field input,
    .form-field select {
      width: 100%;
      padding: 12px 16px;
      font-family: 'DM Sans', sans-serif;
      font-size: 1rem;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      background: var(--cream);
      color: var(--ink);
      transition: border-color 0.2s, box-shadow 0.2s;
      outline: none;
    }
    .form-field input:focus,
    .form-field select:focus {
      border-color: var(--gold);
      box-shadow: 0 0 0 3px rgba(201,168,76,0.2);
    }
    .form-field select { cursor: pointer; }

    .prepared-tag {
      font-size: 0.82rem;
      color: var(--red-wrong);
      font-weight: 700;
      text-align: center;
      padding: 14px;
      background: rgba(155,35,53,0.06);
      border-radius: 12px; /* Increased corner rounding */
      margin: 16px 0 28px 0; /* Added margins */
      letter-spacing: 0.04em;
      line-height: 1.5;
      border: 1px dashed rgba(155,35,53,0.3);
    }

    /* ── Buttons ── */
    .btn {
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      padding: 14px 32px;
      font-family: 'DM Sans', sans-serif;
      font-size: 1rem;
      font-weight: 700;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.22s;
      letter-spacing: 0.04em;
    }
    .btn-primary {
      background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dark) 100%);
      color: var(--gold-light);
      box-shadow: 0 4px 18px rgba(26,107,74,0.35);
      width: 100%;
      font-size: 1.08rem;
    }
    .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,107,74,0.4); }
    .btn-gold {
      background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
      color: #fff;
      box-shadow: 0 4px 14px rgba(201,168,76,0.4);
    }
    .btn-gold:hover { transform: translateY(-2px); }
    .btn-outline {
      background: transparent;
      border: 2px solid var(--border);
      color: var(--ink);
    }
    .btn-outline:hover { border-color: var(--gold); color: var(--gold-dark); }
    .btn-danger {
      background: var(--red-wrong);
      color: #fff;
    }
    .btn-danger:hover { opacity: 0.88; }

    /* ── Quiz area ── */
    #quizArea { display: none; }

    /* ── Progress bar ── */
    .progress-wrap {
      padding: 20px 40px 0;
    }
    .progress-track {
      background: var(--border);
      border-radius: 100px;
      height: 8px;
      overflow: hidden;
    }
    .progress-fill {
      height: 100%;
      border-radius: 100px;
      background: linear-gradient(90deg, var(--emerald) 0%, var(--gold) 100%);
      transition: width 0.4s cubic-bezier(.4,0,.2,1);
      width: 0%;
    }
    .progress-labels {
      display: flex; justify-content: space-between;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--emerald);
      margin-top: 6px;
    }

    /* ── Slide viewport ── */
    .slide-viewport {
      padding: 28px 40px 10px;
    }
    /* Modified track and slide to make the container naturally adjust to question height */
    .slide-track {
      position: relative; 
    }
    .slide {
      position: absolute;
      top: 0; left: 0; width: 100%;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }
    .slide.active-slide {
      position: relative;
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    @keyframes shake {
      0% { transform: translateX(0); }
      25% { transform: translateX(-8px); }
      50% { transform: translateX(8px); }
      75% { transform: translateX(-4px); }
      100% { transform: translateX(0); }
    }

    /* ── Question card ── */
    .q-number {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      color: var(--gold-dark);
      margin-bottom: 10px;
    }
    .q-text {
      font-size: 1.05rem;
      font-weight: 600;
      line-height: 1.65;
      color: var(--ink);
      margin-bottom: 6px;
    }
    .q-text-ta {
      font-size: 0.95rem;
      color: #555;
      font-weight: 400;
      line-height: 1.7;
      margin-bottom: 18px;
      padding-left: 14px;
      border-left: 3px solid var(--gold);
    }

    /* ── Option buttons ── */
    .options-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
    .opt-btn {
      display: flex; align-items: flex-start; gap: 14px;
      padding: 13px 18px;
      background: var(--cream);
      border: 2px solid var(--border);
      border-radius: 10px;
      cursor: pointer;
      text-align: left;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.97rem;
      font-weight: 500;
      color: var(--ink);
      transition: all 0.18s;
      line-height: 1.5;
    }
    .opt-btn:hover:not(:disabled) {
      border-color: var(--gold);
      background: rgba(201,168,76,0.08);
    }
    .opt-btn.selected {
      border-color: var(--emerald);
      background: rgba(26,107,74,0.09);
    }
    .opt-badge {
      min-width: 28px; height: 28px;
      border-radius: 50%;
      background: var(--border);
      display: flex; align-items: center; justify-content: center;
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--ink);
      flex-shrink: 0;
      margin-top: 1px;
      transition: background 0.18s, color 0.18s;
    }
    .opt-btn.selected .opt-badge {
      background: var(--emerald);
      color: #fff;
    }

    /* ── Slide nav ── */
    .slide-nav {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 40px 24px;
      gap: 12px;
      width:90%;
    }
    .remaining-hint {
      font-size: 1.6rem;
      font-weight: 900;
      color: var(--border);
      letter-spacing: -0.02em;
      font-family: 'Playfair Display', serif;
      transition: color 0.3s;
      text-align: center;
      flex: 1;
    }
    #submitBtn {
      display: none;
      width: 100%;
      margin: 0 40px 28px;
      max-width: calc(100% - 80px);
    }

    /* ── Review section ── */
    #reviewSection { display: none; padding: 0 40px 36px; }
    .score-banner {
      text-align: center;
      padding: 28px;
      background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
      border-radius: 14px;
      color: var(--gold-light);
      margin-bottom: 28px;
    }
    .score-banner .score-num {
      font-family: 'Playfair Display', serif;
      font-size: 4.5rem; /* Increased score size */
      font-weight: 900;
      line-height: 1;
    }
    .score-banner .score-label {
      font-size: 0.9rem;
      opacity: 0.8;
      margin-top: 4px;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }
    .score-banner .score-pct {
      font-size: 1.2rem;
      font-weight: 700;
      margin-top: 6px;
      color: var(--gold-light);
    }

    .review-item {
      margin-bottom: 20px;
      border-radius: 12px;
      overflow: hidden;
      border: 1.5px solid var(--border);
    }
    .review-item-header {
      padding: 14px 18px 10px;
      font-weight: 700;
      font-size: 0.95rem;
      line-height: 1.55;
    }
    .review-item-header .q-ta {
      font-size: 0.85rem;
      font-weight: 400;
      color: #666;
      margin-top: 4px;
      padding-left: 10px;
      border-left: 2px solid var(--gold);
    }
    .review-item.correct .review-item-header { background: rgba(26,107,74,0.08); }
    .review-item.wrong .review-item-header { background: rgba(155,35,53,0.07); }

    .review-options { padding: 8px 18px 14px; }
    .review-opt {
      display: flex; align-items: flex-start; gap: 12px;
      padding: 9px 14px;
      border-radius: 8px;
      margin-bottom: 6px;
      font-size: 0.93rem;
      line-height: 1.5;
    }
    .review-opt.opt-correct { background: rgba(26,107,74,0.13); color: var(--emerald-dark); font-weight: 600; }
    .review-opt.opt-wrong-pick { background: rgba(155,35,53,0.12); color: var(--red-wrong); font-weight: 600; }
    .review-opt .opt-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }

    .verdict-badge {
      display: inline-block;
      padding: 3px 12px;
      border-radius: 100px;
      font-size: 0.75rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      float: right;
    }
    .verdict-correct { background: var(--emerald); color: #fff; }
    .verdict-wrong { background: var(--red-wrong); color: #fff; }

    .retry-row {
      display: flex; gap: 12px; flex-wrap: wrap;
      margin-top: 24px;
    }
    .retry-row .btn { flex: 1; min-width: 140px; }

        /* Certificate Styles */
        #certificateModal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: white;
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        #certificate {

  width: 800px;

  max-width: 100%;

  aspect-ratio: 4 / 3; /* Keeps the certificate perfectly proportional */

  height: auto; 

  background: white;

  border-radius: 10px;

  text-align: center;

  position: relative;

  overflow: hidden;

  box-shadow: 0 0 60px rgba(0,0,0,0.6);

}


        .cert-inner {
            position: relative;
            z-index: 1;
            padding: 28px 90px 20px 90px;
          margin-top: 60px;
        }

        .cert-top-bar {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 6px;
            z-index: 2;
          margin-bottom:60px;
        }

        .cert-bottom-bar {
            position: absolute;
            bottom: 0; left: 0;
            width: 100%; height: 6px;
            z-index: 2;
        }

        .cert-divider {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin: 8px auto;
        }

        .cert-divider-line {
            height: 2px;
            width: 120px;
            background: linear-gradient(90deg, transparent, #2E7D32);
        }

        .cert-divider-line.right {
            background: linear-gradient(90deg, #2E7D32, transparent);
        }

        .cert-divider-star {
            color: #2E7D32;
            font-size: 18px;
            line-height: 0.5;
        }

        .cert-title {
            font-family: 'Cinzel Decorative', serif;
            font-size: 60px;
            color: #1A237E;
            letter-spacing: 0.3px;
            line-height: 1.4;
            margin: 30px 0 4px;
             margin-bottom: 10px;
          margin-top:100px;
            text-shadow: none;
             font-weight:900;
        }

        .cert-subtitle {
            font-family: 'Bodoni Moda', serif;
            font-size: 20px;
            color: #388E3C;
            font-style: italic;
            font-weight: 400;
            margin: 4px 0;
        }

        .cert-name {
            font-family: 'Cinzel', serif;
            font-size: 36px;
             text-transform: capitalize;
            color: #997B30;
            line-height: 0.8;
            margin: 6px 0;
            font-weight: 400;
        }

        .cert-text {
            font-family: 'Bodoni Moda', serif;
            font-size: 20px;
            color: #006064;
            margin: 8px 0;
            line-height: 1.5;
        }

        .cert-footer {
            font-family: 'Bodoni Moda', serif;
            margin-top: 10px;
            font-size: 18px;
            color: #002121;
            font-weight:600;
          line-height:24px;
        }

     /* .seal {
            position: absolute;
            bottom: 44px;
            right: 60px;
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: radial-gradient(circle, #66BB6A, #2E7D32);
            border: 4px solid #1B5E20;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Cinzel Decorative', serif;
            font-size: 12px;
            font-weight: bold;
            color: #fff;
            z-index: 3;
            box-shadow: 0 0 0 3px #A5D6A7;
             margin-bottom:20px;
        } */

        .download-btn {
            margin: 20px;
            background: #28a745;
          
        }

        .download-btn:hover {
            background: #218838;
        }

        .close-btn {
            margin: 20px;
            background: #dc3545;
        }

        .close-btn:hover {
            background: #c82333;
        }

    /* ── Footer marquee ── */
    .site-footer {
      text-align: center;
      padding: 24px 16px 16px;
      font-size: 0.82rem;
      color: var(--emerald-dark);
    }
    .marquee-wrap {
      background: var(--emerald-dark);
      color: var(--gold-light);
      padding: 8px 0;
      font-size: 0.85rem;
      font-weight: 600;
      letter-spacing: 0.04em;
      margin-bottom: 16px;
    }

    /* ── More tests btn ── */
    .more-tests-btn {
      display: block;
      width: 100%;
      max-width: 340px;
      margin: 12px auto 0;
      padding: 13px;
      background: var(--ink);
      color: var(--gold-light);
      font-family: 'DM Sans', sans-serif;
      font-weight: 700;
      font-size: 0.95rem;
      letter-spacing: 0.06em;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      text-align: center;
      text-decoration: none;
    }

    @media (max-width: 560px) {
      .reg-section, .progress-wrap, .slide-viewport, .slide-nav, #reviewSection { padding-left: 18px; padding-right: 18px; }
      #submitBtn { margin-left: 18px; margin-right: 18px; max-width: calc(100% - 36px); }
      #certificate { height: auto; min-height: 500px; }
      .cert-inner { padding: 20px 30px; }
      .cert-title { font-size: 20px; }
      .cert-name { font-size: 24px; }
    }
