/* Gemensam styling för inloggade sidor och formulär */

/* Sticky footer – copyright längst ner även när innehållet är kort */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#main {
    flex: 1;
}

#footer {
    flex-shrink: 0;
}

.formstyle,
.app-card {
    width: 100%;
    border-top: 3px solid #47b2e4;
    border-bottom: 3px solid #47b2e4;
    padding: 30px;
    background: #fff;
    box-shadow: 0 0 24px 0 rgb(0 0 0 / 12%);
    text-align: left;
}

.app-card-center {
    text-align: center;
}

/* Rubriker i kort */
.app-heading {
    color: #37517e;
    font-weight: 700;
    margin-bottom: 12px;
}

.app-muted {
    color: #6c757d;
    margin-bottom: 12px;
}

.app-divider {
    border: 0;
    border-top: 1px solid #e6eaf0;
    margin: 22px 0;
}

/* Primära/sekundära knappar */
.app-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-btn,
.topic-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 2px solid transparent;
}

.app-btn-primary,
.topic-btn-primary {
    background: #47b2e4;
    color: #fff !important;
    border-color: #47b2e4;
    box-shadow: 0 4px 14px rgba(71, 178, 228, 0.4);
}

.app-btn-primary:hover,
.topic-btn-primary:hover {
    background: #3aa0d1;
    border-color: #3aa0d1;
}

.app-btn-secondary,
.topic-btn {
    background: #fff;
    color: #37517e !important;
    border-color: #e6eaf0;
    border-radius: 12px;
}

.app-btn-secondary:hover,
.topic-btn:hover {
    border-color: #47b2e4;
    background: #f3fbff;
}

.app-btn-outline {
    background: #fff;
    color: #47b2e4 !important;
    border-color: #47b2e4;
}

.app-btn-outline:hover {
    background: #f3fbff;
}

.app-actions-center {
    max-width: 420px;
    margin: 0 auto 16px;
}

/* Legacy-klass + fristående knappar (t.ex. checkout) */
.submit-button {
    display: inline-block;
    min-width: 220px;
    font-family: inherit;
    background: #47b2e4;
    color: #fff !important;
    border: 2px solid #47b2e4;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s ease;
    box-shadow: 0 4px 14px rgba(71, 178, 228, 0.4);
}

.submit-button:hover {
    background: #3aa0d1;
    border-color: #3aa0d1;
    color: #fff !important;
}

.app-actions .app-btn {
    width: 100%;
}

.app-actions .app-btn.app-btn-inline {
    width: auto;
    min-width: 220px;
}

/* Ämnesval */
.st-topics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Frågesidor */
.q-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #37517e;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.q-text {
    font-size: 1.1rem;
    color: #2b2b2b;
    margin: 6px 0 18px;
    text-align: left;
}

.q-image {
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.answer-btn,
.button {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 2px solid #e6eaf0;
    border-radius: 10px;
    padding: 14px 18px !important;
    font-family: inherit;
    color: #37517e;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.4;
    transition: all 0.15s ease;
}

.answer-btn:hover,
.button:not(.disabled):hover {
    border-color: #47b2e4;
    background: #f3fbff;
}

.answer-btn.correct,
.button.correct {
    border-color: #2e7d32 !important;
    background: #e8f5e9 !important;
    color: #1b5e20 !important;
}

.answer-btn.incorrect,
.button.incorrect {
    border-color: #c62828 !important;
    background: #ffebee !important;
    color: #b71c1c !important;
}

.disabled {
    pointer-events: none;
}

.next_btn {
    background: #47b2e4;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    margin: 8px 6px 0 0;
    box-shadow: 0 4px 14px rgba(71, 178, 228, 0.4);
}

.next_btn:hover {
    background: #3aa0d1;
}

.next_btn-secondary {
    background: #fff;
    color: #47b2e4;
    border: 2px solid #47b2e4;
    box-shadow: none;
}

.next_btn-secondary:hover {
    background: #f3fbff;
}

.timer {
    background: #eef6fb;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 600;
    color: #37517e;
    white-space: nowrap;
}

.app-link {
    display: inline-block;
    margin-top: 18px;
    color: #47b2e4;
    font-weight: 600;
    text-decoration: none;
}

.app-link:hover {
    text-decoration: underline;
}

/* Resultatsida */
.result-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 36px 30px;
    background: #fff;
    border-top: 3px solid #47b2e4;
    border-bottom: 3px solid #47b2e4;
    box-shadow: 0 0 24px 0 rgb(0 0 0 / 12%);
    border-radius: 4px;
}

