/* ===== BD RESULT PORTAL — STYLESHEET ===== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #eee9e2;
    --bg-warm: #f3ede6;
    --bg-inset: #e4ded6;
    --mint: #8ecdae;
    --mint-light: #b0e0c8;
    --mint-deep: #5fb889;
    --mint-pale: #d4f0e2;
    --text: #2c2c2c;
    --text-secondary: #6b6560;
    --text-muted: #9a9590;
    --shadow-light: #f7f2eb;
    --shadow-dark: #d6d0c8;
    --neo-out: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
    --neo-out-sm: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
    --neo-in: inset 3px 3px 8px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light);
    --neo-in-deep: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
header {
    padding: 28px 0 20px;
    border-bottom: 1px solid var(--bg-inset);
}

.header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 26px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.logo em {
    color: var(--mint-deep);
    font-style: italic;
}

.header-nav {
    display: flex;
    gap: 28px;
}

.header-nav a {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.header-nav a:hover { color: var(--mint-deep); }

/* ===== HEADER RIGHT (nav + UI switch) ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ===== UI SWITCH TOGGLE ===== */
.ui-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: var(--bg);
    border: none;
    border-radius: 20px;
    box-shadow: var(--neo-out-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.ui-switch:hover { color: var(--mint-deep); }

.ui-switch-track {
    width: 26px;
    height: 14px;
    background: var(--bg-inset);
    border-radius: 8px;
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}

.ui-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.25s ease, background 0.25s;
}

body.minimal .ui-switch-track,
.ui-switch.is-active .ui-switch-track {
    background: var(--mint-deep);
}

body.minimal .ui-switch-thumb,
.ui-switch.is-active .ui-switch-thumb {
    transform: translateX(12px);
}

.ui-switch-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ===== HERO ===== */
.hero {
    padding: 72px 0 48px;
}

.hero h1 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(36px, 6vw, 54px);
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero h1 span {
    color: var(--mint-deep);
}

.hero p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 440px;
    line-height: 1.65;
}

/* ===== EXAM SELECTOR ===== */
.exam-selector {
    display: flex;
    gap: 6px;
    padding: 6px;
    border-radius: 40px;
    background: var(--bg);
    box-shadow: var(--neo-out);
    margin-bottom: 40px;
    width: fit-content;
}

.exam-btn {
    padding: 11px 28px;
    border: none;
    border-radius: 34px;
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

.exam-btn:hover { color: var(--text); }

.exam-btn.active {
    background: var(--mint);
    color: #1a3d2e;
    box-shadow: var(--neo-out-sm);
    font-weight: 700;
}

/* ===== FORM ===== */
.form-section {
    margin-bottom: 48px;
}

.form-section-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 22px;
    margin-bottom: 6px;
    color: var(--text);
}

.form-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field.full { grid-column: 1 / -1; }

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding-left: 4px;
}

.form-label .req {
    color: var(--mint-deep);
}

.neo-input,
.neo-select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg);
    border: none;
    border-radius: 12px;
    box-shadow: var(--neo-in);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: box-shadow 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.neo-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M5 6L0 0h10z' fill='%239a9590'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 40px;
    cursor: pointer;
}

.neo-select option {
    background: var(--bg-warm);
    color: var(--text);
}

.neo-input::placeholder { color: var(--text-muted); }

.neo-input:focus,
.neo-select:focus {
    box-shadow: var(--neo-in-deep), 0 0 0 2px var(--mint-light);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    padding-left: 4px;
}

/* ===== CAPTCHA ===== */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.captcha-img-wrap {
    flex-shrink: 0;
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--neo-out-sm);
    background: var(--bg);
}

.captcha-img-wrap img {
    display: block;
    height: 44px;
    border-radius: 6px;
}

.captcha-reload {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: var(--bg);
    box-shadow: var(--neo-out-sm);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.captcha-reload:hover {
    color: var(--mint-deep);
}

.captcha-input-wrap {
    flex: 1;
}

/* ===== SUBMIT ===== */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--mint);
    border: none;
    border-radius: 14px;
    box-shadow: var(--neo-out-sm);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
    font-weight: 600;
    color: #1a3d2e;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.submit-btn:hover {
    background: var(--mint-light);
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: var(--neo-in);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.submit-btn .spinner {
    display: none;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(26, 61, 46, 0.2);
    border-top-color: #1a3d2e;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

.submit-btn.loading .btn-text { display: none; }
.submit-btn.loading .spinner { display: block; }

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

/* ===== RESULT ===== */
.result-section {
    display: none;
    margin-bottom: 64px;
    animation: fadeUp 0.5s ease;
}

.result-section.visible { display: block; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 28px;
    margin-bottom: 4px;
}

.result-sub-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

.info-item {
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--bg);
    box-shadow: var(--neo-out-sm);
}

.info-item .lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-item .val {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 19px;
    color: var(--text);
}

.info-item.wide {
    grid-column: 1 / -1;
}

.gpa-display {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 32px;
    border-radius: 20px;
    background: var(--bg);
    box-shadow: var(--neo-out);
    margin-bottom: 40px;
}

