/* ============================================================
   Training Quiz Manager — frontend shortcodes
   Brand: Chosen Treasures TX — #001566 navy, #af0b00 red, black, white
   Fonts: DM Sans + DM Serif Display, enqueued in PHP
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display&display=swap');

.tqm-shortcode {
    /* ----- Typography ----- */
    --tqm-font-ui: "DM Sans", system-ui, -apple-system, sans-serif;
    --tqm-font-display: "DM Serif Display", Georgia, serif;

    --tqm-fs-xs:   0.6875rem;  /* 11px */
    --tqm-fs-sm:   0.8125rem;  /* 13px */
    --tqm-fs-base: 0.9375rem;  /* 15px */
    --tqm-fs-md:   1rem;       /* 16px */
    --tqm-fs-lg:   1.125rem;   /* 18px */
    --tqm-fs-xl:   1.375rem;   /* 22px */
    --tqm-fs-xxl:  1.75rem;    /* 28px */

    --tqm-fw-light:    300;
    --tqm-fw-regular:  400;
    --tqm-fw-medium:   500;
    --tqm-fw-semibold: 600;
    --tqm-fw-bold:     700;

    --tqm-track-wide: 0.06em;
    --tqm-line-body:  1.65;
    --tqm-line-heading: 1.2;

    /* ----- Brand Colors ----- */
    --tqm-brand-navy:     #001566;
    --tqm-brand-navy-dark:#000d42;
    --tqm-brand-navy-mid: #3a4e9c;
    --tqm-brand-red:      #af0b00;
    --tqm-brand-red-dark: #8c0900;
    --tqm-black:          #000000;
    --tqm-white:          #ffffff;

    /* Aliases used across components */
    --tqm-coral:       var(--tqm-brand-red);
    --tqm-coral-dark:  var(--tqm-brand-red-dark);
    --tqm-coral-soft:  rgba(175, 11, 0, 0.1);
    --tqm-navy:        var(--tqm-brand-navy);
    --tqm-navy-deep:   var(--tqm-brand-navy-dark);
    --tqm-navy-soft:   rgba(0, 21, 102, 0.08);

    /* ----- Neutrals ----- */
    --tqm-ink:         #000000;
    --tqm-ink-muted:   #3d3d3d;
    --tqm-paper:       #f5f6fa;
    --tqm-card-soft:   #f4f6fb;
    --tqm-border:      #e2e4ec;
    --tqm-border-mid:  #e2e4ec;

    /* ----- Semantic ----- */
    --tqm-success:      #0d6b3a;
    --tqm-success-soft: #e8f5ee;
    --tqm-danger:       var(--tqm-brand-red);
    --tqm-danger-soft:  rgba(175, 11, 0, 0.1);

    /* ----- Shape ----- */
    --tqm-radius:    6px;
    --tqm-radius-lg: 10px;
    --tqm-radius-xl: 16px;
    --tqm-shadow-sm: 0 1px 3px rgba(26,33,51,0.08), 0 1px 2px rgba(26,33,51,0.04);
    --tqm-shadow-md: 0 4px 16px -4px rgba(26,33,51,0.12), 0 2px 6px rgba(26,33,51,0.06);
    --tqm-shadow-lg: 0 12px 40px -8px rgba(26,33,51,0.16), 0 4px 12px rgba(26,33,51,0.06);

    font-family: var(--tqm-font-ui);
    font-size: var(--tqm-fs-base);
    font-weight: var(--tqm-fw-regular);
    line-height: var(--tqm-line-body);
    color: var(--tqm-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

.tqm-shortcode *,
.tqm-shortcode *::before,
.tqm-shortcode *::after {
    box-sizing: border-box;
}

/* ============================================================
   CARD SHELLS
   ============================================================ */

#tqm-quiz-root.tqm-shortcode,
.tqm-form-container.tqm-shortcode,
.tqm-shortcode.tqm-dashboard,
.tqm-shortcode.tqm-notice {
    position: relative;
    max-width: 480px;
    margin: 2.5rem auto;
    padding: 2.5rem 2.75rem 2.75rem;
    background: var(--tqm-white);
    border: 1px solid var(--tqm-border);
    border-radius: var(--tqm-radius-xl);
    box-shadow: var(--tqm-shadow-lg);
    overflow: visible;
    box-sizing: border-box;
}

/* Quiz panel — wider so long answers are not clipped */
#tqm-quiz-root.tqm-quiz-panel.tqm-shortcode {
    max-width: min(100%, 44rem);
    width: 100%;
    padding: 2rem 2rem 2.25rem;
}

