@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Merriweather:wght@700&display=swap");

:root {
    --navy: #0b2f5b;
    --blue: #185fb9;
    --blue-dark: #0c438c;
    --red: #b4232b;
    --red-dark: #8d1820;
    --ink: #172033;
    --muted: #5b6473;
    --surface: rgba(255, 255, 255, 0.97);
    --line: #dbe2eb;
    --soft-blue: #eef5ff;
    --soft-red: #fff1f2;
    --success: #167447;
    --shadow: 0 24px 65px rgba(8, 28, 57, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 2.5rem 1rem;
    display: grid;
    place-items: start center;
    color: var(--ink);
    font-family: "DM Sans", Arial, sans-serif;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(rgba(7, 35, 73, 0.2), rgba(7, 35, 73, 0.2)),
        url("../img/usabg.jpg") center / cover no-repeat;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(1px);
}

.card {
    width: min(760px, 100%);
    padding: clamp(1.5rem, 4vw, 3.25rem);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.landing-card {
    text-align: center;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--red);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 1rem;
    color: var(--navy);
    font-family: "Merriweather", Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.16;
}

h2 {
    color: var(--navy);
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    line-height: 1.3;
}

h3 {
    color: var(--navy);
}

.intro {
    max-width: 650px;
    margin: 0 auto 1.5rem;
    color: #273349;
    font-size: 1.08rem;
}

.instruction-box,
.location-settings {
    margin: 1.5rem 0;
    padding: 1.25rem;
    text-align: left;
    background: var(--soft-blue);
    border-left: 5px solid var(--blue);
    border-radius: 14px;
}

.instruction-box p:last-child,
.location-settings p:last-child {
    margin-bottom: 0;
}

.hero-image {
    display: block;
    width: min(300px, 75%);
    height: auto;
    margin: 1rem auto 1.5rem;
    object-fit: contain;
}

.start-form {
    display: grid;
    gap: 1.25rem;
}

fieldset {
    margin: 0;
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 14px;
}

legend {
    padding: 0 0.5rem;
    color: var(--navy);
    font-weight: 700;
}

.option {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
}

.option:hover {
    background: #f7f9fc;
}

.option input {
    margin-top: 0.35rem;
}

.option span {
    display: grid;
}

.option small,
label span,
.quiet-note {
    color: var(--muted);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field-grid label {
    display: grid;
    gap: 0.4rem;
    color: var(--navy);
    font-weight: 600;
}

input[type="text"],
textarea {
    width: 100%;
    border: 1px solid #b9c4d3;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"] {
    min-height: 48px;
    padding: 0.75rem 0.9rem;
}

textarea {
    min-height: 130px;
    padding: 1rem;
    resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(24, 95, 185, 0.14);
}

.button {
    display: inline-flex;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--red);
    color: #fff;
    box-shadow: 0 8px 18px rgba(180, 35, 43, 0.22);
}

.button-primary:hover {
    background: var(--red-dark);
}

.button-secondary {
    border-color: #b7c3d2;
    background: #fff;
    color: var(--navy);
}

.source-note,
.quiet-note {
    margin: 1.5rem 0 0;
    font-size: 0.9rem;
}

a {
    color: var(--blue-dark);
}

a:hover {
    color: var(--red);
}

.quiz-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

.quiz-header h1 {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.text-link {
    flex: 0 0 auto;
    font-weight: 600;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.progress-track {
    height: 9px;
    margin: 0.55rem 0 2rem;
    overflow: hidden;
    background: #dfe7f1;
    border-radius: 999px;
}

.progress-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--red));
    border-radius: inherit;
}

.question-panel {
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.question-number {
    margin-bottom: 0.5rem;
    color: var(--red);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
}

.question-panel h2 {
    margin-bottom: 0.9rem;
    font-size: clamp(1.4rem, 3.5vw, 2rem);
}

.answer-hint {
    padding: 0.65rem 0.8rem;
    color: var(--navy);
    background: var(--soft-blue);
    border-radius: 9px;
    font-weight: 600;
}

.answer-form {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.25rem;
}

.answer-form label {
    color: var(--navy);
    font-weight: 700;
}

.answer-form .button {
    justify-self: start;
}

.alert {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-weight: 600;
}

.alert-error {
    color: #7b1017;
    background: var(--soft-red);
    border: 1px solid #f1b8bd;
}

.alert-success {
    color: #0e5c37;
    background: #e9f8f0;
    border: 1px solid #a8dfc1;
}

.results-card > h1 {
    text-align: center;
}

.results-card > .eyebrow {
    text-align: center;
}

.score-summary {
    display: grid;
    width: min(360px, 100%);
    margin: 1.25rem auto;
    padding: 1.3rem;
    place-items: center;
    border-radius: 18px;
    text-align: center;
}

.score-summary.pass {
    color: #0f5e38;
    background: #e8f8ef;
}

.score-summary.fail {
    color: #86151d;
    background: var(--soft-red);
}

.score-summary strong {
    font-size: 3.4rem;
    line-height: 1;
}

.result-message {
    text-align: center;
}

.review-section {
    margin-top: 2rem;
}

.review-item {
    margin: 1rem 0;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.review-item h3 {
    margin-bottom: 0.6rem;
}

.review-item ul {
    margin-bottom: 0;
    padding-left: 1.3rem;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.75rem;
}

@media (max-width: 640px) {
    body {
        padding: 1rem 0.65rem;
    }

    .card {
        padding: 1.35rem;
        border-radius: 18px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .quiz-header,
    .progress-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .answer-form .button,
    .result-actions .button {
        width: 100%;
    }
}
