/**
 * AvinQuiz Pro - Frontend Styles
 * Version: 1.3.0
 * Theme: Professional Blue
 * Strategy: Mobile-first. Full-width inputs. No wasted space.
 *
 * Palette:
 * --aq-primary:   #1a56db
 * --aq-primary-d: #1e429f
 * --aq-accent:    #3f83f8
 * --aq-navy:      #1e3a5f
 * --aq-sky:       #e8f0fe
 * --aq-border:    #c3d9f5
 * --aq-muted:     #6b8db5
 */

/* ============================================
   BASE / RESET
   ============================================ */

.aq-quiz *,
.aq-quiz *::before,
.aq-quiz *::after {
    box-sizing: border-box;
}

/* ============================================
   QUIZ CONTAINER
   ============================================ */

.aq-quiz {
    width: 100%;
    max-width: 860px;
    margin: 8px auto;
    padding: 0;          /* zero — theme already has page padding */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    color: #334155;
}

/* ============================================
   QUIZ HEADER
   ============================================ */

.aq-quiz-header {
    background: linear-gradient(160deg, #1e3a5f 0%, #1a56db 70%, #3f83f8 100%);
    color: #fff;
    padding: 22px 16px 18px;
    border-radius: 10px;
    margin-bottom: 14px;
    box-shadow: 0 4px 18px rgba(26, 86, 219, 0.28);
}

.aq-quiz-header h2 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.aq-quiz-header p {
    margin: 8px 0 0;
    opacity: 0.92;
    font-size: 14px;
    line-height: 1.55;
}

.aq-quiz-meta {
    margin-top: 12px;
    font-size: 13px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    opacity: 0.88;
}

.aq-quiz-meta strong {
    font-weight: 600;
}

/* ============================================
   QUESTION CARD
   ============================================ */

.aq-question {
    background: #fff;
    padding: 16px 14px;
    margin-bottom: 10px;
    border-left: 4px solid #1a56db;
    border-radius: 9px;
    box-shadow: 0 1px 6px rgba(17, 35, 60, 0.07);
    transition: box-shadow 0.2s ease;
}

.aq-question:hover {
    box-shadow: 0 3px 12px rgba(26, 86, 219, 0.11);
}

.aq-question h3 {
    margin: 0 0 10px;
    color: #1e3a5f;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.aq-question-text {
    line-height: 1.7;
    margin: 0 0 14px;
    color: #334155;
    font-size: 15px;
}

/* ============================================
   INPUT FIELDS — full width on mobile
   ============================================ */

.aq-answer-field {
    margin-top: 4px;
}

.aq-answer-label {
    font-weight: 600;
    color: #1e3a5f;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.aq-answer-input {
    width: 100%;           /* fills the card on mobile */
    padding: 13px 14px;
    font-size: 16px;       /* prevents iOS zoom on focus */
    border: 1.5px solid #c3d9f5;
    border-radius: 7px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #1e3a5f;
    background: #f8fbff;
    -webkit-appearance: none;
    appearance: none;
}

.aq-answer-input:focus {
    border-color: #1a56db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
    background: #fff;
}

.aq-answer-hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: #6b8db5;
}

/* ============================================
   SUBMIT BUTTON — full width on mobile
   ============================================ */

.aq-submit-wrapper {
    margin-top: 24px;
    padding: 0 0 8px;
}

.aq-submit {
    display: block;
    width: 100%;
    background: #1a56db;
    color: #fff;
    padding: 16px 20px;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(26, 86, 219, 0.32);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.2px;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}

.aq-submit:hover {
    background: #1e429f;
    box-shadow: 0 6px 18px rgba(26, 86, 219, 0.38);
}

.aq-submit:active {
    transform: scale(0.99);
    box-shadow: 0 2px 6px rgba(26, 86, 219, 0.25);
}