/* Brand accent bar at top */
#tqm-quiz-root.tqm-shortcode::before,
.tqm-form-container.tqm-shortcode::before,
.tqm-shortcode.tqm-dashboard::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--tqm-brand-navy) 0%, var(--tqm-brand-red) 100%);
    border-radius: var(--tqm-radius-xl) var(--tqm-radius-xl) 0 0;
}

/* Dashboard card wider */
.tqm-shortcode.tqm-dashboard {
    max-width: 860px;
    padding: 2rem 2.25rem 2.5rem;
}

.tqm-shortcode.tqm-notice {
    max-width: 480px;
    padding: 1.5rem 2rem;
    background: var(--tqm-paper);
    border-left: 4px solid var(--tqm-brand-red);
    border-radius: var(--tqm-radius-lg);
    box-shadow: var(--tqm-shadow-sm);
}

/* Utility */
.tqm-is-hidden {
    display: none !important;
}

.tqm-shortcode.tqm-notice::before { display: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.tqm-title {
    margin: 0 0 0.375rem;
    font-size: var(--tqm-fs-lg);
    font-weight: var(--tqm-fw-bold);
    line-height: var(--tqm-line-heading);
    letter-spacing: -0.01em;
    color: var(--tqm-navy-deep);
    text-align: center;
}

.tqm-title::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 3px;
    margin: 0.625rem auto 0;
    background: var(--tqm-coral);
    border-radius: 2px;
}

.tqm-dashboard .tqm-title { text-align: left; }
.tqm-dashboard .tqm-title::after { margin-left: 0; }

.tqm-subtitle {
    margin: 0 0 1.25rem;
    font-size: var(--tqm-fs-lg);
    font-weight: var(--tqm-fw-semibold);
    line-height: var(--tqm-line-heading);
    color: var(--tqm-navy);
    text-align: center;
}

#tqm-quiz-area .tqm-subtitle {
    text-align: left;
    margin-bottom: 1rem;
}

.tqm-text {
    margin: 0 0 1rem;
    font-size: var(--tqm-fs-base);
    line-height: var(--tqm-line-body);
    color: var(--tqm-ink);
}

.tqm-text:last-child { margin-bottom: 0; }

