/* ==========================================================================
   BDRC Result Checker - Liquid Layout & Admin Integrated (2 Columns)
   ========================================================================== */

.bdrc-container, .bdrc-card {
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin-bottom: 30px;
}

.bdrc-form-header {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e5e7eb;
    border-bottom: 3px solid var(--bdrc-primary, #155bb5);
    margin-bottom: 20px;
}

.bdrc-form-logo {
    width: 60px;
    height: auto;
    margin-right: 15px;
}

.bdrc-form-titles h2 {
    margin: 0 0 5px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--bdrc-primary, #155bb5);
}

.bdrc-form-titles p {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    text-transform: uppercase;
    font-weight: 600;
}

#bdrc-result-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    overflow: hidden;
}

.bdrc-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.bdrc-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 25px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.bdrc-tab.active {
    color: var(--bdrc-primary, #155bb5);
    border-bottom-color: var(--bdrc-primary, #155bb5);
    background: #ffffff;
}

.bdrc-checker-wrapper {
    display: flex;
    flex-wrap: wrap;
}

.bdrc-checker-left {
    flex: 1.5;
    padding: 30px;
    min-width: 300px;
}

.bdrc-checker-right {
    flex: 1;
    padding: 30px;
    background: #f9fafb;
    border-left: 1px solid #e5e7eb;
    min-width: 250px;
}

.bdrc-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
    width: 100%;
}

.bdrc-form-row {
    display: flex;
    gap: 15px;
}

.bdrc-form-row .bdrc-form-group {
    flex: 1;
}

.bdrc-form-group label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #4b5563;
    text-transform: uppercase;
}

.bdrc-form-group select, .bdrc-form-group input {
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

/* ── CAPTCHA ENLARGED & CLEARED ── */
.bdrc-captcha-section {
    align-items: center;
}

.bdrc-captcha-img-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px;
    background: #fff;
    flex: 1;
    max-width: 200px;
    justify-content: center;
}

#bdrc-captcha-img {
    height: 55px; /* আগের চেয়ে বড় করা হয়েছে */
    border-radius: 4px;
    filter: contrast(1.2) brightness(1.1); /* ক্যাপচা আরও স্পষ্ট করার জন্য হালকা ফিল্টার */
}

#reload-captcha {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    margin-left: auto;
}

.bdrc-form-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

.bdrc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.bdrc-btn-primary {
    background: var(--bdrc-primary, #155bb5);
    color: #ffffff;
    flex: 2;
}

.bdrc-btn-outline {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #4b5563;
    flex: 1;
}

.bdrc-guide h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--bdrc-primary, #155bb5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bdrc-guide p {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 20px;
    line-height: 1.5;
}

.bdrc-guide ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bdrc-guide li {
    font-size: 13.5px;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.bdrc-guide li svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #10b981;
    margin-top: 2px;
}

.bdrc-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.bdrc-indv-gov-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: var(--bdrc-primary, #155bb5);
    color: #ffffff;
}

.bdrc-indv-gov-header img {
    width: 55px;
    height: auto;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
}

.bdrc-gov-titles .bdrc-gov-1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.bdrc-gov-titles .bdrc-gov-2 {
    font-size: 12px;
    font-weight: 500;
}

.bdrc-page-header {
    background: #f0f4f8;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.bdrc-indv-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--bdrc-primary, #155bb5);
}

.bdrc-card-body {
    padding: 25px;
}

.bdrc-indv-scroll, .bdrc-ebr-raw-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 25px;
}

.bdrc-info-tbl, .bdrc-grade-tbl, .bdrc-ebr-raw-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #dee2e6;
}

.bdrc-info-tbl th, .bdrc-grade-tbl th, .bdrc-ebr-raw-table-wrapper th {
    background: var(--bdrc-primary, #155bb5);
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.bdrc-info-tbl td, .bdrc-grade-tbl td, .bdrc-ebr-raw-table-wrapper td {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    color: #333333;
}

.bdrc-k {
    background: #f8f9fa;
    font-weight: 600;
    width: 25%;
}

.bdrc-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--bdrc-primary, #155bb5);
    margin-bottom: 15px;
    text-align: center;
}

.bdrc-grade-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid currentColor;
    background: #fff;
}

.bdrc-grade-fail {
    color: #dc3545;
}

.bdrc-result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .bdrc-checker-left, .bdrc-checker-right {
        flex: 100%;
        border-left: none;
    }
    .bdrc-form-row {
        flex-direction: column;
    }
}

