:root {
    --stipend-ink: #173b37;
    --stipend-green: #008a48;
    --stipend-green-dark: #006b37;
    --stipend-green-soft: #eaf6ef;
    --stipend-border: #d7e3de;
    --stipend-muted: #60736d;
    --stipend-page: #f2f6f4;
    --stipend-white: #fff;
    --stipend-danger: #a43236;
}

* {
    box-sizing: border-box;
}

body.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--stipend-page);
    color: var(--stipend-ink);
    font-family: "Noto Sans Bengali", "Segoe UI", sans-serif;
    line-height: 1.55;
}

.stipend-page-shell,
.stipend-page-shell * {
    font-family: "Noto Sans Bengali", "Segoe UI", sans-serif;
}

.stipend-page-shell {
    box-sizing: border-box;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 32px;
}

.stipend-page-shell > .container,
.stipend-page-shell .container {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-right: 0;
    padding-left: 0;
}

.row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.col-12,
.col-md-12 {
    grid-column: span 12;
}

.col-md-10 { grid-column: span 10; }
.col-md-7 { grid-column: span 7; }
.col-md-6 { grid-column: span 6; }
.col-md-5 { grid-column: span 5; }
.col-md-4 { grid-column: span 4; }
.col-md-3 { grid-column: span 3; }
.col-md-2 { grid-column: span 2; }
.col-sm-12 { grid-column: span 12; }

.stipend-institute-header {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 96px;
    align-items: center;
    gap: 20px;
    margin: 0 0 28px;
    padding: 20px 12px 24px;
    border-bottom: 1px solid var(--stipend-border);
    text-align: center;
}

.stipend-side-logo {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto;
    object-fit: contain;
}

.stipend-institute-copy h1 {
    margin: 0 0 8px;
    color: var(--stipend-ink);
    font-size: 25px;
    font-weight: 750;
    line-height: 1.35;
}

.stipend-institute-copy p {
    margin: 4px 0;
    color: var(--stipend-muted);
}

.stipend-institute-copy .stipend-form-title {
    margin-top: 12px;
    color: var(--stipend-green-dark);
    font-weight: 700;
}

#myForm > .row > .stipend-header-logo {
    position: absolute;
    top: 22px;
    left: 16px;
    z-index: 1;
    display: block !important;
    width: 88px;
    padding: 0;
}

.stipend-header-logo img {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto;
    object-fit: contain;
}

#myForm > .row > .stipend-header-copy {
    grid-column: 1 / -1;
    width: 100%;
    padding: 16px 112px 22px;
    text-align: center;
}

.stipend-header-copy h3 {
    margin: 0 0 8px;
    color: var(--stipend-ink);
    font-size: 25px;
    line-height: 1.35;
}

.stipend-header-copy p {
    margin: 5px 0;
    color: var(--stipend-muted);
}

.stipend-header-copy p:last-child {
    margin-top: 12px;
    color: var(--stipend-green-dark) !important;
    font-weight: 700;
}

.card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--stipend-border);
    border-radius: 8px;
    background: var(--stipend-white);
    box-shadow: 0 5px 18px rgba(23, 59, 55, .06);
}

.card-body {
    padding: 24px;
}

.card h3,
.card h4 {
    color: var(--stipend-green-dark);
}

.card h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

hr {
    width: 100%;
    height: 1px;
    margin: 10px 0 18px;
    border: 0;
    background: var(--stipend-border);
}

.border-4 {
    height: 3px;
    background: var(--stipend-green);
}