.tqm-intro {
    font-size: var(--tqm-fs-sm);
    color: var(--tqm-ink-muted);
    text-align: center;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.tqm-helper {
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: var(--tqm-fs-sm);
    color: var(--tqm-ink-muted);
    text-align: center;
}

.tqm-muted { color: var(--tqm-ink-muted); font-size: var(--tqm-fs-sm); }
.tqm-score-pct { color: var(--tqm-ink-muted); font-weight: var(--tqm-fw-regular); }
.tqm-error { color: var(--tqm-danger); font-weight: var(--tqm-fw-medium); }
.tqm-success-msg { color: var(--tqm-success); font-weight: var(--tqm-fw-medium); }
.tqm-center { text-align: center; }

.tqm-shortcode a {
    color: var(--tqm-coral);
    font-weight: var(--tqm-fw-medium);
    text-decoration: none;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.tqm-shortcode a:hover {
    color: var(--tqm-coral-dark);
    text-decoration: underline;
}

/* ============================================================
   TAB SWITCHER  (login / register tabs)
   ============================================================ */

.tqm-tabs {
    display: flex;
    border-bottom: 2px solid var(--tqm-border);
    margin-bottom: 1.75rem;
}

.tqm-tab-btn {
    flex: 1;
    padding: 0.7rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: var(--tqm-font-ui);
    font-size: var(--tqm-fs-sm);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tqm-ink-muted);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.tqm-tab-btn.tqm-tab-active {
    color: var(--tqm-coral);
    border-bottom-color: var(--tqm-coral);
}

.tqm-tab-btn:hover:not(.tqm-tab-active) {
    color: var(--tqm-navy);
}

.tqm-tab-panel { display: none; }
.tqm-tab-panel.tqm-tab-panel-active { display: block; }

/* ============================================================
   LOGO / BRAND HEADER inside card
   ============================================================ */

.tqm-card-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tqm-card-brand-title {
    font-size: var(--tqm-fs-xl);
    font-weight: var(--tqm-fw-bold);
    color: var(--tqm-navy-deep);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 0.25rem;
}

.tqm-card-brand-sub {
    font-size: var(--tqm-fs-xs);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tqm-brand-red);
    margin: 0;
}

/* Alerts (login / signup messages) */
.tqm-alert {
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
    border-radius: var(--tqm-radius);
    font-size: var(--tqm-fs-sm);
    line-height: var(--tqm-line-body);
}

.tqm-alert--success {
    background: var(--tqm-success-soft);
    border-left: 4px solid var(--tqm-success);
    color: var(--tqm-success);
}

.tqm-alert--error {
    background: var(--tqm-danger-soft);
    border-left: 4px solid var(--tqm-brand-red);
    color: var(--tqm-brand-red);
}

.tqm-alert--warning {
    background: #fff8e6;
    border-left: 4px solid #c99200;
    color: #6b5200;
}

.tqm-dash-actions {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    align-items: center;
}

.tqm-btn--compact {
    width: auto;
    padding: 0.55rem 1.1rem;
    font-size: 0.8rem;
}

.tqm-dash-footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--tqm-border);
    display: flex;
    justify-content: center;
}

/* ============================================================
   FORMS
   ============================================================ */

.tqm-form-container form,
.tqm-login-form,
#tqm-user-form,
.tqm-signup-form,
.tqm-quiz-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tqm-signup-form {
    margin-top: 1.25rem;
}

.tqm-label {
    display: block;
    font-size: var(--tqm-fs-xs);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: var(--tqm-track-wide);
    text-transform: uppercase;
    color: var(--tqm-navy);
    margin-bottom: 0.1rem;
}

.tqm-form-container input,
.tqm-login-form input,
#tqm-user-form input {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.7rem 0.9rem;
    font-family: var(--tqm-font-ui);
    font-size: var(--tqm-fs-base);
    color: var(--tqm-ink);
    background: var(--tqm-paper);
    border: 1.5px solid var(--tqm-border-mid);
    border-radius: var(--tqm-radius);
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.tqm-form-container input::placeholder,
.tqm-login-form input::placeholder,
#tqm-user-form input::placeholder {
    color: var(--tqm-ink-muted);
    opacity: 0.7;
}

.tqm-form-container input:focus,
.tqm-login-form input:focus,
#tqm-user-form input:focus {
    outline: none;
    border-color: var(--tqm-coral);
    background: var(--tqm-white);
    box-shadow: 0 0 0 3px var(--tqm-coral-soft);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.tqm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.65rem 1.5rem;
    font-family: var(--tqm-font-ui);
    font-size: var(--tqm-fs-sm);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    border: 1.5px solid transparent;
    border-radius: var(--tqm-radius);
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.14s;
    text-decoration: none;
}

.tqm-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--tqm-coral-soft);
}

.tqm-shortcode a.tqm-btn,
.tqm-shortcode a.tqm-btn:hover,
.tqm-shortcode a.tqm-btn:visited,
.tqm-shortcode a.tqm-btn:focus {
    color: var(--tqm-white) !important;
    text-decoration: none !important;
}

