.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;
}

.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;
}

@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;
    }
}