/* ==========================================================================
   Shiva Digital Academy — base design system (shared by site, portal, admin)
   ========================================================================== */
:root {
    --brand: #f57c00;
    --brand-600: #e06d00;
    --brand-700: #c25e00;
    --brand-50: #fff4e6;
    --brand-100: #ffe3c2;
    --ink: #0f172a;
    --ink-2: #1e293b;
    --ink-3: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-2: #f1f5f9;
    --bg: #f8fafc;
    --surface: #ffffff;
    --violet: #7c3aed;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0284c7;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, .06), 0 10px 24px -6px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .18);
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Bootstrap overrides */
    --bs-primary: var(--brand);
    --bs-primary-rgb: 245, 124, 0;
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--ink-2);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--line);
    --bs-link-color: var(--brand-700);
    --bs-link-color-rgb: 194, 94, 0;
    --bs-link-hover-color: var(--brand);
    --bs-border-radius: var(--radius-sm);
    --bs-secondary-color: var(--muted);
    --bs-emphasis-color: var(--ink);
    --bs-heading-color: var(--ink);
}

/* ── Global UI scale ───────────────────────────────────────────
   The whole interface renders at 80% on tablets/desktops (what the browser
   showed at 80% zoom now shows at 100%). Phones stay at 100% for readability,
   print is always 100% so certificates/invoices keep their exact A4 size.
   Use calc(var(--vh) * N) instead of Nvh so full-height layouts still fit. */
:root { --ui-zoom: 1; --vh: 1vh; }
@media screen and (min-width: 768px) {
    :root { --ui-zoom: .8; --vh: calc(1vh / .8); }
    html { zoom: .8; }
    /* Public website pages are a little larger (90%) */
    html.public { --ui-zoom: .9; --vh: calc(1vh / .9); zoom: .9; }
}
@media print { html { zoom: 1 !important; } }
.zoom-reset { zoom: calc(1 / var(--ui-zoom)); }