/* Primary — brand red */
.tqm-btn--primary {
    background: var(--tqm-brand-red);
    color: var(--tqm-white) !important;
    border-color: var(--tqm-brand-red-dark);
    box-shadow: 0 2px 8px rgba(175, 11, 0, 0.28);
    width: 100%;
    margin-top: 0.25rem;
}

.tqm-btn--primary:hover {
    background: var(--tqm-brand-red-dark);
    border-color: var(--tqm-brand-red-dark);
    box-shadow: 0 4px 14px rgba(175, 11, 0, 0.35);
    transform: translateY(-1px);
    color: var(--tqm-white) !important;
    text-decoration: none;
}

.tqm-btn--primary:visited,
.tqm-btn--primary:focus {
    color: var(--tqm-white) !important;
}

/* Secondary — navy outline */
.tqm-btn--secondary {
    background: var(--tqm-white);
    color: var(--tqm-black) !important;
    border: 2px solid var(--tqm-brand-navy);
}

.tqm-btn--secondary:hover {
    background: var(--tqm-brand-navy);
    color: var(--tqm-white);
    text-decoration: none;
}

.tqm-shortcode a.tqm-btn--secondary,
.tqm-shortcode a.tqm-btn--secondary:visited,
.tqm-shortcode a.tqm-btn--secondary:focus {
    color: var(--tqm-black) !important;
}

.tqm-shortcode a.tqm-btn--secondary:hover {
    color: var(--tqm-white) !important;
}

/* Certificate download */
.tqm-btn--cert {
    background: var(--tqm-success);
    color: #fff;
    border-color: #135e3e;
    text-transform: none;
    font-size: var(--tqm-fs-base);
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(26,122,82,0.28);
}

.tqm-btn--cert:hover {
    background: #135e3e;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Nav — navy fill */
.tqm-btn--nav {
    background: var(--tqm-brand-navy);
    color: var(--tqm-white) !important;
    border-color: var(--tqm-brand-navy-dark);
    text-transform: none;
    font-size: var(--tqm-fs-sm);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(54,79,117,0.22);
}

.tqm-btn--nav:hover {
    background: var(--tqm-brand-navy-dark);
    color: var(--tqm-white) !important;
    transform: translateY(-1px);
    text-decoration: none;
}

.tqm-btn--nav:visited,
.tqm-btn--nav:focus {
    color: var(--tqm-white) !important;
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

/* --- Top bar: greeting + nav link --- */
.tqm-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--tqm-border);
}

.tqm-dash-greeting {
    margin: 0;
    font-size: var(--tqm-fs-xl);
    font-weight: var(--tqm-fw-bold);
    color: var(--tqm-navy-deep);
    letter-spacing: -0.01em;
}

.tqm-dash-greeting span {
    color: var(--tqm-coral);
}

/* --- Stats strip --- */
.tqm-dash-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tqm-stat-card {
    flex: 1;
    min-width: 130px;
    padding: 1.125rem 1.25rem;
    background: var(--tqm-paper);
    border: 1px solid var(--tqm-border);
    border-radius: var(--tqm-radius-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tqm-stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--tqm-coral);
    border-radius: 2px 2px 0 0;
}

.tqm-stat-num {
    display: block;
    font-size: var(--tqm-fs-xxl);
    font-weight: var(--tqm-fw-bold);
    color: var(--tqm-navy-deep);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.tqm-stat-label {
    font-size: var(--tqm-fs-xs);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tqm-ink-muted);
}

/* --- Section heading inside dashboard --- */
.tqm-dash-section-title {
    font-size: var(--tqm-fs-md);
    font-weight: var(--tqm-fw-bold);
    color: var(--tqm-navy);
    letter-spacing: -0.01em;
    margin: 0 0 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tqm-border);
}