.mb-3 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 22px; }
.mt-5 { margin-top: 32px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.p-4 { padding: 24px; }
.p-2 { padding: 12px; }
.mx-auto { margin-inline: auto; }
.ms-2 { margin-left: 8px; }
.me-1 { margin-right: 5px; }
.mt-auto { margin-top: auto; }
.m-0 { margin: 0; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-primary { color: var(--stipend-green-dark); }
.text-danger { color: var(--stipend-danger); }
.text-muted { color: var(--stipend-muted); }
.text-white { color: #fff; }
.small { font-size: 13px; }
.fs-8 { font-size: 13px; }

.form-label {
    display: block;
    margin: 0 0 7px;
    color: #254942;
    font-size: 14px;
    font-weight: 650;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #c9d8d1;
    border-radius: 5px;
    background: #fff;
    color: #183b35;
    font: inherit;
    font-size: 14px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--stipend-green);
    outline: 3px solid rgba(0, 138, 72, .16);
}

.form-control[readonly],
.form-select:disabled,
.form-control:disabled {
    background: #f0f4f2;
    color: #52635e;
    opacity: 1;
}

.form-control[type="file"] {
    min-height: 48px;
    padding: 8px;
}

.form-text {
    display: block;
    margin-top: 6px;
    color: var(--stipend-muted);
    font-size: 12px;
    line-height: 1.5;
}

.invalid-feedback {
    display: none;
    margin-top: 5px;
    color: var(--stipend-danger);
    font-size: 12px;
}

.was-validated input:invalid,
.was-validated select:invalid {
    border-color: var(--stipend-danger);
}

.was-validated input:invalid + .invalid-feedback,
.was-validated select:invalid + .invalid-feedback {
    display: block;
}

.alert {
    margin: 0 0 16px;
    padding: 13px 16px;
    border: 1px solid var(--stipend-border);
    border-radius: 6px;
    background: #fff;
    color: var(--stipend-ink);
}

.alert-success { border-color: #a8d9bf; background: #edf8f1; color: #205b3b; }
.alert-danger { border-color: #e4b5b5; background: #fff1f1; color: #8d292d; }
.alert-info { border-color: #b8d8cd; background: var(--stipend-green-soft); color: #214b40; }
.alert-warning { border-color: #e6d2a1; background: #fff9e9; color: #69511f; }

.alert-fixed {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 10000;
    width: min(620px, calc(100% - 32px));
    transform: translateX(-50%);
}

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 10px; }
.float-end { float: right; }

.btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: #fff;
    color: var(--stipend-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { filter: brightness(.96); }
.btn:focus-visible { outline: 3px solid rgba(0, 138, 72, .25); outline-offset: 2px; }
.btn-success,
.btn-primary { border-color: var(--stipend-green); background: linear-gradient(135deg, #008a48, #005e31); color: #fff; }
.btn-danger { border-color: #a83b40; background: #a83b40; color: #fff; }
.btn-outline-primary { border-color: var(--stipend-green); color: var(--stipend-green-dark); }
.btn-outline-secondary { border-color: #9eaea8; color: #36534b; }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: 13px; }
.btn:disabled { cursor: not-allowed; opacity: .6; }

.stipend-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.stipend-actions .btn { white-space: nowrap; }
.stipend-search-button,
.stipend-print-button {
    min-height: 44px;
    padding: 10px 18px;
    box-shadow: 0 4px 14px rgba(0, 138, 72, .24);
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.stipend-search-button:hover,
.stipend-print-button:hover { background: #006b37; color: #fff; box-shadow: 0 7px 18px rgba(0, 107, 55, .3); transform: translateY(-2px); }
.stored-file-link { display: inline-block; margin-top: 8px; color: var(--stipend-green-dark); font-size: 13px; font-weight: 650; }

#stipend-attachments[hidden],
[data-eligibility-file][hidden],
[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .col-md-10,
    .col-md-7,
    .col-md-5,
    .col-md-4,
    .col-md-3,
    .col-md-2 { grid-column: span 6; }
    .col-md-12,
    .col-12 { grid-column: span 12; }
    .stipend-page-shell { max-width: 100%; }
}

@media (max-width: 640px) {
    .stipend-page-shell { padding: 0 10px 24px; }
    .row { gap: 12px; }
    .col-md-10,
    .col-md-7,
    .col-md-6,
    .col-md-5,
    .col-md-4,
    .col-md-3,
    .col-md-2,
    .col-sm-12 { grid-column: span 12; }
    .card-body { padding: 16px; }
    .stipend-institute-header { grid-template-columns: 54px minmax(0, 1fr) 54px; gap: 8px; padding: 14px 0 18px; }
    .stipend-side-logo { width: 50px; height: 50px; }
    .stipend-institute-copy h1 { font-size: 18px; }
    .stipend-institute-copy p { font-size: 13px; }
    #myForm > .row > .stipend-header-logo { top: 12px; left: 6px; width: 50px; }
    .stipend-header-logo img { width: 50px; height: 50px; }
    #myForm > .row > .stipend-header-copy { padding: 10px 58px 18px; }
    .stipend-header-copy h3 { font-size: 17px; }
    .stipend-header-copy span { font-size: 12px; }
    .stipend-actions { width: 100%; }
    .stipend-actions .btn { flex: 1 1 auto; }
}

@page { size: A4; margin: 12mm; }
@media print {
    body.page { display: block !important; background: #fff !important; }
    .head-nav-all,
    .site-footer,
    .no-print,
    .alert-fixed { display: none !important; }
    .stipend-page-shell { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
    .stipend-page-shell > .container { width: 100% !important; max-width: none !important; padding: 0 !important; }
    .card,
    .card-body { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
    .application-view-mode input:not([type="file"]),
    .application-view-mode select { border: 0 !important; border-bottom: 1px solid #9ca3af !important; border-radius: 0 !important; background: transparent !important; color: #111 !important; }
    .application-view-mode .form-control:disabled,
    .application-view-mode .form-select:disabled { opacity: 1 !important; color: #111 !important; }
    .alert { border: 0 !important; background: transparent !important; color: #111 !important; padding: 4px 0 !important; }
    .stored-file-link { color: #111 !important; text-decoration: underline !important; }
}
