body { background-color: white; font-family: "Inter", sans-serif; font-optical-sizing: auto; }
header { position: sticky; top: 0; z-index: 1000; background: #fff; border-bottom: 1px solid #ddd; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
header .container { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; }
header .logo { width: 80px; height: 60px; margin-right: 0.75rem; }
header .logo img { width: 100%; height: auto; }
header .title { font-weight: bold;font-size: 1.2rem; }
header .actions a { display: inline-block; margin-left: 1rem; cursor: pointer; text-decoration: none; color: #007bff;}
header .actions a:hover { text-decoration: underline !important; }
.intro-text { font-style: italic; font-size: 95%; background-color: #FAFAFA; padding-top: 1rem; }
.question-block { margin-bottom: 1.5rem; position: relative; cursor: pointer; }
.question-block.answered p { color: darkgreen; }
.question-block p:hover { color: #3c8dbc; }
.question-title {padding-right: 2rem;cursor: pointer;}

.toggle-icon {position: absolute;right: 0;top: 0;width: 1.2rem;height: 1.2rem;cursor: pointer;}
.toggle-icon svg {width: 100%;height: 100%;display: block;}
/* Core: rotate and fade the polygon itself */
.toggle-icon svg polygon {
    transition: transform 0.3s ease, fill-opacity 0.3s ease, stroke-opacity 0.3s ease;
    transform-box: fill-box;         /* crucial for SVG transforms */
    transform-origin: center;        /* rotate around its center */
}
/* Collapsed: solid right triangle */
.toggle-icon.collapsed svg polygon {
    transform: rotate(0deg);
    fill: currentColor;
    stroke: none;
    fill-opacity: 1;
    stroke-opacity: 0;
}
/* Expanded: outlined down triangle */
.toggle-icon.expanded svg polygon {
    transform: rotate(90deg);        /* now rotates visibly */
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    fill-opacity: 0;
    stroke-opacity: 1;
}

.answers { display: none; margin-top: 0.5rem; margin-left: 1rem; }
.form-check { display: flex; align-items: flex-start; margin-bottom: 0.5rem; }
.form-check-input { margin-top: 0.3rem; margin-right: 0.75rem; flex-shrink: 0; }
.form-check-label { text-indent: 0; text-align: left; padding: 2px 4px; border-radius: 4px; transition: background-color 0.3s ease, transform 0.2s ease; }
.form-check-label:hover { background-color: #f8f9fa;cursor: pointer;transform: scale(1.02); }
.form-check-label.selected { color: #3c8dbc; font-weight: 500; }
.disclaimer { font-style: italic; margin-top: 2rem; }
.terms { margin-bottom: 0; font-size: 90%; font-style: italic; }
#submitBtn {
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}
#submitBtn.loading {
    pointer-events: none;
    opacity: 0.85;
}
/* The animated light bar */
#submitBtn.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
            120deg,
            rgba(255,255,255,0) 0%,
            rgba(255,255,255,0.6) 50%,
            rgba(255,255,255,0) 100%
    );
    animation: sweep 1.2s linear infinite;
}
@keyframes sweep {
    0%   { left: -150%; }
    100% { left: 150%; }
}

.btn-disabled {
    opacity: 0.5;
    pointer-events: auto; /* allow click */
    cursor: not-allowed;
}

/* Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }

/* Modal box with pop animation */
.modal-box {background: #fff;width: 90%;max-width: 500px;border-radius: 8px;box-shadow: 0 8px 24px rgba(0,0,0,0.2);padding: 1rem 1.25rem;animation: modalPop 0.25s ease;}
@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Modal Header */
.modal-header {display: flex;justify-content: space-between;align-items: center;margin-bottom: 0.75rem;padding: 0;border-bottom: none;}
.modal-header h2 {margin: 0;font-size: 1.25rem;}
.modal-close {cursor: pointer;font-size: 1.5rem;line-height: 1;padding: 0 0.25rem;opacity: 0.7;}
.modal-close:hover {opacity: 1;}
.modal-content { padding-left: 12px; padding-right: 10px; max-height: calc(100vh - 190px); overflow-y: scroll; }
/* Bullet list */
#remainingList {margin: 0;padding-left: 1.25rem;}
#remainingList li {margin: 0.4rem 0;}

.quiz-user-info {border: 1px solid #ddd;border-radius: 6px;background: #fafafa;}
.quiz-user-heading {font-size: 0.95rem;font-weight: 500;color: #444;}
.quiz-user-info label {font-weight: 600;white-space: nowrap;}
.quiz-user-info .form-control {border-radius: 4px;box-shadow: none;}
.quiz-user-info .form-control:focus {border-color: #007bff;box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.15);}

.assessment-box {border: 1px solid #ddd;border-radius: 6px;background: #fafafa;}
.assessment-heading {font-size: 1.05rem;font-weight: 600;color: #333;}
.rating-stars {font-size: 1.8rem;color: #ccc;cursor: pointer;user-select: none;}
.rating-stars .star {margin-right: 0.25rem;transition: color 0.15s ease;}
.rating-stars .star.hovered,
.rating-stars .star.selected {color: #f7c200; /* gold */}

#resultPage .qt-primary p { font-style: italic; }

.site-footer { background: #111; color: #ccc; border-top: 1px solid #222; font-size: 0.8rem; }
.site-footer .footer-line { margin: 0.3rem 0; display: flex; justify-content: space-between; }
.site-footer .footer-link { color: #fff; text-decoration: none; }
.site-footer .footer-link:hover { text-decoration: underline;color: #f0f0f0; }

/* PayPal payment page */
#paypal-error-box {
    display:none;
    background:#ffecec;
    border:1px solid #ff5f5f;
    padding:12px;
    margin-top:15px;
    border-radius:6px;
    color:#a00000;
}

#paypal-processing-overlay {
    display:none;
    position:fixed;
    top:0; left:0;
    width:100%; height:100%;
    background:rgba(255,255,255,0.9);
    z-index:9999;
    text-align:center;
    padding-top:20%;
    font-family:Arial, sans-serif;
}

#paypal-processing-overlay .spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

#paypal-processing-overlay .caption {
    font-size:22px;
    margin-bottom:15px;
}

#paypal-processing-overlay .warning {
    font-size:16px;
    color:#555;
    margin-bottom:25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.logo {
    /* Default/Desktop value */
    margin-left: 0;
}

@media (max-width: 768px) {
    header .logo {
        margin-left: 10px;
    }

    header .title {
        line-height: 1.2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        font-size: 1.1rem;
        /* Optional: If the text still feels too low */
        /* transform: translateY(-1px); */
    }

    header .actions {
        font-size: 0.9rem;
        line-height: 1.2rem;
        padding-top: 5px;
        width: 180px;
    }
}

@media (max-width: 365px) {
    header .title {
        line-height: 1.3;
        transform: translate(-5px, 8px);
        width: 120px;
    }
    header .actions a {
        margin-left: 0.8rem;
    }
}