.gpt-result-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #e9f3ea;
    padding: 22px;
    border-radius: 16px;
    border: 1px solid #d3e4d6;
    min-height: 680px;
}

.gpt-result-form-container {
    position: relative;
    background: transparent;

    /*padding: 40px;*/
}

/* Loading overlay shown over the form while a lookup is in flight. */
.gpt-form-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border-radius: 14px;
}

.gpt-result-form-container.is-submitting .gpt-form-loader {
    display: flex;
}

.gpt-form-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #237a3c;
    font-size: 16px;
    font-weight: 700;
}

.gpt-form-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(35, 122, 60, 0.2);
    border-top-color: #237a3c;
    border-radius: 50%;
    animation: gpt-captcha-spin .7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .gpt-form-spinner {
        animation: none;
    }
}

.result-wrapper {
    min-height: 530px;
}

/* ============================================================
   Header: logo + title card.
   ============================================================ */
.gpt-result-header {
    background: transparent;
    padding: 4px 4px 0;
    display: flex;
    align-items: center;
    gap: 26px;
    margin-bottom: 22px;
}

@media(max-width: 560px) {
    .gpt-result-header {
        gap: 16px;
    }
}


/* ============================================================
   Lookup form — matches the official blue reference layout.
   ============================================================ */
#gpt-result-form {
    --gpt-blue: #237a3c;
    --gpt-blue-hover: #1b5e2e;
    --gpt-border: #d5dbe4;
    --gpt-label: #5b6472;
    padding: 32px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9f8 100%);
    border: 1px solid #e4e8e5;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(20, 60, 30, 0.05);
}

/* Two-column rows with independent widths per row. */
.gpt-form-row {
    display: grid;
    gap: 22px;
}

/* Individual / Institution mode toggle. */
.gpt-mode-toggle {
    display: flex;
    gap: 8px;
    background: #eef3ef;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 22px;
}

.gpt-mode-btn {
    flex: 1 1 0;
    padding: 10px 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #3c5a45;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.gpt-mode-btn.is-active {
    background: #237a3c;
    color: #fff;
    box-shadow: 0 1px 3px rgba(20, 60, 30, 0.2);
}

@media(max-width: 480px) {
    .gpt-mode-btn {
        font-size: 12.5px;
        padding: 9px 6px;
    }
}

/* Institution (EIIN) result — the board sends this as ready-made HTML, so we
   only lightly frame it to sit inside the plugin's card styling. */
.gpt-inst-result-content {
    overflow-x: auto;
    margin: 10px 0;
}

.gpt-pdf-cache-note {
    text-align: center;
    color: #6b6b6b;
    font-size: 13px;
    font-style: italic;
    margin: 6px 0 0;
}

.gpt-inst-result-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.gpt-inst-result-content th,
.gpt-inst-result-content td {
    border: 1px solid #d5dbe4;
    padding: 6px 10px;
    text-align: left;
}

.gpt-inst-result-content th {
    background: #eef3ef;
}

/* Parsed institution summary card (replaces the raw text dump when the
   board's text format is recognized). */
.gpt-inst-school-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f5f9f6;
    border: 1px solid #d9e6dc;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0 18px;
    box-shadow: 0 2px 8px rgba(20, 60, 30, 0.06);
}

.gpt-inst-school-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #dcefe1;
    color: #237a3c;
}

.gpt-inst-school-details {
    min-width: 0;
}

.gpt-inst-school-name {
    font-weight: 700;
    font-size: 16px;
    color: #1c3d29;
}

.gpt-inst-eiin-badge {
    display: inline-block;
    background: #237a3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

.gpt-inst-school-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gpt-inst-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: #55655a;
}

.gpt-inst-meta-item svg {
    flex: 0 0 auto;
}

.gpt-inst-section-title {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #3c5a45;
    margin: 18px 0 10px;
}

.gpt-inst-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
}

.gpt-inst-stat-card {
    background: #fff;
    border: 1px solid #e1e8e3;
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(20, 60, 30, 0.05);
}