/* --- Empty state --- */
.tqm-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--tqm-ink-muted);
}

.tqm-empty-state-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.tqm-empty-state p {
    margin: 0 0 1.25rem;
    font-size: var(--tqm-fs-base);
}

/* --- Attempts table --- */
.tqm-dashboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--tqm-font-ui);
    font-size: var(--tqm-fs-sm);
    border: 1px solid var(--tqm-border);
    border-radius: var(--tqm-radius-lg);
    overflow: hidden;
    box-shadow: var(--tqm-shadow-sm);
}

.tqm-dashboard-table th {
    padding: 0.8rem 1rem;
    font-size: var(--tqm-fs-xs);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    color: #fff;
    background: var(--tqm-navy);
    border-bottom: 2px solid var(--tqm-coral);
}

.tqm-dashboard-table td {
    padding: 0.875rem 1rem;
    font-size: var(--tqm-fs-sm);
    color: var(--tqm-ink);
    border-bottom: 1px solid var(--tqm-border);
    background: var(--tqm-white);
    vertical-align: middle;
}

.tqm-dashboard-table tbody tr:last-child td { border-bottom: none; }

.tqm-dashboard-table tbody tr:hover td {
    background: var(--tqm-navy-soft);
    transition: background 0.14s;
}

/* Download button in table */
.tqm-dashboard-table a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.8rem;
    font-size: var(--tqm-fs-xs);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff !important;
    text-decoration: none !important;
    background: var(--tqm-coral);
    border: 1px solid var(--tqm-coral-dark);
    border-radius: var(--tqm-radius);
    transition: background 0.18s, transform 0.14s;
}

.tqm-dashboard-table a:hover {
    background: var(--tqm-coral-dark);
    transform: translateY(-1px);
}

/* Score badge */
.tqm-score-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: var(--tqm-fw-semibold);
    font-size: var(--tqm-fs-xs);
}

.tqm-score-pass {
    background: var(--tqm-success-soft);
    color: var(--tqm-success);
}

.tqm-score-fail {
    background: var(--tqm-danger-soft);
    color: var(--tqm-danger);
}

/* ============================================================
   QUIZ FLOW
   ============================================================ */

.tqm-quiz-start {
    padding-top: 0.25rem;
}

.tqm-quiz-start .tqm-intro {
    margin-bottom: 1.5rem;
}