.result-card .icon {
    font-size: 3rem;
    color: #47b2e4;
    margin-bottom: 12px;
}

.result-card .icon.pass {
    color: #2e7d32;
}

.result-card .icon.fail {
    color: #c62828;
}

.result-card .complete_text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #37517e;
    margin-bottom: 8px;
}

.result-card .score_text {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Formulär */
.php-email-form.app-form,
.password-reset-form {
    border-top: 3px solid #47b2e4;
    border-bottom: 3px solid #47b2e4;
    padding: 30px;
    background: #fff;
    box-shadow: 0 0 24px 0 rgb(0 0 0 / 12%);
    width: 100%;
}

.php-email-form.app-form label,
.password-reset-form label {
    color: #37517e;
    font-weight: 600;
}

.php-email-form.app-form .form-control,
.password-reset-form .form-control {
    border-radius: 8px;
    border: 2px solid #e6eaf0;
    padding: 10px 14px;
}

.php-email-form.app-form .form-control:focus,
.password-reset-form .form-control:focus {
    border-color: #47b2e4;
    box-shadow: 0 0 0 3px rgba(71, 178, 228, 0.15);
}

.php-email-form.app-form button[type="submit"],
.password-reset-form button[type="submit"] {
    background: #47b2e4;
    color: #fff;
    border: none;
    padding: 12px 36px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(71, 178, 228, 0.4);
    transition: background 0.15s ease;
}

.php-email-form.app-form button[type="submit"]:hover,
.password-reset-form button[type="submit"]:hover {
    background: #3aa0d1;
}

.app-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.app-alert-error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

.app-alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

/* Mina sidor */
.mp-card { text-align: left; }
.mp-heading { color: #37517e; font-weight: 700; margin-bottom: 12px; }
.mp-link { margin-bottom: 8px; }
.mp-link a { color: #47b2e4; text-decoration: none; font-weight: 600; }
.mp-link a:hover { text-decoration: underline; }
.mp-info { margin-bottom: 8px; color: #37517e; }
.mp-muted { margin-bottom: 8px; color: #6c757d; }
.mp-divider { border: 0; border-top: 1px solid #e6eaf0; margin: 22px 0; }
.mp-langform { margin-bottom: 0; }
.mp-langrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mp-select { width: auto; min-width: 160px; }
.mp-btn {
    background: #47b2e4; color: #fff; border: none;
    padding: 9px 22px; border-radius: 50px; cursor: pointer;
    font-weight: 600; box-shadow: 0 2px 12px rgba(71, 178, 228, 0.35);
}
.mp-btn:hover { background: #3aa0d1; }
.mp-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.mp-action {
    display: block; text-align: center; padding: 14px 20px;
    border-radius: 50px; font-weight: 600; text-decoration: none; transition: all 0.15s ease;
}
.mp-action-primary {
    background: #47b2e4; color: #fff !important;
    box-shadow: 0 4px 14px rgba(71, 178, 228, 0.4);
}
.mp-action-primary:hover { background: #3aa0d1; }
.mp-action-secondary {
    background: #fff; color: #47b2e4 !important; border: 2px solid #47b2e4;
}
.mp-action-secondary:hover { background: #f3fbff; }

/* Förklaring efter svar (träningsläge + genomgång) */
.q-explanation {
    margin-top: 20px;
    padding: 18px 20px;
    background: #f8fbfd;
    border: 1px solid #e3eef5;
    border-left: 4px solid #47b2e4;
    border-radius: 0 10px 10px 0;
    text-align: left;
    line-height: 1.6;
}

.q-explanation-hidden {
    display: none;
}

.q-explanation-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #47b2e4;
    margin-bottom: 10px;
}

.q-explanation h1 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2e7d32;
    margin: 0 0 10px 0;
    line-height: 1.45;
    border: none;
    padding: 0;
}

.q-explanation p,
.q-explanation P {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.q-explanation p:last-child,
.q-explanation P:last-child {
    margin-bottom: 0;
}

.q-explanation b,
.q-explanation strong {
    color: #37517e;
}

/* Kontextrad + framsteg i prov */
.quiz-context {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #37517e;
    background: #eef6fb;
    border-radius: 50px;
    padding: 8px 16px;
    margin: 0 0 20px;
    letter-spacing: 0.02em;
}

.st-card {
    width: 100%;
}

.quiz-alert {
    color: #b71c1c;
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: left;
}

.quiz-progress {
    width: 100%;
    height: 8px;
    background: #e6eaf0;
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 6px;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #47b2e4, #3aa0d1);
    border-radius: 50px;
    transition: width 0.3s ease;
}

.quiz-progress-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 16px;
    text-align: left;
}

.quiz-card {
    text-align: left;
}

.q-image-wrap {
    margin-bottom: 12px;
    text-align: center;
}

.quiz-answers .form-group {
    margin-bottom: 10px;
}

/* Resultat – visuell stapel */
.result-score-visual {
    margin: 0 0 24px;
    text-align: left;
}

.result-score-summary {
    font-size: 1.05rem;
    font-weight: 600;
    color: #37517e;
    margin: 0 0 12px;
    line-height: 1.45;
}

.result-score-track {
    position: relative;
    height: 14px;
    background: #e6eaf0;
    border-radius: 50px;
    overflow: visible;
}

.result-score-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 0.5s ease;
}

.result-score-fill.pass {
    background: linear-gradient(90deg, #43a047, #2e7d32);
}

.result-score-fill.fail {
    background: linear-gradient(90deg, #ef5350, #c62828);
}

.result-score-pass-line {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 3px;
    background: #37517e;
    border-radius: 2px;
    transform: translateX(-50%);
    z-index: 1;
}

.result-score-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 6px;
}

/* Mobil – prov och resultat */
@media (max-width: 767px) {
    .formstyle,
    .quiz-card,
    .result-card {
        padding: 18px 14px;
    }

    .quiz-context {
        font-size: 0.8rem;
        padding: 7px 12px;
    }

    .q-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .timer {
        font-size: 0.9rem;
        align-self: stretch;
        text-align: center;
    }

    .q-text {
        font-size: 1rem;
    }

    .quiz-answers .form-group.col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .answer-btn,
    .button {
        padding: 12px 14px !important;
        font-size: 0.95rem;
    }

    .next_btn {
        width: 100%;
        margin-right: 0;
    }

    .result-card .icon {
        font-size: 2.5rem;
    }

    .result-score-summary {
        font-size: 0.98rem;
    }
}

.result-stat-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 15px 17px;
    border: 1px solid #cfe8f5;
    border-radius: 16px;
    background: #f0faff;
    color: #37517e;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
}

.result-stat-note i {
    color: #24a3dd;
    font-size: 1.4rem;
    flex: 0 0 auto;
}

/* Gemensamt mörkblått Teorionline-utseende för val, konto och betalningssidor. */
body {
    color: #243a54;
    background:
        radial-gradient(circle at 84% 6%, rgba(18, 174, 245, .12), transparent 22%),
        #f3f7fb;
}

#main > .contact,
#main > section.contact {
    min-height: calc(100vh - 165px);
    padding-top: 118px;
}

.formstyle,
.app-card,
.result-card {
    border: 1px solid #dce9f3;
    border-top: 4px solid #12aef5;
    border-bottom: 1px solid #dce9f3;
    border-radius: 24px;
    box-shadow: 0 22px 58px rgba(5, 38, 79, .12);
}

.app-heading,
.q-meta,
.timer { color: #05264f; }

.app-btn,
.topic-btn,
.submit-button,
.next_btn { font-weight: 800; }

.app-btn-primary,
.topic-btn-primary,
.submit-button,
.next_btn {
    color: #fff !important;
    background: linear-gradient(135deg, #08a8f0, #19c2ff);
    border-color: #12aef5;
    box-shadow: 0 12px 28px rgba(8, 168, 240, .24);
}

.app-btn-primary:hover,
.topic-btn-primary:hover,
.submit-button:hover,
.next_btn:hover {
    background: linear-gradient(135deg, #078fd2, #12aef5);
    border-color: #078fd2;
}

.app-btn-secondary,
.topic-btn {
    color: #05264f !important;
    border-color: #d7e5f0;
    border-radius: 15px;
}

.app-btn-secondary:hover,
.topic-btn:hover {
    color: #05264f !important;
    background: #eef9ff;
    border-color: #12aef5;
}

@media (max-width: 767px) {
    #main > .contact,
    #main > section.contact { padding-top: 96px; }

    .formstyle,
    .app-card,
    .result-card { padding: 22px 17px; border-radius: 18px; }
}

/* Markera osäker + frågenavigering */
.quiz-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
}

.quiz-unsure-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    border: 2px solid #e6eaf0;
    color: #37517e;
    background: #fff;
    transition: all 0.15s ease;
    cursor: pointer;
    font-family: inherit;
}

.quiz-unsure-btn:hover {
    border-color: #47b2e4;
    background: #f3fbff;
}

.quiz-unsure-btn.active {
    border-color: #f9a825;
    background: #fff8e1;
    color: #e65100;
}

.quiz-pause-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #47b2e4;
    color: #47b2e4;
    background: #fff;
    transition: all 0.15s ease;
}

.quiz-pause-btn:hover {
    background: #f3fbff;
    color: #37517e;
}

.quiz-exam-footer {
    margin: 20px 0 8px;
    text-align: center;
}

.quiz-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    color: #fff;
    background: #37517e;
    transition: all 0.15s ease;
    box-shadow: 0 4px 14px rgba(55, 81, 126, 0.25);
}

.quiz-submit-btn:hover {
    background: #2c4064;
    color: #fff;
}

.quiz-nav-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e6eaf0;
    justify-content: center;
}

.quiz-nav-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    border: 2px solid #e6eaf0;
    text-decoration: none;
    color: #37517e;
    background: #fff;
    transition: all 0.12s ease;
}

.quiz-nav-cell:hover {
    border-color: #47b2e4;
    background: #f3fbff;
}

.quiz-nav-cell.current {
    border-color: #47b2e4;
    background: #47b2e4;
    color: #fff;
}

.button.selected {
  border-color: #47b2e4;
  background: #eef6fb;
  color: #37517e;
}

.quiz-nav-cell.answered-exam:not(.current) {
    background: #eef6fb;
    border-color: #90caf9;
    color: #37517e;
}

.quiz-nav-cell.correct:not(.current) {
    background: #e8f5e9;
    border-color: #81c784;
    color: #2e7d32;
}

.quiz-nav-cell.wrong:not(.current) {
    background: #ffebee;
    border-color: #e57373;
    color: #c62828;
}

.quiz-nav-cell.unsure:not(.current) {
    background: #fff8e1;
    border-color: #f9a825;
    color: #e65100;
}

.quiz-nav-cell.current.unsure {
    box-shadow: 0 0 0 2px #f9a825;
}

.quiz-nav-cell.current.wrong {
    box-shadow: 0 0 0 2px #c62828;
}

@media (max-width: 767px) {
    .quiz-unsure-btn,
    .quiz-pause-btn {
        width: 100%;
        justify-content: center;
    }

    .quiz-nav-cell {
        width: 26px;
        height: 26px;
        font-size: 0.68rem;
    }
}

/* Header/footer-override behövs även i /checkout som har en äldre kopia av style.css. */
#header,
#header.header-scrolled,
#header.header-inner-pages {
    background: rgba(2, 20, 43, .96);
    border-bottom: 1px solid rgba(91, 183, 255, .14);
    box-shadow: 0 12px 34px rgba(0, 10, 28, .18);
}

#header .logo a {
    color: #fff;
    font-weight: 900;
    letter-spacing: .14em;
}

.navbar a,
.navbar a:focus { color: #eef8ff; font-weight: 750; }

.navbar a:hover,
.navbar .active,
.navbar .active:focus,
.navbar li:hover > a { color: #29c0ff; }

.navbar .getstarted,
.navbar .getstarted:focus {
    color: #fff;
    border-color: rgba(64, 190, 255, .5);
    background: rgba(18, 174, 245, .11);
}

.mobile-nav-toggle { color: #fff !important; }
.navbar-mobile ul { background: #061a34; border: 1px solid rgba(97, 188, 255, .24); }
.navbar-mobile a,
.navbar-mobile a:focus { color: #e5f3ff !important; }

#footer { background: #020d1e; }
#footer .footer-newsletter { color: #b9cce2; background: #052047; }
#footer .footer-newsletter h4 { color: #fff; }
#footer .footer-top { color: #a8bdd0; background: #03162f; }
#footer .footer-top .footer-contact h3,
#footer .footer-top h4 { color: #f3faff; }
#footer .footer-top .footer-contact p,
#footer .footer-top .footer-links ul a { color: #91a9bd; }
