/* =========================================================
   Ontario Tech — RDM Finder (final cleaned)
   File: rdm-finder.css

   Palette:
     Primary   #003C71
     Secondary #0077CA
     Accent    #E75D2A

   Aakanksha Parekh, 2026
   ========================================================= */

/* CSS custom properties (design tokens) */
:root {
    /* Ontario Tech palette */
    --ot-primary:   #003C71;
    --ot-secondary: #0077CA;
    --ot-accent:    #E75D2A;

    /* Neutrals */
    --ink:    #003C71;
    --muted:  #5a6a7e;
    --border: #e0e5ef;
    --card:   #fff;
    --bg:     #fff;

    /* State colours */
    --ok:   #1b7f3a;
    --warn: #a66a00;
    --bad:  #b00020;

    /* Focus ring */
    --focus: rgba(0, 60, 113, .25);

    /* Card states */
    --ot-selected-fill:  #9AA8C8;
    --ot-disabled-fill:  #F3F5F8;
    --ot-disabled-text:  #B8C0CC;

    /* Question-level tooltip */
    --qtip-bg:     #f2f6fb;
    --qtip-border: #d9e7f5;
    --qtip-text:   var(--ot-secondary);

    /* Option-level tooltip */
    --optip-bg:     #f7f9fc;
    --optip-border: #d7e2ef;
    --optip-text:   #315b86;

    /* Validation boxes */
    --error-bg:     #fff6f6;
    --error-border: #f0d6d6;
    --error-text:   #8a1f1f;

    /* Accordion */
    --accordion-bg:       #f4f6f9;
    --accordion-bg-hover: #edf1f7;
    --accordion-border:   #dde2ed;
}

/* Enforce border-box sizing across the whole widget */
#ot-rdm-finder,
#ot-rdm-finder * {
    box-sizing: border-box;
}

/* Root widget element */
#ot-rdm-finder {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

#ot-rdm-finder a {
    color: var(--ot-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

#ot-rdm-finder a:hover {
    color: var(--ot-primary);
}

/* Centred content wrapper */
.ot-wrap {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 4px 0;
}

/* =========================================================
   HEADER INFORMATION BLOCK
   ========================================================= */

.ot-intro {
    margin: 0 0 20px;
    padding: 20px 24px;
    border: 1px solid #b8d8f5;
    border-left: 4px solid var(--ot-secondary);
    border-radius: 12px;
    background: #f0f7ff;
}

.ot-intro__body p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--ot-primary);
}

.ot-intro__body p:last-child {
    margin-bottom: 0;
}