.tqm-quiz-area {
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--tqm-border);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tqm-quiz-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.85rem;
    background: var(--tqm-brand-navy);
    color: var(--tqm-white);
    border-radius: 999px;
    font-size: var(--tqm-fs-xs);
    font-weight: var(--tqm-fw-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tqm-quiz-progress-count {
    color: var(--tqm-white);
    font-weight: var(--tqm-fw-bold);
}

.tqm-quiz-title {
    text-align: left;
    color: var(--tqm-brand-navy);
    margin-bottom: 1rem;
}

.tqm-quiz-questions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tqm-question-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tqm-question-line {
    display: block;
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    background: var(--tqm-paper);
    border: 1px solid var(--tqm-border);
    border-left: 4px solid var(--tqm-brand-red);
    border-radius: var(--tqm-radius-lg);
    font-size: var(--tqm-fs-md);
    line-height: var(--tqm-line-body);
    color: var(--tqm-ink);
    box-sizing: border-box;
}

.tqm-question-num {
    display: block;
    margin-bottom: 0.5rem;
    font-size: var(--tqm-fs-xs);
    font-weight: var(--tqm-fw-bold);
    letter-spacing: var(--tqm-track-wide);
    text-transform: uppercase;
    color: var(--tqm-brand-red);
}

.tqm-question-text {
    display: block;
    font-weight: var(--tqm-fw-semibold);
    color: var(--tqm-brand-navy);
    font-size: var(--tqm-fs-md);
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Answer options list */
.tqm-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.tqm-option {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.9rem 1rem;
    text-align: left;
    font-family: var(--tqm-font-ui);
    font-size: var(--tqm-fs-base);
    font-weight: var(--tqm-fw-medium);
    line-height: var(--tqm-line-body);
    color: var(--tqm-ink);
    background: var(--tqm-white);
    border: 2px solid var(--tqm-border-mid);
    border-radius: var(--tqm-radius-lg);
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.tqm-option-letter {
    flex-shrink: 0;
    width: 2.125rem;
    height: 2.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tqm-brand-navy);
    color: var(--tqm-white);
    font-size: var(--tqm-fs-sm);
    font-weight: var(--tqm-fw-bold);
    line-height: 1;
}

.tqm-option-text {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.2rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.tqm-option:hover:not(:disabled) {
    background: var(--tqm-paper);
    border-color: var(--tqm-brand-navy);
    box-shadow: var(--tqm-shadow-sm);
    transform: translateY(-1px);
}

.tqm-option:hover:not(:disabled) .tqm-option-letter {
    background: var(--tqm-brand-red);
}

.tqm-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--tqm-coral-soft);
    border-color: var(--tqm-brand-navy);
}

.tqm-option:disabled {
    cursor: default;
    opacity: 0.92;
}

.tqm-option--correct {
    background: var(--tqm-success-soft) !important;
    border-color: var(--tqm-success) !important;
}

.tqm-option--correct .tqm-option-letter {
    background: var(--tqm-success) !important;
}

.tqm-option--correct .tqm-option-text {
    color: var(--tqm-success);
    font-weight: var(--tqm-fw-semibold);
}

.tqm-option--incorrect {
    background: var(--tqm-danger-soft) !important;
    border-color: var(--tqm-brand-red) !important;
}

.tqm-option--incorrect .tqm-option-letter {
    background: var(--tqm-brand-red) !important;
}

.tqm-option--incorrect .tqm-option-text {
    color: var(--tqm-brand-red);
}

.tqm-feedback {
    min-height: 1.5rem;
    margin-top: 1rem;
    padding: 0.65rem 1rem;
    font-size: var(--tqm-fs-sm);
    font-weight: var(--tqm-fw-semibold);
    border-radius: var(--tqm-radius);
    box-sizing: border-box;
}

.tqm-feedback--ok {
    color: var(--tqm-success);
    background: var(--tqm-success-soft);
    border: 1px solid var(--tqm-success);
}

.tqm-feedback--wrong {
    color: var(--tqm-brand-red);
    background: var(--tqm-danger-soft);
    border: 1px solid var(--tqm-brand-red);
}

.tqm-quiz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
    width: 100%;
}

.tqm-quiz-actions .tqm-btn {
    width: auto;
    min-width: 10rem;
    flex: 1 1 auto;
}

.tqm-quiz-result {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 2px solid var(--tqm-border);
}

/* ============================================================
   QUIZ DESIGN — mockup style
   ============================================================ */

#tqm-quiz-root.tqm-quiz-panel.tqm-shortcode {
    max-width: 640px;
    padding: 2rem 2.25rem 2.5rem;
    border: 0;
    border-radius: 20px;
    background: var(--tqm-white);
    box-shadow: 0 2px 40px rgba(0, 21, 102, 0.08);
    overflow: hidden;
}

#tqm-quiz-root.tqm-quiz-panel.tqm-shortcode::before {
    height: 4px;
    background: linear-gradient(90deg, var(--tqm-brand-navy) 60%, var(--tqm-brand-red) 100%);
    border-radius: 20px 20px 0 0;
}

.tqm-quiz-area {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.tqm-quiz-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tqm-quiz-progress {
    margin: 0;
    padding: 6px 14px;
    gap: 6px;
    background: var(--tqm-brand-navy);
    color: var(--tqm-white);
    border-radius: 20px;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.1em;
}

.tqm-quiz-progress-slash {
    opacity: 0.45;
    font-weight: var(--tqm-fw-regular);
}

.tqm-quiz-progress-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tqm-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tqm-border);
    transition: background 0.2s, opacity 0.2s;
}