.gpt-inst-stat-icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.gpt-inst-stat-blue   .gpt-inst-stat-icon { background: #e8eefd; color: #3b5bdb; }
.gpt-inst-stat-indigo .gpt-inst-stat-icon { background: #ece9fd; color: #6741d9; }
.gpt-inst-stat-green  .gpt-inst-stat-icon { background: #e3f6e8; color: #1c8a3c; }
.gpt-inst-stat-teal   .gpt-inst-stat-icon { background: #e1f6f3; color: #10917f; }
.gpt-inst-stat-gold   .gpt-inst-stat-icon { background: #fdf3e0; color: #b3821b; }
.gpt-inst-stat-gray   .gpt-inst-stat-icon { background: #eef0f1; color: #667; }

.gpt-inst-stat-val {
    font-size: 20px;
    font-weight: 700;
    color: #1c3d29;
}

.gpt-inst-stat-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7a70;
    margin-top: 2px;
}

.gpt-inst-table-wrap {
    overflow-x: auto;
}

.gpt-inst-group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(20, 60, 30, 0.05);
}

.gpt-inst-group-table th,
.gpt-inst-group-table td {
    border: 1px solid #d5dbe4;
    padding: 10px 12px;
    text-align: center;
}

.gpt-inst-group-table .gpt-inst-gt-name {
    text-align: left;
    font-weight: 600;
}

.gpt-inst-group-table th {
    background: #237a3c;
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.gpt-inst-group-table tbody tr:nth-child(even) {
    background: #f7faf7;
}

.gpt-inst-pill {
    display: inline-block;
    min-width: 28px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef3ef;
    border: 1px solid #237a3c;
    color: #237a3c;
    font-weight: 700;
    font-size: 13px;
}

.gpt-inst-raw-fallback {
    margin-top: 16px;
    border: 1px dashed #c9d6cc;
    border-radius: 8px;
    padding: 8px 12px;
}

.gpt-inst-raw-fallback summary {
    cursor: pointer;
    font-size: 12.5px;
    color: #6b7a70;
}

.gpt-inst-raw-fallback .gpt-inst-result-content {
    margin-top: 8px;
}

@media(max-width: 480px) {
    .gpt-inst-school-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .gpt-inst-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 560px) {
    .gpt-form-row {
        gap: 0;
    }
}

.row-board-year {
    grid-template-columns: 1.7fr 1fr;
}

.row-roll-reg {
    grid-template-columns: 1fr 1fr;
}

.form-field-wrap {
    display: flex;
    flex-direction: column;
    margin-bottom: 22px;
    min-width: 0;
}

/* Uppercase section labels above the selects. */
.gpt-cap-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--gpt-label);
    margin-bottom: 10px;
}

/* Native controls, restyled. */
#gpt-result-form select,
#gpt-result-form input {
    width: 100%;
    font-size: 17px;
    color: #1a2233 !important;
    background: #fff !important;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
    margin-bottom: 0 !important;
}

/* Select boxes with a custom chevron. */
.gpt-select-wrap {
    position: relative;
}

.gpt-select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 12px;
    height: 8px;
    transform: translateY(-50%);
    pointer-events: none;
    background: no-repeat center/contain
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
}

#gpt-result-form select {
    height: 62px !important;
    padding: 0 44px 0 20px;
    font-weight: 500;
    border: 1.5px solid var(--gpt-border);
    border-radius: 10px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

#gpt-result-form select:hover {
    border-color: #b7c0cf;
}

#gpt-result-form select:focus,
#gpt-result-form input:focus {
    outline: none;
    border-color: var(--gpt-blue);
    box-shadow: 0 0 0 3px rgba(35, 122, 60, 0.16);
}

/* Floating-label fields (Roll / Registration).
   The label sits like a placeholder and animates up on focus/fill. */
.gpt-float-field {
    position: relative;
}

.gpt-float-field input {
    height: 64px !important;
    padding: 22px 18px 8px !important;
    border: 1.5px solid var(--gpt-border);
    border-radius: 10px !important;
    font-size: 19px;
    font-weight: 700;
}

.gpt-float-field input:hover {
    border-color: #b7c0cf;
}

.gpt-float-field label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: #8a93a3;
    background: #fff;
    pointer-events: none;
    transition: top .16s ease, font-size .16s ease, color .16s ease;
}

/* Float up when the field is focused or already has a value. */
.gpt-float-field input:focus + label,
.gpt-float-field input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--gpt-blue);
}

.form-field-wrap.has-error .gpt-float-field label {
    color: #d63638;
}

.field-help {
    font-size: 13px;
    color: #97a0af;
    margin-top: 0;
}

/* Invalid-field state (set by JS validation). */
#gpt-result-form .form-field-wrap.has-error select,
#gpt-result-form .form-field-wrap.has-error .gpt-float-field input,
#gpt-result-form .form-field-wrap.has-error #captcha {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.14);
}