html { scroll-behavior: smooth; }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
::selection { background: var(--brand-100); color: var(--ink); }
img { max-width: 100%; }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.text-violet { color: var(--violet) !important; }
.fw-800 { font-weight: 800; }
.font-monospace { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace !important; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(245, 124, 0, .45); outline-offset: 2px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { font-weight: 600; border-radius: var(--radius-sm); --bs-btn-padding-x: 1rem; transition: all .15s ease; }
.btn-pill { border-radius: 999px; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); --bs-btn-focus-shadow-rgb: 245, 124, 0;
    box-shadow: 0 6px 16px -6px rgba(245, 124, 0, .6);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline-primary {
    --bs-btn-color: var(--brand-700); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600);
}
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); }
.btn-outline-dark { --bs-btn-color: var(--ink); --bs-btn-border-color: #cbd5e1; --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); border: 0; }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; }
.btn-icon.btn-sm { width: 30px; height: 30px; font-size: .8rem; }
.btn-link { --bs-btn-color: var(--brand-700); text-decoration: none; font-weight: 600; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .85rem; color: var(--ink-3); margin-bottom: .35rem; }
.form-control, .form-select { border-color: #d6dde6; border-radius: var(--radius-sm); padding: .6rem .85rem; font-size: .95rem; }
.form-control-sm, .form-select-sm { padding: .35rem .6rem; font-size: .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(245, 124, 0, .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(245, 124, 0, .2); border-color: var(--brand); }
.form-text { font-size: .78rem; }
.input-group-text { background: var(--line-2); border-color: #d6dde6; color: var(--muted); }
.form-control-color { width: 3.2rem; padding: .3rem; }

/* ── Cards & panels ─────────────────────────────────────────── */
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.panel-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.card { border-color: var(--line); border-radius: var(--radius); }

/* ── Chips & badges ─────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .22rem .65rem; border-radius: 999px; background: var(--line-2); color: var(--ink-3); font-size: .75rem; font-weight: 600; border: 1px solid var(--line); line-height: 1.4; white-space: nowrap; }
.chip-lg { padding: .45rem .9rem; font-size: .85rem; }
.chip-urgent, .chip-immediate-joining { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.chip-walk-in, .chip-freshers-welcome { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.chip-female-only { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.chip-locals-only, .chip-ex-servicemen-preferred { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge { font-weight: 600; letter-spacing: .01em; }
.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }
.badge-soft-info { background: #e0f2fe; color: #0369a1; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }
.badge-soft-primary { background: var(--brand-50); color: var(--brand-700); }
.badge-soft-violet { background: #ede9fe; color: #6d28d9; }

/* ── Flash messages ─────────────────────────────────────────── */
.flash-stack { position: relative; z-index: 5; padding-top: 1rem; }
.flash { display: flex; align-items: flex-start; border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); font-weight: 500; }
.flash i { margin-top: 3px; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* ── Empty states ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state > i { font-size: 2.4rem; color: #cbd5e1; margin-bottom: .75rem; display: block; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.empty-state.small { padding: 1.5rem 1rem; }
.empty-state.small > i { font-size: 1.6rem; }

/* ── Avatars ────────────────────────────────────────────────── */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--c, var(--brand)), #7c3aed); flex-shrink: 0; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* ── Tables ─────────────────────────────────────────────────── */
.table { --bs-table-bg: transparent; vertical-align: middle; }
.table > :not(caption) > * > * { padding: .75rem .9rem; border-bottom-color: var(--line-2); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #fafbfd; }

/* ── Progress ───────────────────────────────────────────────── */
.progress { --bs-progress-bg: #edf1f6; --bs-progress-bar-bg: var(--brand); border-radius: 99px; height: 8px; }
.progress-bar { border-radius: 99px; }

/* ── Error page ─────────────────────────────────────────────── */
.error-page { min-height: calc(var(--vh) * 100); display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, var(--brand-50), var(--bg) 60%); }
.error-wrap { text-align: center; padding: 2rem; max-width: 520px; }
.error-code { font-size: clamp(5rem, 16vw, 8rem); font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-wrap h1 { font-size: 1.75rem; margin: .75rem 0 .5rem; }
.error-wrap p { color: var(--muted); margin-bottom: 1.5rem; }

/* ── Brand ──────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #ff9a3d); color: #fff; font-size: 1.2rem; box-shadow: 0 6px 14px -6px rgba(245, 124, 0, .7); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; color: var(--ink); }
.brand-name b { color: var(--brand); font-weight: 800; }
.brand-tag { font-size: .68rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.brand-light .brand-name { color: #fff; }
.brand-light .brand-tag { color: #94a3b8; }

/* ── Modals & misc ─────────────────────────────────────────── */
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line-2); padding: 1.1rem 1.4rem; }
.modal-footer { border-top-color: var(--line-2); }
.modal-body { padding: 1.4rem; }
.dropdown-menu { border-radius: var(--radius-sm); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-weight: 500; font-size: .9rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { width: 18px; text-align: center; color: var(--muted); }
.dropdown-item:active, .dropdown-item.active { background: var(--brand-50); color: var(--brand-700); }
.dropdown-item:active i, .dropdown-item.active i { color: var(--brand); }
.toast-stack { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
.app-toast { background: var(--ink); color: #fff; padding: .75rem 1rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .9rem; display: flex; gap: .6rem; align-items: center; animation: toastIn .25s ease; max-width: 360px; }
.app-toast.success i { color: #4ade80; } .app-toast.danger i { color: #f87171; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 23, .92); z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; animation: toastIn .2s ease; }
.lightbox img { max-width: 100%; max-height: calc(var(--vh) * 82); border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox p { color: #e2e8f0; margin-top: 1rem; text-align: center; max-width: 720px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); border: 0; color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 1.1rem; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lightbox .lb-close { top: 1rem; right: 1rem; }
.lightbox .lb-prev { left: 1rem; top: 50%; } .lightbox .lb-next { right: 1rem; top: 50%; }

@media print {
    .no-print, .flash-stack { display: none !important; }
}

/* ── Online certification: course cards (portal + public page) ── */
.oc-ccard { display: flex; flex-direction: column; height: 100%; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid #e5e7eb; color: inherit; text-decoration: none; box-shadow: 0 10px 28px -22px rgba(15,23,42,.45); transition: transform .2s, box-shadow .2s, border-color .2s; }
a.oc-ccard:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -24px rgba(15,23,42,.5); border-color: var(--c); color: inherit; }
.oc-ccard.is-mine { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.oc-ccard-media { position: relative; display: block; height: 130px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #0b1d42)) center / cover no-repeat; }
.oc-ccard-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(11,29,66,.45)); }
.oc-ccard-media .oc-cicon { position: absolute; left: 1.1rem; bottom: -22px; z-index: 1; box-shadow: 0 0 0 4px #fff, 0 10px 20px -8px var(--c); }
.oc-mine { position: absolute; right: .75rem; top: .75rem; z-index: 1; background: #fff; color: #15803d; font-weight: 800; font-size: .75rem; padding: .3rem .65rem; border-radius: 999px; display: inline-flex; gap: .35rem; align-items: center; }
.oc-ccard-body { display: flex; flex-direction: column; gap: .45rem; padding: 2rem 1.15rem 1.15rem; flex: 1; }
.oc-ccard-body > strong { font-size: 1.08rem; font-weight: 800; color: #0f172a; line-height: 1.3; }
.oc-ccard-body > small { color: #64748b; font-size: .85rem; line-height: 1.45; }
.oc-cicon { width: 46px; height: 46px; border-radius: 14px; display: inline-grid; place-items: center; flex-shrink: 0; color: #fff; font-size: 1.1rem; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #0b1d42)); }
.oc-cicon.lg { width: 58px; height: 58px; font-size: 1.4rem; border-radius: 16px; }
.oc-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.oc-tags > span { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 700; color: #334155; background: #f1f5f9; border-radius: 999px; padding: .25rem .6rem; }
.oc-tags i { color: var(--c, #64748b); }
.oc-fees { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.oc-fees > span { display: flex; flex-direction: column; padding: .55rem .7rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 7%, #fff); border: 1px solid color-mix(in srgb, var(--c) 18%, #fff); }
.oc-fees small { font-size: .7rem; color: #64748b; font-weight: 600; } .oc-fees b { font-size: 1.05rem; color: #0f172a; }