/* =========================================================
   EBC English Level Test
   Modern responsive stylesheet
   ========================================================= */

/* ---------- Base ---------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: #f4f6f8;
    color: #263238;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.divpage0 {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 24px 60px;
}

/* ---------- Introductory section ---------- */

.divpage0 > p:first-child {
    margin: 0 0 18px;
    padding: 20px 24px;
    background: #ffffff;
    border-left: 5px solid #5b4bb7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    color: #263238;
    font-size: 17px;
}

.divpage0 > p:nth-child(2) {
    margin: 28px 0 8px;
    font-size: 22px;
    font-weight: 600;
    color: #222b45;
}

.divpage0 > p:nth-child(3) {
    margin: 0 0 8px;
    color: #59636e;
}

.divpage0 > ol {
    margin: 12px 0 24px;
    padding: 18px 25px 18px 45px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.divpage0 > ol li {
    margin: 3px 0;
}

.divpage0 > ol a {
    color: #4e3fa3;
    text-decoration: none;
    font-weight: 500;
}

.divpage0 > ol a:hover {
    text-decoration: underline;
}

.divpage0 > p:nth-of-type(4) {
    margin: 20px 0;
    padding: 15px 20px;
    background: #eef1f5;
    border-radius: 7px;
    color: #4f5963;
}

.divpage0 > p[align="center"] {
    margin: 25px 0 30px;
    color: #4e3fa3;
    font-size: 18px;
}

/* ---------- Main test form ---------- */

form {
    width: 100%;
}

/* ---------- Remove old table appearance ---------- */

form > table:first-of-type {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* ---------- Test sections ---------- */

form > table:first-of-type tr td {
    border: 0;
}

/* Section headings */

form > table:first-of-type tr td h2 {
    margin: 0;
    padding: 18px 22px;
    color: #ffffff;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
}

/* Make each section heading consistent */

form > table:first-of-type tr td[bgcolor="#CAFFFF"] h2,
form > table:first-of-type tr td[bgcolor="#99FFCC"] h2,
form > table:first-of-type tr td[bgcolor="#B3D9FF"] h2,
form > table:first-of-type tr td[bgcolor="#FFE1FF"] h2,
form > table:first-of-type tr td[bgcolor="#FFFFCC"] h2,
form > table:first-of-type tr td[bgcolor="#FFDFBF"] h2,
form > table:first-of-type tr td h2 {
    background: #5b4bb7;
}

/* ---------- Question areas ---------- */

form > table:first-of-type tr td p {
    margin: 0;
    padding: 12px 22px;
    background: #ffffff;
    border-bottom: 1px solid #e7eaee;
    color: #303942;
}

form > table:first-of-type tr td p:last-child {
    border-bottom: 0;
}

/* Question text */

.notranslate {
    font-size: 16px;
}

/* ---------- Select boxes ---------- */

select {
    min-width: 145px;
    max-width: 100%;
    margin: 0 5px;
    padding: 7px 30px 7px 10px;
    border: 1px solid #c9ced6;
    border-radius: 6px;
    background: #ffffff;
    color: #263238;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.3;
    cursor: pointer;
    vertical-align: middle;
}

select:hover {
    border-color: #8c82c9;
}

select:focus {
    outline: none;
    border-color: #5b4bb7;
    box-shadow: 0 0 0 3px rgba(91, 75, 183, 0.12);
}

/* ---------- Section introduction text ---------- */

form > table:first-of-type h3 {
    margin: 0;
    padding: 18px 22px;
    background: #ffffff;
    color: #4d5761;
    font-size: 17px;
    font-weight: 500;
}

/* ---------- Reading passage ---------- */

form > table:first-of-type hr {
    margin: 25px 22px;
    border: 0;
    border-top: 1px solid #dfe3e8;
}

form > table:first-of-type p.notranslate br {
    line-height: 1.8;
}

/* ---------- Results heading ---------- */

form > table:first-of-type tr:last-child td h2 {
    margin-top: 35px;
    border-radius: 8px 8px 0 0;
}

/* Results button area */

form > table:first-of-type tr:last-child td {
    background: #ffffff !important;
}

input[type="button"] {
    display: inline-block;
    margin: 12px 0 20px;
    padding: 13px 28px;
    border: 0;
    border-radius: 7px;
    background: #5b4bb7;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="button"]:hover:not(:disabled) {
    background: #493a9e;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
}

input[type="button"]:active:not(:disabled) {
    transform: translateY(0);
}

input[type="button"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Results table ---------- */

form > table:nth-of-type(2) {
    width: 100%;
    margin-top: 25px;
    padding: 0;
    border: 0;
    border-collapse: separate !important;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
}

/* General result cells */

form > table:nth-of-type(2) td {
    padding: 11px 14px;
    border-bottom: 1px solid #e7eaee;
    vertical-align: middle;
}

form > table:nth-of-type(2) tr:last-child td {
    border-bottom: 0;
}

/* Result table headings */

form > table:nth-of-type(2) tr:nth-child(2) td {
    background: #f0f1f5;
    color: #4a5360;
    font-size: 14px;
    text-align: center;
}

form > table:nth-of-type(2) tr:nth-child(2) td:first-child {
    text-align: left;
}

/* Section names */

.normtext {
    color: #39434d;
    font-size: 15px;
}

/* Result values */

.styletest4,
.styletest3 {
    width: auto;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid #d5d9df;
    border-radius: 5px;
    background: #f8f9fb;
    color: #263238;
    font-family: inherit;
    font-size: 15px;
    text-align: center;
}

/* Score fields */

.styletest4 {
    width: 65px;
    width: 100%;
}

/* Larger result fields */

.styletest3 {
    width: 100%;
    max-width: 430px;
    text-align: left;
}

/* ---------- Total row ---------- */

form > table:nth-of-type(2) tr:nth-last-child(5) td {
    background: #f5f3ff;
    border-top: 2px solid #d9d4f3;
    font-weight: 600;
}

form > table:nth-of-type(2) tr:nth-last-child(5) .styletest4 {
    background: #ffffff;
    font-weight: 600;
}

/* ---------- Duration ---------- */

form > table:nth-of-type(2) tr:nth-last-child(3) td {
    background: #fafafa;
}

/* ---------- Estimated level ---------- */

form > table:nth-of-type(2) tr:nth-last-child(2) td {
    padding-top: 20px;
    padding-bottom: 20px;
    background: #f0edff;
}

form > table:nth-of-type(2) tr:nth-last-child(2) td:first-child {
    color: #3f347e;
    font-weight: 600;
}

form > table:nth-of-type(2) tr:nth-last-child(2) .styletest3 {
    border: 2px solid #5b4bb7;
    background: #ffffff;
    color: #4e3fa3;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

/* ---------- Recommended course ---------- */

form > table:nth-of-type(2) tr:last-child td {
    padding-top: 20px;
    padding-bottom: 20px;
    background: #ffffff;
}

form > table:nth-of-type(2) tr:last-child td:first-child {
    font-weight: 600;
}

form > table:nth-of-type(2) tr:last-child .styletest3 {
    background: #ffffff;
    font-weight: 600;
}

/* ---------- Well done message ---------- */

.centretext {
    display: block;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 12px 15px;
    border: 0;
    background: transparent;
    color: #4e3fa3;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

/* ---------- Links ---------- */

a {
    color: #4e3fa3;
}

a:hover {
    color: #392d86;
}

/* ---------- Responsive design ---------- */

@media (max-width: 768px) {

    .divpage0 {
        padding: 20px 12px 40px;
    }

    body {
        font-size: 15px;
    }

    .divpage0 > p:first-child {
        padding: 16px 18px;
        font-size: 16px;
    }

    .divpage0 > p:nth-child(2) {
        font-size: 20px;
    }

    form > table:first-of-type tr td h2 {
        padding: 15px 17px;
        font-size: 19px;
    }

    form > table:first-of-type tr td p {
        padding: 12px 17px;
        line-height: 1.8;
    }

    form > table:first-of-type h3 {
        padding: 15px 17px;
        font-size: 16px;
    }

    select {
        min-width: 125px;
        padding: 7px 25px 7px 8px;
        font-size: 14px;
    }

    /* Make results table scroll horizontally if necessary */
    form > table:nth-of-type(2) {
        display: block;
        overflow-x: auto;
    }

    form > table:nth-of-type(2) tbody {
        display: table;
        width: 100%;
    }

    form > table:nth-of-type(2) td {
        padding: 9px 8px;
    }

    .styletest3 {
        max-width: 300px;
    }
}

/* ---------- Small phones ---------- */

@media (max-width: 480px) {

    .divpage0 {
        padding: 15px 8px 30px;
    }

    .divpage0 > ol {
        padding-left: 38px;
    }

    form > table:first-of-type tr td p {
        padding: 11px 12px;
    }

    form > table:first-of-type tr td h2 {
        padding: 14px 12px;
        font-size: 18px;
    }

    select {
        min-width: 115px;
        max-width: 100%;
        margin: 2px 3px;
        font-size: 14px;
    }

    input[type="button"] {
        width: 100%;
        max-width: 320px;
        padding: 13px 18px;
    }

    form > table:nth-of-type(2) {
        font-size: 14px;
    }

    .styletest4 {
        width: 55px;
    }

    .styletest3 {
        width: 100%;
        max-width: 230px;
    }

    form > table:nth-of-type(2) tr:nth-last-child(2) .styletest3 {
        font-size: 18px;
    }
}