.ot-intro__body a {
    color: var(--ot-secondary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ot-intro__body a:hover {
    color: var(--ot-primary);
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

/* Two-column grid: questions on the left, cards on the right */
.ot-grid {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 980px) {
    .ot-grid {
        grid-template-columns: 1fr;
    }
}

/* Step wrappers */
.ot-step--questions {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ot-step--providers {
    height: 100%;
}

.ot-step--compare {
    margin-top: 10px;
}

/* =========================================================
   STEP HEADERS
   ========================================================= */

.ot-stepbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.ot-stepbar h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--ot-primary);
    letter-spacing: -0.01em;
}

.ot-stepbar .ot-sub {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.ot-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.ot-btn {
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .08s ease, box-shadow .08s ease, background .08s ease, opacity .08s ease;
    letter-spacing: 0.01em;
}

.ot-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,.12);
}

.ot-btn:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.ot-btn--primary {
    background: var(--ot-primary);
    color: #fff;
}

.ot-btn--accent {
    background: var(--ot-accent);
    color: #fff;
}

.ot-btn--ghost {
    background: #fff;
    color: var(--ot-primary);
    padding: 7px 12px;
    font-size: 13px;
    border: 1.5px solid #c8d0de;
}

.ot-btn--primary:hover {
    background: #00345f;
}

.ot-btn--accent:hover {
    background: #d85326;
}

.ot-btn--ghost:hover {
    border-color: var(--ot-primary);
    background: #f4f6f9;
}

/* Download ghost buttons */
.ot-actions .ot-btn--ghost {
    background: #fff;
}

/* =========================================================
   STEP 1 — SCROLLABLE PANEL
   ========================================================= */

.ot-panel {
    background: transparent;
}

/* Fixed-height scroll container for the questions panel */
.ot-step1-scroll {
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    min-height: 980px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #c7cfdb transparent;
}

.ot-step1-scroll::-webkit-scrollbar {
    width: 7px;
}

.ot-step1-scroll::-webkit-scrollbar-thumb {
    background: #c7cfdb;
    border-radius: 10px;
}

.ot-step1-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* =========================================================
   QUESTION SECTIONS
   ========================================================= */

/* Each collapsible section card */
.ot-qsection {
    border: 1px solid var(--accordion-border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.ot-qsection__head {
    width: 100%;
    background: var(--accordion-bg);
    border: none;
    padding: 11px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    transition: background .15s ease;
    color: var(--ot-primary);
}

.ot-qsection__head:hover {
    background: var(--accordion-bg-hover);
}

.ot-qsection__head:focus {
    outline: 3px solid var(--focus);
    outline-offset: -3px;
}

.ot-qsection__headText {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ot-qsection__title {
    font-weight: 700;
    font-size: 14px;
    display: block;
    line-height: 1.2;
    color: var(--ot-primary);
}

/* Dead rule removed — .ot-qsection__sub is no longer used in JS */

.ot-qsection__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ot-qsection__count {
    font-size: 11px;
    font-weight: 700;
    background: var(--ot-primary);
    color: #fff;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.ot-qsection__arrow {
    font-size: 18px;
    color: var(--ot-accent);
    transition: transform .2s ease;
    transform-origin: center;
    line-height: 1;
}

/* Rotate the arrow icon when section is open */
.ot-qsection--open .ot-qsection__arrow {
    transform: rotate(90deg);
}

/* Animated expand/collapse via grid-template-rows */
.ot-qsection__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .25s ease, padding .25s ease;
    padding: 0 14px;
}

.ot-qsection__body > * {
    min-height: 0;
}

.ot-qsection__body--open {
    grid-template-rows: 1fr;
    padding: 12px 14px;
}

/* =========================================================
   QUESTION ACCORDION
   ========================================================= */

.ot-q {
    border-bottom: 1px solid #edf0f5;
    padding: 8px 0;
}

.ot-q:last-child {
    border-bottom: none;
}

.ot-qhead {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    padding: 6px 0;
    text-align: left;
    gap: 12px;
}

.ot-qhead:hover {
    opacity: .88;
}

.ot-qhead:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 8px;
}

.ot-qhead__main {
    display: flex;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.ot-qnum {
    font-weight: 800;
    font-size: 16px;
    color: var(--ot-accent);
    flex: 0 0 auto;
    min-width: 22px;
}

.ot-qlabelWrap {
    min-width: 0;
    flex: 1 1 auto;
}

.ot-qlabelRow {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.ot-qlabel {
    flex: 1 1 auto;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    color: var(--ot-primary);
}

.ot-qmeta {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 0;
    flex: 0 0 auto;
    padding-top: 1px;
}

.ot-qarrow {
    font-size: 18px;
    color: var(--ot-accent);
    margin-left: 10px;
    flex: 0 0 auto;
    transition: transform .2s ease;
    transform-origin: center;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

.ot-q--open .ot-qarrow {
    transform: rotate(90deg);
}

/* =========================================================
   TOOLTIP BUTTONS
   ========================================================= */

/* Circular "i" info button for question-level tooltips */
.ot-info {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid var(--qtip-border);
    background: var(--qtip-bg);
    display: inline-grid;
    place-items: center;
    font-weight: 900;
    cursor: pointer;
    flex: 0 0 auto;
    color: var(--qtip-text);
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
    line-height: 1;
}

.ot-info:hover {
    background: #d9ecf9;
    border-color: #9ecbee;
    transform: translateY(-1px);
}

.ot-info:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* Option-level tooltip buttons (slightly smaller) */
.ot-opt .ot-info {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 12px;
    background: var(--optip-bg) !important;
    border-color: var(--optip-border) !important;
    color: var(--optip-text) !important;
    line-height: 1 !important;
}

.ot-opt .ot-info:hover {
    background: #ddeef8 !important;
    border-color: #b0cfe6 !important;
}

.ot-info--option {
    font-size: 11px;
    font-weight: 900;
}

/* =========================================================
   OPTIONS
   ========================================================= */

/* Animated expand for option lists */
.ot-opts {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .22s ease, margin-top .22s ease, padding-top .22s ease;
    margin-top: 0;
    padding-left: 28px;
}

.ot-opts > * {
    min-height: 0;
}

.ot-opts--open {
    grid-template-rows: 1fr;
    margin-top: 6px;
}

.ot-opt {
    display: flex;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ot-primary);
    align-items: flex-start;
}

.ot-opt:last-child {
    margin-bottom: 0;
}

.ot-opt input {
    margin-top: 3px;
    transform: scale(1.05);
    accent-color: var(--ot-secondary);
    flex: 0 0 auto;
}

.ot-opt > div {
    flex: 1 1 auto;
    min-width: 0;
}

.ot-opt > div > div {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ot-opt span {
    display: inline-block;
    min-width: 0;
    word-break: break-word;
}

/* =========================================================
   RIGHT SIDE — CARDS
   ========================================================= */

/* Responsive card grid */
.ot-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 12px;
}

@media (max-width: 1200px) {
    .ot-cards {
        grid-template-columns: repeat(3, minmax(190px, 1fr));
    }
}

@media (max-width: 980px) {
    .ot-cards {
        grid-template-columns: repeat(2, minmax(190px, 1fr));
    }
}

@media (max-width: 560px) {
    .ot-cards {
        grid-template-columns: 1fr;
    }
}

.ot-card {
    position: relative;
    border: 1.5px solid #d4dae8;
    border-radius: 12px;
    padding: 14px 14px 16px;
    background: #FBFCFE;
    min-height: 150px;
    cursor: pointer;
    transition: transform .1s ease, border-color .1s ease, box-shadow .1s ease;
}

.ot-card:hover {
    transform: translateY(-2px);
    border-color: var(--ot-secondary);
    box-shadow: 0 4px 12px rgba(0, 60, 113, .10);
}

.ot-card--selected {
    background: var(--ot-selected-fill);
    border-color: var(--ot-primary);
    box-shadow: 0 2px 8px rgba(0, 60, 113, .18);
}

.ot-card--selected .ot-card__title,
.ot-card--selected .ot-card__desc,
.ot-card--selected .ot-card__category {
    color: #0B1B3A !important;
}

.ot-card--disabled {
    opacity: 1;
    filter: none;
    cursor: not-allowed;
    background: var(--ot-disabled-fill);
    border-color: #e3e7ef;
    box-shadow: none;
    transform: none !important;
}

/* FIX: suppress hover border-color change on disabled cards */
.ot-card--disabled:hover {
    border-color: #e3e7ef;
    box-shadow: none;
}

.ot-card--disabled .ot-card__title,
.ot-card--disabled .ot-card__desc,
.ot-card--disabled .ot-card__category {
    color: var(--ot-disabled-text) !important;
}

/* Category label badge at top of card */
.ot-card__category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ot-secondary);
    margin-bottom: 6px;
    margin-right: 28px;
    display: block;
}

/* Card selection circle (top-right corner) */
.ot-card__radio {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid #b8c2d4;
    background: transparent;
    transition: border-color .1s ease, background .1s ease;
}

.ot-card--selected .ot-card__radio {
    border-color: #0B1B3A;
    background: #0B1B3A;
    display: grid;
    place-items: center;
}

/* Checkmark inside selected radio circle */
.ot-card--selected .ot-card__radio::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg);
}

