/*
 * Driving Test Portal — Ontario legacy-page overrides.
 *
 * The exam, question bank, settings and mobile-app pages still run on
 * the original cloned Materialize/jQuery markup (materialize.min.css,
 * style.css) because exam.js and countdown360.js are wired directly to
 * that markup's exact classes/IDs - none of that structure changes here.
 *
 * This file only recolors/retypes those pages so they read as part of
 * the new design system (theme.css, used by the nav/footer partials and
 * the homepage): same font family, same primary/gold palette, same
 * pill-shaped buttons. Every rule below targets an EXISTING selector -
 * nothing new is introduced that exam.js/countdown360.js would need to
 * know about.
 */

body {
    font-family: 'Inter', 'Roboto', sans-serif;
}

.header-content h3,
.header-content h4,
.app-feature-heading h2,
.app-contet-wrap h4,
.links-list .features h2,
.image-list h4 {
    font-family: 'Sora', 'Inter', sans-serif;
    color: var(--dtp-ink, #10151F);
}

/* page intro banner (question bank / exam / settings) */
.header-content {
    background: var(--dtp-panel-bg, #fff);
    border-bottom: 1px solid var(--dtp-panel-border, rgba(16, 21, 31, .08));
    padding: 48px 0 32px;
}
.header-content h3 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.header-content h6 { color: var(--dtp-muted, rgba(16, 21, 31, .6)); font-weight: 400; }

/* buttons - materialize's teal swapped for the new primary/gold pair */
.btn-large,
.modal-btn,
.exam-start-btn,
.review-exam-btn,
.review-exam-btn-home,
.review-exam-btn-try {
    background-color: var(--dtp-primary, #0B4DA1) !important;
    border-radius: 999px !important;
    font-weight: 700;
    box-shadow: none !important;
}
.btn-large:hover,
.modal-btn:hover {
    background-color: var(--dtp-primary, #0B4DA1) !important;
    opacity: .9;
}
.btn-large.waves-effect .waves-ripple,
.modal-btn.waves-effect .waves-ripple {
    background-color: rgba(255, 255, 255, .35);
}

/* tabs (question bank Q&A/Signs, settings contact/disclaimer) */
.tabs .tab a,
.more-tabs .tab a {
    color: var(--dtp-muted, rgba(16, 21, 31, .6));
}
.tabs .tab a.active,
.more-tabs .tab a.active {
    color: var(--dtp-primary, #0B4DA1);
}
.tabs .indicator {
    background-color: var(--dtp-primary, #0B4DA1);
}

/* form fields (question bank filters, contact form) */
.qb-filters { width: 100%; margin-bottom: 10px; }
.qb-filter-field { margin-bottom: 16px; }
.qb-filter-field label { display: block; font-size: 12px; color: #777; margin-bottom: 4px; }
.qb-filter-field select,
.qb-filter-field input {
    display: block; width: 100%; height: 36px;
    border: 1px solid var(--dtp-panel-border, #ccc); border-radius: 8px; padding: 0 10px;
    background-color: var(--dtp-panel-bg, #fff);
    color: var(--dtp-ink, #10151F);
}
.qb-filter-field select option {
    background-color: var(--dtp-panel-bg, #fff);
    color: var(--dtp-ink, #10151F);
}
.qb-filter-field select:focus,
.qb-filter-field input:focus,
.qb-filter-field textarea.dtp-textarea:focus {
    border-color: var(--dtp-primary, #0B4DA1);
}
.qb-filter-field textarea.dtp-textarea {
    display: block; width: 100%; min-height: 100px;
    border: 1px solid var(--dtp-panel-border, #ccc); border-radius: 8px; padding: 10px;
    font-family: inherit; resize: vertical;
}
.dtp-field-error { display: block; color: #c0392b; font-size: 12px; margin-top: 4px; }
.dtp-form-success {
    background: #e3f7e9; border: 1px solid #9C3; color: #2d6a3e;
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
}

/* question bank sign placeholder - shown only when no real image has
   been supplied yet for that sign (see traffic-sign-image partial) */
.qb-sign-placeholder {
    display: inline-block; background: #eee; border-radius: 4px;
    padding: 4px 10px; font-size: 12px; color: #777; margin-bottom: 6px;
}
.qb-sign-img img {
    border-radius: 8px;
    border: 1px solid var(--dtp-panel-border, #e0e0e0);
    display: block;
}

/* Pagination: Laravel's default pagination view is written for
   Tailwind (classes like "sm:hidden", "w-5 h-5", "dark:bg-gray-700").
   None of that CSS is loaded on this site, so every Tailwind utility
   class here is inert - both of its mobile/desktop blocks render at
   once (plain block, not hidden), its icons have no size, and its
   <nav> picks up Materialize's default pink background. This section
   hides the redundant mobile block, forces the desktop block (the one
   with page numbers) to lay out as a row, and styles it to match the
   new design - the markup/classes themselves are untouched. */
.qb-pagination { clear: both; margin: 24px 0 40px; }
.qb-pagination nav {
    background: transparent;
    box-shadow: none;
}
.qb-pagination nav > div:first-child {
    display: none;
}
.qb-pagination nav > div:last-child {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.qb-pagination nav p,
.qb-pagination nav span {
    font-size: 13px;
    color: var(--dtp-muted, rgba(16, 21, 31, .6));
}
.qb-pagination nav > div:last-child > div:last-child {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.qb-pagination nav a,
.qb-pagination nav span[aria-current="page"],
.qb-pagination nav span:has(svg) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dtp-ink, #10151F);
}
.qb-pagination nav a:hover {
    background: var(--dtp-tint-bg, rgba(16, 21, 31, .06));
}
.qb-pagination nav span[aria-current="page"] {
    background: var(--dtp-primary, #0B4DA1);
    color: #fff;
}
.qb-pagination nav span:has(svg) {
    color: var(--dtp-muted-faint, rgba(16, 21, 31, .35));
    cursor: default;
}
.qb-pagination nav svg {
    width: 16px;
    height: 16px;
}

/* exam: keep every exam.js-targeted class/structure exactly as-is, just
   recolor the live/active states so they match the new palette instead
   of materialize's default teal/yellow. */
.answer label.ans-active {
    border-color: var(--dtp-primary, #0B4DA1) !important;
}
.timer-border { border-color: var(--dtp-primary, #0B4DA1) !important; }
.second-show { color: var(--dtp-primary, #0B4DA1); }
#exam-instructions-modal,
#examsucess-model .fail-modal-content,
#examfail-model .fail-modal-content {
    font-family: 'Inter', 'Roboto', sans-serif;
}
#exam-instructions-modal h5 {
    font-family: 'Sora', 'Inter', sans-serif;
}

/* sidebar "download the app" widget shown on exam/question-bank/settings */
.custom-adv .download-app-title h4 {
    font-family: 'Sora', 'Inter', sans-serif;
    color: var(--dtp-ink, #10151F);
}

/* mobile-app landing page feature bands */
.app-top-content .inner-bg,
.app-feature-wrap {
    background-color: var(--dtp-bg, #FBFAF8);
}
.app-feature-wrap.feature-1-bg {
    background-color: var(--dtp-tint-bg, #FFF3D6);
}
.app-contet-wrap p,
.app-call-action-txt {
    color: var(--dtp-muted, rgba(16, 21, 31, .6));
}

/* Dark mode: the original theme hardcodes light-mode-only text and
   background colors on the question bank list items and the
   "Download Mobile App" sidebar widget (#151515/#333/#666 text,
   #fff/#F6F6F6 backgrounds). These make them follow the new theme in
   dark mode instead of staying stuck at their light-mode values. */
:root[data-theme="dark"] .que-ans li label,
:root[data-theme="dark"] .que-sign.animated.fadeIn li label {
    color: var(--dtp-ink);
}
:root[data-theme="dark"] .que-ans li p,
:root[data-theme="dark"] .que-sign li p {
    color: var(--dtp-muted);
}
:root[data-theme="dark"] .que-ans,
:root[data-theme="dark"] .que-ans li,
:root[data-theme="dark"] .que-sign {
    border-color: var(--dtp-panel-border);
}
:root[data-theme="dark"] .que-sign li:nth-of-type(4n+2),
:root[data-theme="dark"] .que-sign li:nth-of-type(4n+3) {
    background: var(--dtp-panel-bg);
}
:root[data-theme="dark"] .advertisement li,
:root[data-theme="dark"] .advertisement li.widget-wrap {
    background: var(--dtp-panel-bg);
}

/* Dark mode: the exam page's instructions/success/fail modals are
   Materialize ".modal" elements with a hardcoded off-white background
   (#fafafa) and hardcoded dark text (#333/#666 on ".modal-content h5"
   and ".frm-change-lang"), so they stayed a bright white card floating
   on the dark page. Same fix for the actual question/answer text
   (".main-que p" is the question, ".answer ul li label p" is each
   option), which was hardcoded to #333/#666 and unreadable on dark. */
:root[data-theme="dark"] .modal {
    background-color: var(--dtp-panel-bg);
}
:root[data-theme="dark"] .modal-content h5 {
    color: var(--dtp-ink);
    border-bottom-color: var(--dtp-panel-border);
}
:root[data-theme="dark"] .frm-change-lang {
    background: var(--dtp-panel-bg);
}
:root[data-theme="dark"] .frm-change-lang p {
    color: var(--dtp-muted);
}
:root[data-theme="dark"] .main-que p,
:root[data-theme="dark"] .que-sign li p {
    color: var(--dtp-ink);
}
:root[data-theme="dark"] .answer ul li label p {
    color: var(--dtp-ink);
}
:root[data-theme="dark"] .answer ul li label {
    border-color: var(--dtp-panel-border);
}
:root[data-theme="dark"] .answer ul li label:hover {
    border-color: var(--dtp-muted-faint);
}
/* the "1/2/3/4" option-number icon is a flat PNG (dark ink, light-grey
   ring) drawn for a light page - invert it so the ring/number read on
   the dark background instead of disappearing into it. */
:root[data-theme="dark"] .answer ul li label .show-img {
    filter: invert(1);
}

/* Settings & Help: the whole page sits inside Materialize's white
   ".card-panel", with the sidebar tabs, section borders and base text
   all hardcoded to light-mode greys (#fff/#F6F6F6/#e6e6e6/#333) - none
   of it switched with the rest of the page. */
:root[data-theme="dark"] .more-menu {
    color: var(--dtp-ink);
}
:root[data-theme="dark"] .card-panel,
:root[data-theme="dark"] #section {
    background-color: var(--dtp-panel-bg);
}
:root[data-theme="dark"] ul.more-tabs {
    background-color: var(--dtp-panel-bg);
    border-color: var(--dtp-panel-border);
}
:root[data-theme="dark"] .more-tabs li a.active,
:root[data-theme="dark"] .more-tabs li:first-child a.active {
    background: var(--dtp-tint-bg);
}
:root[data-theme="dark"] .more-tabs li:first-child a.active,
:root[data-theme="dark"] .more-tabs li a.active {
    border-left-color: var(--dtp-primary);
}
:root[data-theme="dark"] .more-tabs li p {
    color: var(--dtp-ink);
}
:root[data-theme="dark"] .more-tabs li a:after {
    background: var(--dtp-panel-bg);
    border-bottom-color: var(--dtp-panel-border);
}
:root[data-theme="dark"] .more-menu-content #attention,
:root[data-theme="dark"] .more-menu-content #contact,
:root[data-theme="dark"] .more-menu-content .container h4,
:root[data-theme="dark"] #attention .container h4,
:root[data-theme="dark"] #contact .container h4 {
    border-color: var(--dtp-panel-border);
}