.tqm-dot--active {
    background: var(--tqm-brand-navy);
}

.tqm-dot--done {
    background: var(--tqm-brand-navy-mid);
    opacity: 0.45;
}

.tqm-quiz-title {
    margin: 0 0 1.5rem;
    font-family: var(--tqm-font-display);
    font-size: 26px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--tqm-brand-navy);
}

.tqm-question-line {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--tqm-card-soft);
    border: 0;
    border-left: 3px solid var(--tqm-brand-red);
    border-radius: 14px;
}

.tqm-question-num {
    margin-bottom: 10px;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    color: var(--tqm-brand-red);
}

.tqm-question-text {
    font-size: 16px;
    font-weight: var(--tqm-fw-medium);
    line-height: 1.55;
    color: var(--tqm-brand-navy);
}

.tqm-options-list {
    gap: 10px;
}

.tqm-option {
    position: relative;
    align-items: flex-start;
    justify-content: flex-start !important;
    gap: 28px;
    padding: 14px 18px;
    text-align: left !important;
    overflow: hidden;
    background: var(--tqm-white);
    border: 1.5px solid var(--tqm-border);
    border-radius: 12px;
    transform: translateY(0);
    transition: border-color 0.18s, background 0.18s, transform 0.15s, box-shadow 0.18s, opacity 0.18s;
}

.tqm-option::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 21, 102, 0.06);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
}

.tqm-option:hover:not(:disabled) {
    background: var(--tqm-white);
    border-color: var(--tqm-brand-navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 21, 102, 0.1);
}

.tqm-option:hover:not(:disabled)::before {
    opacity: 1;
}

.tqm-option:hover:not(:disabled) .tqm-option-letter {
    background: var(--tqm-brand-navy);
    transform: scale(1.08);
}

.tqm-option-letter {
    position: relative;
    z-index: 1;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0 !important;
    background: var(--tqm-brand-navy);
    color: var(--tqm-white);
    font-size: 13px;
    font-weight: var(--tqm-fw-semibold);
    transition: background 0.18s, transform 0.15s;
}

.tqm-option-text {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 6px;
    text-align: left !important;
    font-size: 14.5px;
    font-weight: var(--tqm-fw-regular);
    line-height: 1.4;
    color: #1a1d2e;
}

.tqm-option-icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.tqm-option--locked {
    pointer-events: none;
}

.tqm-option--correct {
    background: var(--tqm-success-soft) !important;
    border-color: #2d7a3a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(30, 107, 46, 0.12);
}

.tqm-option--correct::before {
    opacity: 0;
}

.tqm-option--correct .tqm-option-letter {
    background: #2d7a3a !important;
    transform: scale(1.08);
}

.tqm-option--correct .tqm-option-text {
    color: #1e6b2e;
    font-weight: var(--tqm-fw-medium);
}

.tqm-option--correct .tqm-option-icon {
    color: #2d7a3a;
    opacity: 1;
}

.tqm-option--incorrect {
    background: rgba(175, 11, 0, 0.08) !important;
    border-color: var(--tqm-brand-red) !important;
}

.tqm-option--incorrect::before {
    opacity: 0;
}

.tqm-option--incorrect .tqm-option-letter {
    background: var(--tqm-brand-red) !important;
}

.tqm-option--incorrect .tqm-option-text,
.tqm-option--incorrect .tqm-option-icon {
    color: var(--tqm-brand-red);
}

.tqm-option--incorrect .tqm-option-icon {
    opacity: 1;
}

.tqm-option--dimmed {
    opacity: 0.4;
}

.tqm-feedback {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 1.25rem;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: var(--tqm-fw-medium);
    animation: tqmSlideUp 0.25s ease;
}

.tqm-feedback--show {
    display: flex !important;
}

.tqm-feedback-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: var(--tqm-fw-bold);
}