.aq-submit:disabled {
    background: #c3d9f5;
    color: #6b8db5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   RESULTS SECTION
   ============================================ */

.aq-results {
    background: #fff;
    padding: 16px 14px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(17, 35, 60, 0.08);
    margin-top: 14px;
    animation: slideInUp 0.35s ease;
}

.aq-results h2 {
    color: #1e3a5f;
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
}

/* ============================================
   RESULT ITEM (Correct / Incorrect)
   ============================================ */

.aq-result-item {
    padding: 14px 12px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid;
}

.aq-result-item.correct {
    background: #ecfdf5;
    border-left-color: #057a55;
}

.aq-result-item.incorrect {
    background: #fef2f2;
    border-left-color: #e02424;
}

.aq-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.aq-result-number {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a5f;
}

.aq-result-status {
    font-size: 15px;
    font-weight: 700;
}

.aq-result-item.correct .aq-result-status  { color: #057a55; }
.aq-result-item.incorrect .aq-result-status { color: #e02424; }

.aq-result-question {
    margin: 8px 0;
    color: #334155;
    line-height: 1.65;
    font-size: 15px;
}

.aq-result-answers {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 7px;
    font-size: 14px;
}

.aq-result-answer-row {
    margin-bottom: 6px;
}

.aq-result-answer-row:last-child {
    margin-bottom: 0;
}

.aq-result-answer-row strong {
    color: #1e3a5f;
}

.aq-result-explanation {
    margin-top: 12px;
    padding: 12px 14px;
    background: #e8f0fe;
    border-radius: 7px;
    border-left: 3px solid #3f83f8;
    font-size: 14px;
}

.aq-result-explanation strong {
    color: #1e3a5f;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.aq-result-explanation-text {
    color: #334155;
    line-height: 1.65;
}

/* ============================================
   FINAL SCORE CARD
   ============================================ */

.aq-score-card {
    background: linear-gradient(160deg, #1e3a5f 0%, #1a56db 65%, #3f83f8 100%);
    color: #fff;
    padding: 22px 16px;
    border-radius: 10px;
    text-align: center;
    margin-top: 14px;
    box-shadow: 0 6px 24px rgba(26, 86, 219, 0.32);
}

.aq-score-card h3 {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
}

.aq-score-number {
    font-size: 56px;
    font-weight: 800;
    margin: 10px 0;
    line-height: 1;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.aq-score-percentage {
    font-size: 26px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    display: inline-block;
    padding: 5px 22px;
    border-radius: 30px;
    margin-bottom: 14px;
}

.aq-score-message {
    background: rgba(255, 255, 255, 0.14);
    padding: 16px 18px;
    border-radius: 9px;
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
}

.aq-score-message-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.aq-score-message-text {
    font-size: 15px;
    opacity: 0.92;
    line-height: 1.6;
}

/* ============================================
   SECTION TITLE
   ============================================ */

.aq-section-title {
    background: #e8f0fe;
    padding: 13px 14px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #3f83f8;
}

.aq-section-title-text {
    line-height: 1.65;
    color: #1e3a5f;
    font-weight: 600;
    font-size: 14px;
}

.aq-section-title-text.bold {
    font-weight: 700;
}

/* ============================================
   PC / TABLET — restore breathing room at 600px+
   ============================================ */

@media (min-width: 600px) {
    .aq-quiz {
        padding: 0 16px;
        margin: 20px auto;
    }

    .aq-quiz-header {
        padding: 34px 30px 28px;
    }

    .aq-quiz-header h2 { font-size: 26px; }
    .aq-quiz-header p  { font-size: 15px; }

    .aq-question {
        padding: 24px 26px;
        margin-bottom: 14px;
    }

    .aq-answer-input {
        max-width: 280px;
    }

    .aq-submit {
        display: inline-block;
        width: auto;
        min-width: 200px;
        padding: 14px 44px;
    }

    .aq-submit-wrapper {
        text-align: center;
    }

    .aq-results {
        padding: 28px 30px;
        margin-top: 20px;
    }

    .aq-results h2 { font-size: 22px; }

    .aq-result-item {
        padding: 18px 20px;
        margin: 12px 0;
    }

    .aq-score-card {
        padding: 36px 32px;
        margin-top: 20px;
    }

    .aq-score-card h3   { font-size: 24px; }
    .aq-score-number    { font-size: 68px; }

    .aq-section-title {
        padding: 16px 20px;
        margin-bottom: 14px;
    }

    .aq-section-title-text { font-size: 15px; }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

.aq-loading {
    animation: pulse 1.4s ease-in-out infinite;
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .aq-submit-wrapper { display: none; }

    .aq-quiz-header,
    .aq-score-card {
        background: #fff !important;
        color: #1e3a5f !important;
        border: 2px solid #1a56db;
        box-shadow: none;
    }
}
