/* ============================================================
   WHMIS Training — Lullaboo  |  Professional Redesign v3
   ============================================================ */

/* ── Full Reset ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html { height: 100%; }
body {
    font-family: 'Poppins', sans-serif;
    background: #F0E8F8;
    background-image:
        radial-gradient(ellipse at 15% 0%,   rgba(150, 61, 151, 0.13) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(107, 31, 122, 0.10) 0%, transparent 55%);
    color: #1A1A2E;
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
}

/* ── Top Navigation Bar ─────────────────────────────────── */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    height: 58px;
    padding: 0 1.5rem;
    background: linear-gradient(135deg, #6B1F7A 0%, #963d97 100%);
    box-shadow: 0 2px 16px rgba(107, 31, 122, 0.35);
}

.nav-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.nav-brand {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.2px;
}

/* ── Main Container ─────────────────────────────────────── */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 5rem;
}

/* ── Hero Header ────────────────────────────────────────── */
.headLine {
    text-align: center;
    width: 100%;
    margin-bottom: 2rem;
}

#title {
    font-size: clamp(2rem, 5.5vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, #5A1868 0%, #C155C9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 0.6rem;
}

#subtitle {
    font-size: clamp(0.88rem, 2vw, 1.05rem);
    font-weight: 400;
    color: #7A6885;
    line-height: 1.6;
}

/* ── Step Badges (decorative, CSS only) ─────────────────── */
.headLine::after {
    content: 'Step 1: Watch  ·  Step 2: Quiz  ·  Step 3: Certify';
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6B1F7A, #963d97);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-top: 1.1rem;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    opacity: 0.85;
}

/* ── Progress Bar ───────────────────────────────────────── */
#progressBarTotal {
    width: 100%;
    height: 2.6rem;
    background: #D8C8E8;
    border-radius: 50px;
    overflow: hidden;
    border: none;
    visibility: hidden;
    margin-bottom: 1.75rem;
}

#progressBar {
    height: 100%;
    background: linear-gradient(90deg, #6B1F7A, #C155C9);
    border-radius: 50px;
    transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 3.5rem;
    color: white;
}

#progressText {
    padding-right: 0.7rem;
    display: flex;
    align-items: center;
}

#total-percentage {
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

#percentage { font-size: 0.7rem; }

/* ── Video ──────────────────────────────────────────────── */
.videoWrp {
    width: 100%;
    margin-bottom: 1.5rem;
}

.video { width: 100%; }

#videoPlayer {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    border: none;
    display: block;
    box-shadow: 0 6px 36px rgba(107, 31, 122, 0.18);
}

/* ── Question Card ──────────────────────────────────────── */
#quetions {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

.question-section {
    background: #FFFFFF;
    border-radius: 20px;
    border: 1.5px solid #E4D5F0;
    border-top: 4px solid #963d97;
    padding: 2rem 1.75rem 1.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    height: auto;
}

.question {
    font-size: clamp(0.95rem, 2.2vw, 1.08rem);
    font-weight: 600;
    color: #1A1A2E;
    line-height: 1.7;
}

.number {
    color: #6B1F7A;
    font-weight: 800;
}

/* ── Answer Options ─────────────────────────────────────── */
.answers {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: auto;
}

.answer {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: #F9F5FD;
    border: 1.5px solid #E4D5F0;
    border-radius: 12px;
    padding: 0.8rem 1.1rem;
    cursor: pointer;
    font-size: clamp(0.85rem, 1.8vw, 0.97rem);
    color: #1A1A2E;
    line-height: 1.45;
    margin: 0;
    height: auto;
    transition: background 0.15s ease,
                border-color 0.15s ease,
                transform 0.15s ease,
                box-shadow 0.15s ease;
}

.answer:hover {
    background: #F0E5FA;
    border-color: #963d97;
    transform: translateX(6px);
    box-shadow: 0 2px 12px rgba(150, 61, 151, 0.1);
}

.letter {
    min-width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6B1F7A, #963d97);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(107, 31, 122, 0.3);
}