.gpa-ring {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: var(--neo-out-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gpa-ring.pass {
    background: var(--mint);
}

.gpa-ring.fail {
    background: #e8b8b8;
}

.gpa-ring .status-icon {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 44px;
    color: #1a3d2e;
    line-height: 1;
}

.gpa-ring.fail .status-icon {
    color: #8b3a3a;
}

.gpa-ring .unit {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(26, 61, 46, 0.55);
    margin-top: 2px;
}

.gpa-ring.fail .unit {
    color: rgba(139, 58, 58, 0.6);
}

.gpa-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 24px;
}

.gpa-text.pass { color: var(--mint-deep); }
.gpa-text.fail { color: #b05050; }

.gpa-sub {
    font-family: var(--font-body);
    font-style: normal;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.grades-wrap {
    margin-bottom: 28px;
}

.grades-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 20px;
    margin-bottom: 20px;
}

.grade-row {
    display: grid;
    grid-template-columns: 56px 1fr 60px 56px;
    align-items: center;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.15s;
    gap: 4px;
}

.grade-row:hover {
    background: var(--bg-inset);
}

.grade-row .code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.grade-row .subject {
    font-weight: 500;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.35;
}

.grade-row .subject .subject-en {
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
}

.grade-row .subject .subject-bn {
    font-family: 'SolaimanLipi', 'Noto Sans Bengali', 'Hind Siliguri', 'Anek Bangla', var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.3;
}

.grade-row .marks-col {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
}

.grade-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    min-width: 42px;
}

.pill-ap { background: var(--mint-pale); color: var(--mint-deep); }
.pill-a  { background: #e0f5ec; color: #4aad7f; }
.pill-am { background: #e8f0f6; color: #5a8fa8; }
.pill-b  { background: #eef0f6; color: #6b7fa8; }
.pill-c  { background: #f6f0e8; color: #a8905a; }
.pill-d  { background: #f6ebe8; color: #a8765a; }
.pill-f  { background: #f6e8ea; color: #a85a62; }

.print-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-body);
    padding: 0;
}

.print-link:hover { color: var(--mint-deep); }

/* ===== ERROR ===== */
.error-section {
    display: none;
    padding: 36px;
    border-radius: 18px;
    background: var(--bg);
    box-shadow: var(--neo-out);
    margin-bottom: 48px;
    text-align: center;
    animation: fadeUp 0.5s ease;
}

.error-section.visible { display: block; }

.error-section .err-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 22px;
    color: #b05050;
    margin-bottom: 8px;
}

.error-section .err-msg {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== BOARDS ===== */
.boards-section {
    margin-bottom: 64px;
}

.section-heading {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 20px;
    margin-bottom: 20px;
}

.boards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.board-item {
    padding: 10px 22px;
    border-radius: 10px;
    background: var(--bg);
    box-shadow: var(--neo-out-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-body);
}

.board-item:hover {
    color: var(--mint-deep);
}

.board-item.picked {
    background: var(--mint-pale);
    color: var(--mint-deep);
    box-shadow: var(--neo-in);
}

.divider {
    height: 1px;
    background: var(--bg-inset);
    margin: 48px 0;
}

/* ===== FOOTER ===== */
footer {
    padding: 28px 0;
    border-top: 1px solid var(--bg-inset);
    text-align: center;
}

.footer-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px;
}

.footer-note {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== CRAFTED BY (Footer) ===== */
.crafted-by {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--bg-inset);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.crafted-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 16px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.crafted-text em {
    color: var(--mint-deep);
    font-style: italic;
    font-weight: 600;
}

.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 22px;
    background: var(--bg);
    box-shadow: var(--neo-out-sm);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-link:hover {
    color: var(--mint-deep);
    transform: translateY(-1px);
}

.social-link svg {
    flex-shrink: 0;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 14px 24px;
    border-radius: 12px;
    background: var(--bg);
    box-shadow: var(--neo-out);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    z-index: 999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.visible { transform: translateY(0); opacity: 1; }
.toast.ok { color: var(--mint-deep); }
.toast.err { color: #b05050; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .header-inner, .container, .footer-inner { padding: 0 20px; }
    .hero { padding: 48px 0 32px; }
    .form-row { grid-template-columns: 1fr; gap: 18px; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .gpa-display { flex-direction: column; text-align: center; }
    .exam-selector { width: 100%; justify-content: center; flex-wrap: wrap; }
    .exam-btn { padding: 10px 18px; font-size: 13px; }
    .grade-row { grid-template-columns: 48px 1fr 60px 48px; padding: 12px 12px; }
    .header-nav { display: none; }
    .header-right { gap: 12px; }
    .ui-switch { padding: 5px 10px 5px 5px; }
    .ui-switch-label { display: none; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .captcha-row { flex-wrap: wrap; }
    .social-link { padding: 8px 12px; }
}

@media print {
    body { background: white; }
    header, .exam-selector, .form-section, .boards-section,
    .divider, footer, .print-link, .error-section { display: none !important; }
    .result-section { display: block !important; }
    .info-item, .gpa-display { box-shadow: none; border: 1px solid #ddd; }
    .gpa-ring { background: var(--mint) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-inset); border-radius: 3px; }
