/* ============================================================================
   NORTHWHICH COLLEGE — design system
   ---------------------------------------------------------------------------
   One product, three surfaces: public website, student portal, admin panel.
   Loaded last in <head> on every page by database/brand.php, which marks
   <html data-bm="…"> with the surface:
     home | public | login | student | admin | adminlogin
   Rules are scoped with html[data-bm] so they win over each page's own CSS
   without touching those files. admin.css and student.css build on the
   tokens defined here.

   The look: clean and modern.
     • light surfaces, one deep navy (the logo's) for structure
     • gold (the logo's) only for highlights and the main call to action
     • Plus Jakarta Sans + Noto Sans Sinhala, one family everywhere
     • hairline borders, soft shadows, 12–16px radii, calm motion
   ========================================================================== */

:root {
    /* brand */
    /* navy = the logo's lettering (#2e3192); gold = the logo's swoosh (#22b8d6) */
    --ca-navy-950: #0d0e33;
    --ca-navy-900: #15175a;
    --ca-navy-800: #1f2178;
    --ca-navy-700: #2e3192;
    --ca-navy-600: #3f43b0;
    --ca-blue:     #4f5bd5;
    --ca-navy-50:  #eef0fb;
    --ca-navy-100: #dcdff5;
    --ca-gold-700: #0e7490;
    --ca-gold-600: #0891b2;
    --ca-gold:     #22b8d6;
    --ca-gold-400: #5fd3ea;
    --ca-gold-200: #b8ecf6;
    --ca-gold-50:  #e9f9fc;

    /* neutrals */
    --ca-bg:       #f3f4fb;
    --ca-paper:    #ffffff;
    --ca-ink:      #12133a;
    --ca-ink-2:    #34425e;
    --ca-muted:    #67768f;
    --ca-faint:    #97a3b8;
    --ca-line:     #e2e4f2;
    --ca-line-2:   #eef1f6;

    /* state */
    --ca-green:    #15803d;
    --ca-green-50: #e9f7ee;
    --ca-red:      #c62828;
    --ca-red-50:   #fdecec;
    --ca-amber:    #b45309;
    --ca-amber-50: #fff4e0;

    --ca-font: 'Inter', 'Noto Sans Sinhala', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;   /* reading text */
    --ca-head: 'Montserrat', 'Noto Sans Sinhala', system-ui, sans-serif;                                   /* headings: the logo's geometric family */

    --ca-r-sm: 8px; --ca-r: 12px; --ca-r-lg: 16px; --ca-r-xl: 22px;
    --ca-sh-xs: 0 1px 2px rgba(18,19,58,.06);
    --ca-sh-sm: 0 1px 3px rgba(18,19,58,.06), 0 4px 14px rgba(18,19,58,.05);
    --ca-sh-md: 0 6px 24px rgba(18,19,58,.09);
    --ca-sh-lg: 0 24px 60px rgba(18,19,58,.16);
    --ca-ease: cubic-bezier(.2,.8,.2,1);

    /* kept for older rules that still name them */
    --bm-navy-900: var(--ca-navy-900); --bm-navy-800: var(--ca-navy-800); --bm-navy-700: var(--ca-navy-700);
    --bm-gold: var(--ca-gold); --bm-gold-600: var(--ca-gold-600); --bm-gold-700: var(--ca-gold-700);
    --bm-ivory: var(--ca-bg); --bm-ink: var(--ca-ink); --bm-muted: var(--ca-muted); --bm-line: var(--ca-line);
    --bm-sans: var(--ca-font); --bm-serif: var(--ca-font);
}

/* ═══════════════════════════════════════════════════════════════════════════
   0. EVERY SURFACE — type, selection, focus, scrollbars
   ═════════════════════════════════════════════════════════════════════════ */