.letter span { line-height: 1; }

/* ── Incorrect Feedback ─────────────────────────────────── */
.incorrect {
    background: #FEF2F2;
    border-left: 3px solid #EF4444;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    color: #B91C1C;
    font-size: 0.82rem;
    font-weight: 500;
    margin: 0;
    text-align: left;
}

#incorrect1, #incorrect2, #incorrect3, #incorrect4,
#incorrect5, #incorrect6, #incorrect7, #incorrect8,
#incorrect9, #incorrect10 { margin: 0; }

/* ── Quiz Images ────────────────────────────────────────── */
.quiz-image {
    width: 90px;
    border-radius: 8px;
    margin: 0.25rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@media (min-width: 600px) { .quiz-image { width: 115px; } }

/* ── Hidden radio inputs ────────────────────────────────── */
input[type="radio"] { display: none; }
input { display: none; }
.form-response { display: block; }
li { list-style: none; }

/* ── Completion Form ────────────────────────────────────── */
#quizInfo {
    width: 100%;
    background: white;
    border-radius: 20px;
    border: 1.5px solid #E4D5F0;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    margin-bottom: 1rem;
}

.form-banner {
    background: linear-gradient(135deg, #6B1F7A, #B040BA);
    color: white;
    padding: 1rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
}

.quiz-form-inner {
    padding: 1.75rem 2rem 2rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4A4560;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.5rem;
}

.form-response {
    display: block;
    width: 100%;
    padding: 0.875rem 1.1rem;
    border: 1.5px solid #DDD0EA;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #1A1A2E;
    background: #F9F5FD;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-response:focus {
    border-color: #6B1F7A;
    background: white;
    box-shadow: 0 0 0 3px rgba(107, 31, 122, 0.12);
}

#form-control-email { margin-bottom: 0; }
#star { color: #6B1F7A; }

.error p {
    color: #B91C1C;
    font-size: 0.78rem;
    margin-top: 0.3rem;
}

/* ── Certificate ────────────────────────────────────────── */
#cert {
    width: 100%;
    text-align: center;
    padding: 1rem 0;
}

#cert::before {
    content: '🏆  Congratulations — You passed!';
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #1B7A4A, #26A869);
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.2px;
}

#certPic {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

#myCanvas {
    width: min(80%, 500px);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.13);
}

#headLine-success {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    color: #6B1F7A;
    margin-bottom: 0.5rem;
}

#subtitle-success {
    font-size: 0.9rem;
    color: #7A6885;
    line-height: 1.65;
}

/* ── Button Area ────────────────────────────────────────── */
.button-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    height: auto;
    margin-top: 0.5rem;
}

.button {
    display: flex;
    justify-content: center;
}

@keyframes shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.quiz-manage-button {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.9rem 2.75rem;
    background: linear-gradient(135deg, #6B1F7A 0%, #C155C9 50%, #6B1F7A 100%);
    background-size: 200% auto;
    animation: shimmer 4s linear infinite;
    color: white;
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(107, 31, 122, 0.35);
    transition: background 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease,
                transform 0.2s ease;
    white-space: nowrap;
    display: inline-block;
    letter-spacing: 0.2px;
}

.quiz-manage-button:hover {
    animation: none;
    background: white;
    color: #6B1F7A;
    border-color: #6B1F7A;
    box-shadow: 0 6px 24px rgba(107, 31, 122, 0.15);
    transform: translateY(-2px);
}

#submitFieldButton { margin: 0; }

/* ── Transitions ────────────────────────────────────────── */
.fade-transition { transition: opacity 0.3s ease; }

/* ── Mobile tweaks ──────────────────────────────────────── */
@media (max-width: 600px) {
    .container { padding: 1.5rem 1rem 4rem; }
    .question-section { padding: 1.25rem 1rem 1.25rem; }
    #quizInfo .quiz-form-inner { padding: 1.25rem; }
    .quiz-manage-button { padding: 0.85rem 2rem; }
    .top-bar { height: 50px; }
    .nav-brand { font-size: 0.85rem; }
}