.field-error {
    display: none;
    color: #d63638;
    font-size: 13px;
    margin-top: 7px;
    line-height: 1.3;
}

.form-field-wrap.has-error .field-error {
    display: block;
}

/* Action buttons. */
.gpt-form-actions {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}

.gpt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 30px;
    font-size: 18px;
    font-weight: 700;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    line-height: 1;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.gpt-btn svg {
    flex: 0 0 auto;
}

.gpt-btn-primary {
    flex: 1 1 auto;
    background: var(--gpt-blue);
    color: #fff;
}

.gpt-btn-primary:hover {
    background: var(--gpt-blue-hover);
    color: #fff;
}

.gpt-btn-ghost {
    flex: 0 0 auto;
    min-width: 150px;
    background: #eef4ef;
    color: var(--gpt-blue);
    border-color: #bcd6c2;
}

.gpt-btn-ghost:hover {
    background: #e2eee4;
    border-color: var(--gpt-blue);
    color: var(--gpt-blue-hover);
}

@media (max-width: 560px) {
    .row-board-year,
    .row-roll-reg {
        grid-template-columns: 1fr;
    }

    #gpt-result-form {
        padding: 20px;
    }

    .gpt-form-actions {
        flex-direction: column;
    }

    .gpt-btn-ghost {
        width: 100%;
    }
}

.gpt-result-title {
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0) 12%, rgba(0, 0, 0, 0) 88%, rgba(0, 0, 0, 0.20)),
        linear-gradient(180deg, #2c7d43 0%, #1b5a2e 100%);
    padding: 26px 34px;
    flex: 2;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 14px rgba(20, 72, 38, 0.22);
}

.gpt-result-title h2 {
    color: #e6c56e;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.gpt-result-title p {
    color: rgba(255, 255, 255, 0.92);
    font-size: 17px;
    margin: 4px 0 0;
}

@media(max-width: 560px) {
    .gpt-result-title {
        padding: 18px 20px;
    }

    .gpt-result-title h2 {
        font-size: 22px;
    }

    .gpt-result-title p {
        font-size: 14px;
    }
}

h3.exam-title {
    text-align: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.gpt-result-button-container {
    display: flex;
    justify-content: center;
    margin: 18px 0;
}

.gpt-result-button-container button {
    padding: 10px 26px;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.4;
}

.gpt-result-button-container .search-again-btn {
    background-color: #22a35a;
    border-radius: 22px 0 0 22px;
}

.gpt-result-button-container .print-btn {
    background-color: #5b9bd5;
    border-radius: 0 22px 22px 0;
}

.gpt-result-button-container .search-again-btn:hover {
    background-color: #1f9350;
    color: #fff;
}

.gpt-result-button-container .print-btn:hover {
    background-color: #4a8ac4;
    color: #fff;
}

/* Fallback when the print popup is blocked and window.print() runs on the page itself. */
@media print {
    .gpt-result-header,
    .gpt-result-form-container,
    .gpt-result-button-container {
        display: none !important;
    }
}

.gpt-result-subject-details table tr td {
    padding: 2px 15px !important;
    font-size: 16px;
}

table.gpt-result-info-table {
    border: 1px solid #ccc;
}

table.gpt-result-info-table tr:nth-child(even) td {
     border-right-color: #fff !important;
}

table.gpt-result-info-table tr td, table.gpt-result-info-table tr th {
    padding: 2px 15px !important;
    font-size: 16px;
    border-bottom: 1px solid #fff !important;
    border-right: 1px solid #fff !important;
}

table.gpt-result-info-table tr td:last-child, table.gpt-result-info-table tr th:last-child {
    border-right: 0;
}

.gpt-result-subject-details tr.black12bold td {
    font-weight: 600;
    font-size: 16px;
    color: #000 !important;
}

/* Result tables — match the official board layout */
table.gpt-result-info-table,
table.gpt-result-subject-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

table.gpt-result-info-table thead.section-head th {
    background: #1f9d55;
    color: #fff !important;
    text-align: left;
    font-size: 18px !important;
    font-weight: 700;
    padding: 14px 15px !important;
    border: 0 !important;
}

table.gpt-result-info-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

table.gpt-result-info-table tbody tr:nth-child(even) td {
    background: #f6f6f6;
}

table.gpt-result-info-table tbody td {
    border: 0 !important;
    padding: 12px 15px !important;
    vertical-align: middle;
}

.subject-title {
    text-align: center;
    font-size: 20px;
    margin: 18px 0 10px;
}

table.gpt-result-subject-table thead th {
    background: #1f9d55;
    color: #fff !important;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 15px !important;
}

table.gpt-result-subject-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

table.gpt-result-subject-table tbody tr:nth-child(even) td {
    background: #f6f6f6;
}

table.gpt-result-subject-table tbody td {
    padding: 12px 15px !important;
    font-size: 16px;
    border: 0 !important;
}

.gpt-result-subject-details {
    border-bottom: 3px solid #1f9d55;
    padding-bottom: 4px;
}

.gpt-result-output.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-top: 15px;
    border-radius: 5px;
}