.tqm-feedback--ok {
    background: var(--tqm-success-soft);
    color: #1e6b2e;
    border: 1px solid #a8d5b0;
}

.tqm-feedback--ok .tqm-feedback-icon {
    background: #2d7a3a;
    color: var(--tqm-white);
}

.tqm-feedback--wrong {
    background: rgba(175, 11, 0, 0.08);
    color: var(--tqm-brand-red);
    border: 1px solid rgba(175, 11, 0, 0.28);
}

.tqm-feedback--wrong .tqm-feedback-icon {
    background: var(--tqm-brand-red);
    color: var(--tqm-white);
}

.tqm-quiz-actions {
    margin-top: 1.75rem;
    justify-content: flex-end;
}

.tqm-quiz-actions .tqm-btn {
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
    padding: 11px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: var(--tqm-fw-medium);
    letter-spacing: 0.01em;
    text-transform: none;
}

.tqm-quiz-actions .tqm-btn--secondary,
.tqm-quiz-actions .tqm-btn--primary {
    background: var(--tqm-brand-navy);
    color: var(--tqm-white);
    border-color: var(--tqm-brand-navy);
}

.tqm-quiz-actions .tqm-btn--secondary:hover,
.tqm-quiz-actions .tqm-btn--primary:hover {
    background: var(--tqm-brand-navy-mid);
    border-color: var(--tqm-brand-navy-mid);
    transform: translateX(2px);
}

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

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

#tqm-result {
    text-align: center;
    padding: 2rem 1rem 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--tqm-border);
}

#tqm-result .tqm-result-heading,
.tqm-result-heading {
    margin: 0 0 0.5rem;
    font-size: var(--tqm-fs-xxl);
    font-weight: var(--tqm-fw-bold);
    color: var(--tqm-navy-deep);
    line-height: var(--tqm-line-heading);
}

.tqm-result-status {
    margin: 0 0 1.25rem;
    font-size: var(--tqm-fs-lg);
    font-weight: var(--tqm-fw-medium);
    letter-spacing: 0.01em;
}

.tqm-pass { color: var(--tqm-success); }
.tqm-fail { color: var(--tqm-danger); }

.tqm-result-actions { margin: 0.75rem 0 0; }

.tqm-result-loading {
    font-size: var(--tqm-fs-base);
    font-style: italic;
    color: var(--tqm-ink-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    #tqm-quiz-root.tqm-shortcode,
    .tqm-form-container.tqm-shortcode,
    .tqm-shortcode.tqm-dashboard {
        padding: 1.75rem 1.25rem 2rem;
        margin: 1.25rem 0.75rem;
    }

    #tqm-quiz-root.tqm-quiz-panel.tqm-shortcode {
        padding: 1.5rem 1rem 1.75rem;
        margin: 1rem 0.5rem;
    }

    .tqm-option {
        padding: 0.75rem 0.85rem;
        gap: 0.65rem;
    }

    .tqm-option-letter {
        width: 1.875rem;
        height: 1.875rem;
        font-size: 0.75rem;
    }

    .tqm-quiz-actions {
        flex-direction: column;
    }

    .tqm-quiz-actions .tqm-btn {
        width: 100%;
        min-width: 0;
    }

    .tqm-shortcode.tqm-dashboard { max-width: 100%; }

    .tqm-result-heading,
    #tqm-result .tqm-result-heading {
        font-size: var(--tqm-fs-xl);
    }

    .tqm-dashboard-table th,
    .tqm-dashboard-table td {
        padding: 0.6rem 0.6rem;
        font-size: 0.75rem;
    }

    .tqm-dashboard-table a {
        padding: 0.3rem 0.5rem;
        font-size: 0.625rem;
    }

    .tqm-dash-stats { gap: 0.625rem; }

    .tqm-stat-card { min-width: 100px; padding: 0.875rem 0.75rem; }
}

@media print {
    .tqm-shortcode {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