@media print {
    .bdrc-no-print { display: none !important; }
}
/* ── Captcha loading state (added for Worker/Fallback transport) ── */
.bdrc-captcha-img-wrap { position: relative; }
.bdrc-captcha-img-wrap.is-loading #bdrc-captcha-img { opacity: 0; }
.bdrc-captcha-img-wrap.is-loading::after {
    content: "";
    position: absolute;
    left: 6px; top: 6px; right: 6px; bottom: 6px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.10) 50%, rgba(0,0,0,0.05) 75%);
    background-size: 200% 100%;
    animation: bdrc-cap-shimmer 1.1s linear infinite;
}
@keyframes bdrc-cap-shimmer { to { background-position: -200% 0; } }
#reload-captcha.is-spinning { animation: bdrc-spin 0.8s linear infinite; display: inline-block; }
@keyframes bdrc-spin { to { transform: rotate(360deg); } }
#bdrc-submit-btn[disabled] { opacity: 0.75; cursor: wait; }

@media (prefers-reduced-motion: reduce) {
    .bdrc-captcha-img-wrap.is-loading::after, #reload-captcha.is-spinning { animation: none !important; }
}

/* ── Captcha gating (v2.6) ─────────────────────────────────────────── */
.bdrc-captcha-section.bdrc-cap-hidden { display: none !important; }

.bdrc-cap-status {
    margin: 0 0 12px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.bdrc-cap-status.is-ready { background: #ecfdf5; color: #166534; border-color: #bbf7d0; font-weight: 600; }
.bdrc-cap-status.is-warn  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ── Institution result view (v2.8) ──────────────────────────────────── */
.bdrc-inst-head { text-align: center; padding: 4px 0 18px; border-bottom: 1px dashed #dbe3ee; margin-bottom: 18px; }
.bdrc-inst-name { font-size: 20px; font-weight: 800; color: #0f2744; line-height: 1.35; letter-spacing: .2px; }
.bdrc-inst-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.bdrc-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #eef4ff; color: #24487c; border: 1px solid #d6e3f8;
    border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600;
}
.bdrc-chip b { font-weight: 800; }

.bdrc-stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px; margin-bottom: 20px;
}
.bdrc-stat {
    background: #f7fafc; border: 1px solid #e3ebf3; border-radius: 12px;
    padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.bdrc-stat-v { font-size: 22px; font-weight: 800; color: #0f2744; line-height: 1.1; }
.bdrc-stat-l { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6b7f96; }
.bdrc-stat.is-good { background: #f0fdf4; border-color: #bbf7d0; }
.bdrc-stat.is-good .bdrc-stat-v { color: #15803d; }
.bdrc-stat.is-bad { background: #fef2f2; border-color: #fecaca; }
.bdrc-stat.is-bad .bdrc-stat-v { color: #b91c1c; }
.bdrc-stat.is-warn { background: #fffbeb; border-color: #fde68a; }
.bdrc-stat.is-warn .bdrc-stat-v { color: #b45309; }
.bdrc-stat.is-star { background: #eef2ff; border-color: #c7d2fe; }
.bdrc-stat.is-star .bdrc-stat-v { color: #4338ca; }

.bdrc-dist { margin-bottom: 20px; }
.bdrc-dist-row { display: grid; grid-template-columns: 44px 1fr 92px; align-items: center; gap: 10px; margin-bottom: 7px; }
.bdrc-dist-g {
    font-weight: 800; font-size: 13px; text-align: center;
    background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; border-radius: 6px; padding: 3px 0;
}
.bdrc-dist-g.is-f { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.bdrc-dist-bar { background: #eef2f7; border-radius: 999px; height: 12px; overflow: hidden; }
.bdrc-dist-bar i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--bdrc-primary, #155bb5), #4f93e8);
}
.bdrc-dist-n { font-size: 12px; font-weight: 700; color: #33465c; text-align: right; }
.bdrc-dist-n small { font-weight: 600; color: #7e8ea0; }

.bdrc-inst-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.bdrc-inst-tools input[type="search"], .bdrc-inst-tools select {
    padding: 8px 12px; border: 1px solid #d7e0ea; border-radius: 9px;
    font-size: 13px; background: #fff; color: #22364b;
}
.bdrc-inst-tools input[type="search"] { flex: 1 1 200px; min-width: 150px; }
.bdrc-inst-count { font-size: 12px; font-weight: 700; color: #6b7f96; margin-left: auto; }
.bdrc-inst-toggle {
    background: none; border: 1px solid #d7e0ea; border-radius: 9px;
    padding: 8px 12px; font-size: 12px; font-weight: 600; color: #4a5f77; cursor: pointer;
}
.bdrc-inst-toggle:hover { background: #f4f8fc; }
.bdrc-inst-tbl tbody tr:nth-child(even) { background: #fbfdff; }

@media (max-width: 560px) {
    .bdrc-inst-name { font-size: 17px; }
    .bdrc-stat-v { font-size: 19px; }
    .bdrc-dist-row { grid-template-columns: 38px 1fr 74px; }
    .bdrc-inst-count { margin-left: 0; }
}

@media print {
    .bdrc-inst-tools, .bdrc-inst-toggle { display: none !important; }
    .bdrc-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