/* Captcha — image + reload grouped in a box on the left, input on the right. */
.gpt-captcha-grid {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 22px;
    align-items: stretch;
}

.gpt-captcha-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px;
    background: #f5f7fa;
    border: 1.5px solid var(--gpt-border);
    border-radius: 10px;
    min-width: 240px;
}

/* "Loading…" overlay shown while a fresh captcha is being fetched. */
.gpt-captcha-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    /*justify-content: center;*/
    padding-left: 30px;
    background: rgba(245, 247, 250, 1);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--gpt-blue);
}

.gpt-captcha-loading::before {
    content: "";
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 2px solid rgba(0, 120, 21, 0.3);
    border-top-color: var(--gpt-blue);
    border-radius: 50%;
    animation: gpt-captcha-spin .6s linear infinite;
}

.gpt-captcha-box.is-loading .gpt-captcha-loading {
    display: flex;
}

@keyframes gpt-captcha-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .gpt-captcha-loading::before {
        animation: none;
    }
}

#gpt-captcha-img {
    width: 160px;
    aspect-ratio: 160 / 70;
    min-width: 0;
    object-fit: contain;
    border-radius: 6px;
    background: #e9edf2;
}

#gpt-captcha-img.is-loading {
    opacity: 0.4;
}

#gpt-captcha-reload {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    background: #fff;
    color: var(--gpt-blue);
    border: 1.5px solid var(--gpt-blue);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s ease;
}

#gpt-captcha-reload:hover:not(:disabled) {
    background: #eef4ef;
}

#gpt-captcha-reload:disabled {
    opacity: 0.55;
    cursor: default;
}

.gpt-captcha-grid #captcha {
    height: 74px;
    padding: 0 22px;
    font-size: 17px;
    border: 1.5px solid var(--gpt-border);
    border-radius: 10px !important;
}

.gpt-captcha-grid #captcha::placeholder {
    color: #97a0af;
}

@media (max-width: 560px) {
    .gpt-captcha-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .gpt-captcha-grid #captcha {
        height: 62px;
    }
}
/* Captcha box before the visitor has triggered the lazy first load.
   See the "Lazy bootstrap" comment in assets/js/script.js — nothing is
   requested from the server until the visitor touches the form, so the box
   needs a resting state that doesn't look broken. */
.gpt-captcha-box.is-idle {
    cursor: pointer;
}

.gpt-captcha-box.is-idle .gpt-captcha-loading {
    display: none;
}

.gpt-captcha-box.is-idle::after {
    content: "Enter your roll number first";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    font-size: 12px;
    line-height: 1.35;
    color: #64748b;
    background: #f8fafc;
    border-radius: inherit;
    /* Let clicks fall through to the box (and its reload button) underneath. */
    pointer-events: none;
}

/* --- Share panel (shown only when the browser has no native file share) --- */
.gpt-share-panel {
    margin: 14px auto 0;
    padding: 16px;
    max-width: 520px;
    background: #f8fafc;
    border: 1.5px solid var(--gpt-border, #dce8e1);
    border-radius: 12px;
    text-align: center;
}

.gpt-share-hint {
    margin: 0 0 12px;
    font-size: 14px;
    color: #64748b;
}

.gpt-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.gpt-share-item {
    display: inline-block;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: #0f4d2e;
}

.gpt-share-item:hover,
.gpt-share-item:focus {
    opacity: .9;
    color: #fff;
}

.gpt-share-item.is-wa   { background: #25d366; color: #05391b; }
.gpt-share-item.is-fb   { background: #1877f2; }
.gpt-share-item.is-copy { background: #475569; }

.gpt-share-preview {
    margin-top: 14px;
}

.gpt-share-preview img {
    width: 100%;
    max-width: 340px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(11, 43, 28, .16);
}

@media print {
    .gpt-share-panel { display: none; }
}

.gpt-share-note {
    margin: 12px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: #64748b;
}

.gpt-share-item.is-copyimg { background: #0f766e; }
