:root {
    --ink: #16283c;
    --muted: #61738a;
    --line: #dde4ec;
    --bg: #f3f6fa;
    --card: #ffffff;
    --brand: #17375e;
    --accent: #1f8a8a;
    --danger: #c0392b;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Hind Siliguri', 'Noto Sans Bengali', 'Kalpurush', system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    font-size: 16px;
}

.wrap { width: min(860px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.top {
    background: linear-gradient(135deg, #17375e 0%, #1d4c78 60%, #1f8a8a 130%);
    color: #fff;
    padding: 36px 0 70px;
}
.eyebrow { margin: 0 0 6px; letter-spacing: .12em; font-size: 13px; text-transform: uppercase; opacity: .75; }
.top h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 36px); line-height: 1.25; }
.lead { margin: 0; max-width: 560px; opacity: .88; }

main.wrap { margin-top: -44px; padding-bottom: 40px; }

/* ---------- cards ---------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(22,40,60,.06), 0 8px 24px rgba(22,40,60,.06);
}
.card h2 {
    margin: 0 0 16px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.card h2 small { font-weight: 400; font-size: 14px; color: var(--muted); }
.num {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand); color: #fff; font-size: 15px;
}
.note { margin: -6px 0 16px; color: var(--muted); font-size: 14.5px; }

/* ---------- form fields ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field.full { grid-column: 1 / -1; }
.field label, .label-row > label:first-child { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.field label b { color: var(--danger); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.label-row .check { font-weight: 400; font-size: 14px; color: var(--muted); cursor: pointer; }
.label-row .check input { margin-right: 4px; }

input[type=text], input[type=tel], input[type=date], input[type=email], input[type=number], select, textarea {
    width: 100%;
    padding: 11px 13px;
    font: inherit;
    color: var(--ink);
    background: #fbfcfe;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(31,138,138,.14);
    background: #fff;
}
.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 4px rgba(192,57,43,.1) !important; }
.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- uploads ---------- */
.uploads { display: grid; gap: 16px; }
.uploads.two { grid-template-columns: 1fr 1fr; }
.uploads.one { grid-template-columns: minmax(0, 340px); }

.upload { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcfe; }
.upload.invalid { border-color: var(--danger); }
.upload-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.upload-title { font-weight: 600; font-size: 15px; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.badge-req { background: #fdecea; color: var(--danger); }
.badge-opt { background: #e8f1f1; color: var(--accent); }

.drop {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 120px;
    border: 2px dashed #b9c6d4;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    transition: border-color .15s, background .15s;
}
.drop:hover { border-color: var(--accent); background: #f4fafa; }
.drop-text { display: grid; gap: 2px; }
.drop-text strong { color: var(--brand); }
.drop-text small { color: var(--muted); }
.thumb { max-width: 100%; max-height: 190px; border-radius: 6px; display: block; }
.upload.has-file .drop { border-style: solid; border-color: var(--accent); padding: 8px; }
.upload.has-file .drop-text { display: none; }
.remove {
    margin-top: 8px; background: none; border: 0; color: var(--danger);
    font: inherit; font-size: 14px; cursor: pointer; padding: 2px 0;
}
.remove:hover { text-decoration: underline; }

/* ---------- submit ---------- */
.errors {
    background: #fdecea; color: #8e2a20;
    border: 1px solid #f3c4be; border-radius: 10px;
    padding: 14px 18px; margin-bottom: 16px;
}
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.submit-bar { display: grid; gap: 12px; }
.btn {
    width: 100%; padding: 15px 20px; font: inherit; font-size: 18px; font-weight: 600;
    color: #fff; background: var(--brand); border: 0; border-radius: 12px; cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:hover { background: #1d4676; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #8aa0b8; cursor: wait; }
.progress { height: 8px; border-radius: 99px; background: #dfe7ef; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.success { text-align: center; padding: 44px 24px; }
.success h2 { justify-content: center; }
.tick {
    width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%;
    display: grid; place-items: center; font-size: 34px; color: #fff; background: var(--accent);
}
#refNo { font-size: 22px; color: var(--brand); letter-spacing: .04em; }

.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 8px 0 32px; }

/* ---------- education blocks ---------- */
.edu {
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fbfcfe;
}
.edu.invalid { border-color: var(--danger); }
.edu-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.edu-head h3 { margin: 0; font-size: 17px; color: var(--brand); }
.edu-upload { margin-top: 14px; }
.edu .field label small.en { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.edu .upload { background: #fff; }

/* ---------- application letter ---------- */
.letter {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.75;
    background: #fffdf8;
    border: 1px solid #e9e2d0;
    border-radius: 10px;
    padding: 24px 26px;
    color: #222;
}
.letter p { margin: 0 0 12px; }
.letter .l-right { text-align: right; }
.letter .fill {
    border-bottom: 1.5px dotted #8a7f66;
    padding: 0 3px;
    color: #17375e;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.letter .fill.empty { color: #a99f86; font-weight: 400; }
.letter .il {
    font: inherit; font-family: system-ui, sans-serif; font-size: 15px;
    padding: 4px 8px; margin: 0 2px; width: auto; display: inline-block;
    border-radius: 7px; background: #fff;
}
.letter .il-num { width: 5.2em; text-align: center; }
.post-pick {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
    font-family: 'Hind Siliguri', system-ui, sans-serif;
    background: #eef4f8; border: 1px dashed #aac0d4; border-radius: 10px;
    padding: 16px; margin: 4px 0 16px;
}
.post-pick .field:first-child { grid-column: 1 / -1; }
.l-sign { margin-top: 6px; }
.l-email { font-family: 'Hind Siliguri', system-ui, sans-serif; max-width: 380px; }
.l-email .l-lab { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 16px; }

[hidden] { display: none !important; }

@media (max-width: 640px) {
    .card { padding: 18px 16px; }
    .grid, .uploads.two { grid-template-columns: 1fr; }
    .uploads.one { grid-template-columns: 1fr; }
    .letter { padding: 18px 16px; font-size: 15px; }
    .post-pick { grid-template-columns: 1fr; padding: 14px; }
}

.field label small.en, .label-row label small.en { font-weight: 400; color: var(--muted); font-size: 13px; }