.ot-card--disabled .ot-card__radio {
    border-color: #d0d6e0;
    background: transparent;
}

.ot-card__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    padding-right: 28px;
    color: var(--ot-primary);
}

.ot-card__desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--muted);
}

/* =========================================================
   COMPARE TABLE
   ========================================================= */

.ot-compare {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.ot-compare h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--ot-primary);
}

.ot-tableWrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.ot-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1050px;
}

.ot-table th,
.ot-table td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 13px;
}

.ot-table th {
    background: #f0f4fa;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ot-primary);
}

.ot-table tr:last-child td {
    border-bottom: 0;
}

.ot-table tbody tr:hover {
    background: #f8fafd;
}

.ot-table a {
    color: var(--ot-secondary);
    font-weight: 600;
}

.ot-cell-muted {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-top: 2px;
}

/* =========================================================
   MODAL TOOLTIP
   ========================================================= */

.ot-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.ot-modal[aria-hidden="false"] {
    display: block;
}

.ot-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 30, 60, .5);
}

.ot-dialog {
    position: relative;
    width: min(680px, calc(100% - 24px));
    margin: 12vh auto 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(0, 30, 60, .22);
    z-index: 9;
}

.ot-dhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.ot-dhead strong {
    font-weight: 800;
    font-size: 15px;
    color: var(--ot-primary);
}

.ot-dbody {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ot-primary);
    white-space: pre-wrap;
}

/* =========================================================
   VALIDATION
   ========================================================= */

/* Hide empty containers automatically */
#otValidation:empty {
    display: none;
}

#otValidation > div {
    border: 1px solid var(--error-border);
    background: var(--error-bg);
    border-radius: 8px;
    padding: 12px;
}

#otValidation strong {
    display: block;
    margin-bottom: 6px;
    color: var(--error-text);
}

#otValidation div div {
    font-size: 14px;
    line-height: 1.45;
    color: var(--ot-primary);
}

#otEmailResults {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   SMALL-SCREEN REFINEMENTS
   ========================================================= */

@media (max-width: 720px) {
    .ot-stepbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ot-actions {
        justify-content: flex-start;
    }

    .ot-table {
        min-width: 860px;
    }

    .ot-dialog {
        margin-top: 8vh;
    }

    /* Disable the fixed-height scroll on small screens */
    .ot-step1-scroll {
        height: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .ot-qsection__head {
        align-items: flex-start;
    }

    .ot-qhead__main {
        gap: 8px;
    }

    .ot-opts {
        padding-left: 24px;
    }
}