html[data-bm] body { font-family: var(--ca-font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* :where() keeps this at the weight of a plain element selector: it beats the
   pages' own `* { font-family }` resets but loses to any class rule, so icon
   fonts and anything a page deliberately styles keep their face. */
html[data-bm] body :where(*:not(i):not(code):not(pre):not(kbd):not([class*="fa-"]):not([class^="fa"]):not([class*="bx"]):not([class*="icon"]):not(.material-icons):not(.material-symbols-outlined)) {
    font-family: var(--ca-font);
}
/* every heading on every surface in Poppins, like the logo */
html[data-bm] body :is(h1, h2, h3, h4, h5) { font-family: var(--ca-head); }
html[data-bm] ::selection { background: var(--ca-navy-700); color: #fff; }
html[data-bm] :focus-visible { outline: 2px solid var(--ca-blue); outline-offset: 2px; }
html[data-bm] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-bm] ::-webkit-scrollbar-track { background: transparent; }
html[data-bm] ::-webkit-scrollbar-thumb { background: rgba(18,19,58,.18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
html[data-bm] ::-webkit-scrollbar-thumb:hover { background: rgba(18,19,58,.32); background-clip: padding-box; }

/* 1. HOME — the home page has its own stylesheet: assets/brand/home.css */

/* ═══════════════════════════════════════════════════════════════════════════
   2. PUBLIC WEBSITE — INNER PAGES (layout_3 l3-*, courses, articles …)
   ═════════════════════════════════════════════════════════════════════════ */
html[data-bm="public"], html[data-bm="home"] {
    --green: var(--ca-navy-700) !important; --green-dark: var(--ca-navy-800) !important; --green-soft: var(--ca-navy-50) !important;
    --navy: var(--ca-navy-700) !important; --navy-deep: var(--ca-navy-950) !important; --navy-soft: var(--ca-navy-50) !important;
    --ink: var(--ca-ink); --ink-2: var(--ca-ink-2); --canvas: var(--ca-bg); --line: var(--ca-line);
    --font: var(--ca-font);
    --login-blue: var(--ca-navy-700); --login-blue-dark: var(--ca-navy-800);
    --sh-green: 0 8px 22px rgba(46,49,146,.22);
    --primary: var(--ca-navy-700) !important; --primary-rgb: 18,53,127 !important; --primary-hover: var(--ca-navy-800) !important;
}
html[data-bm="public"] { --accent: var(--ca-navy-700) !important; --accent-rgb: 18,53,127 !important;
    --accent2: var(--ca-navy-900) !important; --accent2-rgb: 10,29,71 !important; --accent3: var(--ca-navy-700) !important; }
html[data-bm="public"] body { background: var(--ca-bg); color: var(--ca-ink); overflow-x: clip; }

/* header + top bar: the same as the home page (assets/brand/home.css) */
html[data-bm="public"] .l3-topbar { background: var(--ca-navy-950) !important; color: rgba(255,255,255,.78); height: 40px; }
html[data-bm="public"] .l3-topbar i { color: var(--ca-gold) !important; }
html[data-bm="public"] .l3-header, html[data-bm="public"] .navbar {
    background: #fff !important; border-bottom: 1px solid var(--ca-line) !important; box-shadow: none !important; backdrop-filter: none !important;
}
html[data-bm="public"] .l3-header.stuck { box-shadow: 0 4px 18px rgba(46,49,146,.08) !important; }
html[data-bm="public"] { --nav-h: 84px; }
html[data-bm="public"] .l3-brand img, html[data-bm="public"] .logo-wrap img,
html[data-bm="public"] .navbar .logo img, html[data-bm="public"] header .logo img { height: 62px !important; width: auto !important; max-width: 260px; object-fit: contain; }
@media (max-width: 760px) { html[data-bm="public"] { --nav-h: 70px; } html[data-bm="public"] .l3-brand img { height: 50px !important; } }
html[data-bm="public"] .l3-brand-mark { background: var(--ca-navy-700) !important; color: var(--ca-gold) !important; }
html[data-bm="public"] .l3-menu > li > a { color: var(--ca-ink) !important; font-weight: 500 !important; font-size: 14.5px !important; background: none !important; border-radius: 0 !important; padding: 10px 12px !important; }
html[data-bm="public"] .l3-menu > li > a::after { display: block !important; left: 12px !important; right: 12px !important; bottom: 2px !important; height: 2px !important; background: var(--ca-gold) !important; transform: scaleX(0); }
html[data-bm="public"] .l3-menu > li > a:hover, html[data-bm="public"] .l3-menu > li > a.on { color: var(--ca-navy-700) !important; }
html[data-bm="public"] .l3-menu > li > a:hover::after, html[data-bm="public"] .l3-menu > li > a.on::after { transform: scaleX(1); }

html[data-bm="public"] .l3-title, html[data-bm="public"] h1, html[data-bm="public"] .section-title,
html[data-bm="public"] .page-title, html[data-bm="public"] .section-h { font-weight: 700 !important; letter-spacing: -.01em !important; }
html[data-bm="public"] .l3-title { color: var(--ca-navy-700) !important; }
html[data-bm="public"] .l3-title em { color: var(--ca-gold-600) !important; font-style: normal; }
html[data-bm="public"] .l3-eyebrow { color: var(--ca-gold-600) !important; letter-spacing: .14em !important; font-weight: 600 !important; }
html[data-bm="public"] .l3-eyebrow::before { background: var(--ca-gold) !important; }

/* buttons: 6px corners, Poppins; navy = main, gold = register, outline = secondary */
html[data-bm="public"] .l3-btn, html[data-bm="public"] .btn { border-radius: 6px !important; font-weight: 500 !important; letter-spacing: .01em !important; text-transform: none !important; }
html[data-bm="public"] .l3-btn:hover { transform: none !important; }
html[data-bm="public"] .l3-btn-green, html[data-bm="public"] .btn-accent, html[data-bm="public"] .btn-primary, html[data-bm="public"] .l3-btn-navy {
    background: var(--ca-navy-700) !important; color: #fff !important; border-color: transparent !important; box-shadow: none !important;
}
html[data-bm="public"] .l3-btn-green:hover, html[data-bm="public"] .btn-accent:hover, html[data-bm="public"] .btn-primary:hover, html[data-bm="public"] .l3-btn-navy:hover { background: var(--ca-navy-900) !important; }
html[data-bm="public"] .l3-btn-login { background: var(--ca-gold) !important; color: var(--ca-navy-950) !important; box-shadow: none !important; }
html[data-bm="public"] .l3-btn-login:hover { background: #1aa6c4 !important; }
html[data-bm="public"] .l3-btn-line { border: 1.5px solid var(--ca-navy-700) !important; color: var(--ca-navy-700) !important; background: transparent !important; box-shadow: none !important; }
html[data-bm="public"] .l3-btn-line:hover { background: var(--ca-navy-700) !important; color: #fff !important; }
html[data-bm="public"] .l3-arrow { background: var(--ca-navy-50) !important; color: var(--ca-navy-700) !important; }

/* page title bands: solid navy with the logo's gold rule underneath */
html[data-bm="public"] [class*="l3-page-hero"], html[data-bm="public"] .l3-phero, html[data-bm="public"] .page-hero {
    background: var(--ca-navy-900) !important; color: #fff;
    border-bottom: 4px solid var(--ca-gold);
}
html[data-bm="public"] .l3-phero::before { opacity: .35; }
html[data-bm="public"] [class*="l3-page-hero"] h1, html[data-bm="public"] .l3-phero h1, html[data-bm="public"] .page-hero h1 { color: #fff !important; }
html[data-bm="public"] .l3-phero .l3-btn-green, html[data-bm="public"] .page-hero .btn-primary, html[data-bm="public"] [class*="l3-page-hero"] .l3-btn-green {
    background: var(--ca-gold) !important; color: var(--ca-navy-950) !important;
}

/* scroll reveal on inner pages (classes added by brand.js, so nothing is hidden
   if scripting is off) */
html[data-bm="public"] .ca-rv { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1); transition-delay: var(--d, 0ms); }
html[data-bm="public"] .ca-rv.in { opacity: 1; transform: none; }
html[data-bm="public"] .ca-rv :is(.vl-thumb img, .cg-item img, .ev-img img, .tc-photo img) { transform: scale(1.07); transition: transform 1.4s cubic-bezier(.16,1,.3,1); }
html[data-bm="public"] .ca-rv.in :is(.vl-thumb img, .ev-img img, .tc-photo img), html[data-bm="public"] .cg-item.ca-rv.in img { transform: scale(1); }
@media (prefers-reduced-motion: reduce) { html[data-bm="public"] .ca-rv { opacity: 1; transform: none; transition: none; } }

/* contact page: grid columns may shrink (the form used to push past the screen edge) */
html[data-bm="public"] .contact-grid > * { min-width: 0; }
/* its slide-in animation starts 100px to the right; keep that from widening the page */
html[data-bm="public"] .contact-grid { overflow-x: clip; overflow-clip-margin: 24px; }
html[data-bm="public"] .form-card, html[data-bm="public"] .info-card { border-radius: 14px !important; border-top-width: 1px !important; border-top-color: var(--ca-line) !important; }
html[data-bm="public"] .form-card h2, html[data-bm="public"] .info-details h3, html[data-bm="public"] .page-header h1 { text-transform: none !important; letter-spacing: -.02em; }
html[data-bm="public"] .page-header { background: var(--ca-bg) !important; border-bottom: 1px solid var(--ca-line) !important; }
html[data-bm="public"] .page-header h1 { color: var(--ca-navy-900) !important; }

html[data-bm="public"] .l3-footer, html[data-bm="public"] footer {
    background: var(--ca-navy-950) !important; border-top: 4px solid var(--ca-gold) !important; color: rgba(255,255,255,.7);
}
html[data-bm="public"] .l3-footer a:hover, html[data-bm="public"] footer a:hover { color: #fff !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   3. LOGIN & REGISTER (login.php, register.php, course-login …)
   ═════════════════════════════════════════════════════════════════════════ */
html[data-bm="login"], html[data-bm="login"][data-theme] {
    --primary-logic: var(--ca-navy-700) !important;
    --accent-logic: var(--ca-gold) !important;
    --accent-hover: var(--ca-gold-600) !important;
    --brand-gradient: linear-gradient(150deg, var(--ca-navy-800), var(--ca-navy-950)) !important;
}
html[data-bm="login"][data-theme="light"], html[data-bm="login"]:not([data-theme]) {
    --bg-main: var(--ca-bg) !important; --input-bg: #fff !important; --bg-surface: #fff !important;
    --text-primary: var(--ca-ink) !important; --text-secondary: var(--ca-muted) !important; --border-color: var(--ca-line) !important;
}
html[data-bm="login"] body { background: var(--ca-bg) !important; }
html[data-bm="login"] .brand-section {
    background:
        radial-gradient(700px 420px at 100% 0%, rgba(79,91,213,.35), transparent 60%),
        radial-gradient(520px 380px at 0% 100%, rgba(34,184,214,.14), transparent 60%),
        var(--ca-navy-950) !important;
    color: #fff !important; position: relative; overflow: hidden;
}
html[data-bm="login"] .brand-section::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px;
    -webkit-mask: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent); mask: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
    border: 0 !important; transform: none !important; animation: none !important; width: auto; height: auto; border-radius: 0;
}
html[data-bm="login"] .brand-section > * { position: relative; z-index: 1; }
html[data-bm="login"] .brand-section h1, html[data-bm="login"] .brand-section h2 {
    font-family: var(--ca-head) !important; color: #fff !important; font-weight: 800 !important; letter-spacing: -.03em !important; font-variant: normal !important; text-transform: none !important;
}
html[data-bm="login"] .brand-section h1 span, html[data-bm="login"] .brand-section h2 span { color: var(--ca-gold-400) !important; }
html[data-bm="login"] .brand-section p { color: rgba(255,255,255,.75) !important; }
html[data-bm="login"] .brand-title-mini { color: var(--ca-gold-200) !important; letter-spacing: .18em; }
html[data-bm="login"] .brand-section .badge { background: rgba(255,255,255,.07) !important; border: 1px solid rgba(255,255,255,.16) !important; color: #fff !important; border-radius: 999px !important; }
html[data-bm="login"] .brand-section .badge i { color: var(--ca-gold) !important; }
html[data-bm="login"] .logic-particle, html[data-bm="login"] .floating-card, html[data-bm="login"] .brand-illustration { display: none !important; }
/* the slideshow's fallback card (shown when its photo is missing) */
html[data-bm="login"] .slideshow-container { border-radius: 18px !important; border: 1px solid rgba(255,255,255,.12) !important; box-shadow: 0 20px 50px rgba(0,0,0,.25) !important; }
html[data-bm="login"] .slide-placeholder {
    background: radial-gradient(400px 260px at 50% 30%, rgba(79,91,213,.35), transparent 70%), rgba(255,255,255,.04) !important;
    color: #fff !important; gap: 6px;
}
html[data-bm="login"] .slide-placeholder i { display: none !important; }
html[data-bm="login"] .slide-placeholder::before {
    content: ''; width: 120px; height: 140px; margin-bottom: 14px;
    background: url("../../uploads/settings/bm-logo-mark.png?v=nw1") center / contain no-repeat;
}
html[data-bm="login"] .slide-placeholder h3 { font-size: 20px !important; font-weight: 800 !important; letter-spacing: -.02em; }
html[data-bm="login"] .slide-placeholder p { color: rgba(255,255,255,.7) !important; }
html[data-bm="login"] .login-box, html[data-bm="login"] .register-box, html[data-bm="login"] .form-box {
    background: #fff !important; border: 1px solid var(--ca-line) !important; border-radius: 18px !important; box-shadow: var(--ca-sh-md) !important;
}
html[data-bm="login"] .login-box::before, html[data-bm="login"] .register-box::before, html[data-bm="login"] .form-box::before { display: none !important; }
html[data-bm="login"] .login-header h2 { font-family: var(--ca-head) !important; color: var(--ca-navy-900); font-weight: 800 !important; letter-spacing: -.03em !important; font-variant: normal !important; text-transform: none !important; }
html[data-bm="login"][data-theme="dark"] .login-header h2 { color: #fff; }
html[data-bm="login"] label { font-weight: 600 !important; letter-spacing: .02em !important; }
html[data-bm="login"] input:not([type=checkbox]):not([type=radio]), html[data-bm="login"] select, html[data-bm="login"] textarea { border-radius: 10px !important; }
html[data-bm="login"] .login-btn, html[data-bm="login"] button[type="submit"]:not(.password-toggle) {
    background: var(--ca-navy-700) !important; color: #fff !important; font-weight: 700 !important;
    box-shadow: 0 8px 22px rgba(46,49,146,.25) !important; border: 0 !important; border-radius: 10px !important;
}
html[data-bm="login"] .login-btn:hover, html[data-bm="login"] button[type="submit"]:not(.password-toggle):hover { background: var(--ca-navy-800) !important; }
html[data-bm="login"] .login-btn::after { display: none !important; }
html[data-bm="login"] input:focus, html[data-bm="login"] select:focus {
    border-color: var(--ca-navy-600) !important; box-shadow: 0 0 0 4px rgba(63,67,176,.12) !important;
}
html[data-bm="login"] a { color: var(--ca-navy-700); }
html[data-bm="login"] .bm-login-logo { display: block; width: min(250px, 70%); height: auto; margin: 0 0 28px; }
html[data-bm="login"] .bm-form-logo { display: none; width: 180px; margin: 0 auto 18px; }
@media (max-width: 900px) { html[data-bm="login"] .bm-form-logo { display: block; } }

@media (prefers-reduced-motion: reduce) {
    html[data-bm] *, html[data-bm] *::before, html[data-bm] *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* The student portal and admin panel build on this file:
   assets/brand/student.css and assets/brand/admin.css (see database/brand.php). */
