:root {
    --blue: #1769aa;
    --blue-dark: #0f4c81;
    --ink: #073b42;
    --muted: #67858b;
    --border: #dce9e8;
    --white: #ffffff;
    --bg: #f5f9fd;
    --danger: #b42318;
    --danger-bg: #fff1f1;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

.page-shell { min-height: 100vh; }

/* ---------------- LOGIN ---------------- */
.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 50% 50%;
}

.brand-panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0f4c81 0%, #1769aa 55%, #2f80c9 100%);
    color: white;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -180px;
    bottom: -170px;
    border: 70px solid rgba(255,255,255,.08);
    border-radius: 50%;
}

.brand-content {
    max-width: 560px;
    margin: auto;
    padding: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: white; color: var(--blue); font-weight: 900; font-size: 20px; box-shadow: 0 12px 30px rgba(0,0,0,.13); }
.logo-mark.small { width: 42px; height: 42px; border-radius: 11px; font-size: 15px; }
.brand-name { margin-top: 16px; font-size: 25px; font-weight: 800; letter-spacing: -.6px; }
.brand-subtitle { margin-top: 3px; opacity: .82; font-size: 14px; }
.brand-message { margin-top: 100px; }
.brand-message h1 { margin: 0; font-size: clamp(38px, 4vw, 60px); line-height: 1.05; letter-spacing: -2px; }
.brand-message p { max-width: 460px; margin-top: 22px; font-size: 17px; line-height: 1.7; color: rgba(255,255,255,.86); }
.security-note { display: flex; gap: 13px; align-items: center; margin-top: 60px; padding: 16px 18px; width: fit-content; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); border-radius: 14px; }
.security-note small { display: block; margin-top: 3px; opacity: .75; }
.shield { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); }
.form-panel { display: flex; align-items: center; justify-content: center; padding: 45px; background: #fbfdfc; }
.login-card { width: 100%; max-width: 470px; }
.mobile-logo { display: none; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 1.6px; }
.welcome h2 { margin: 10px 0 8px; font-size: 38px; letter-spacing: -1.2px; }
.welcome p { margin: 0 0 32px; color: #6c7e79; line-height: 1.6; }
.alert { padding: 13px 15px; margin-bottom: 20px; border: 1px solid #ffd0d0; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }
label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 700; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); opacity: .55; font-size: 15px; }
input { width: 100%; height: 54px; padding: 0 54px 0 44px; border: 1px solid var(--border); border-radius: 11px; background: white; outline: none; color: var(--ink); font-size: 15px; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,105,170,.10); }
.show-password { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue-dark); cursor: pointer; font-weight: 700; font-size: 12px; }
.login-button { width: 100%; height: 55px; margin-top: 27px; border: 0; border-radius: 11px; background: var(--blue); color: white; font-size: 15px; font-weight: 800; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; box-shadow: 0 8px 20px rgba(23,105,170,.18); }
.login-button:hover { background: var(--blue-dark); }
.login-button:disabled { opacity: .75; cursor: wait; }
.arrow { font-size: 20px; }
.no-self-service { display: flex; gap: 10px; align-items: flex-start; margin-top: 26px; padding: 15px; border-radius: 11px; background: #edf6ff; color: #3f5f78; font-size: 12px; line-height: 1.5; }
.no-self-service p { margin: 0; }
footer { display: flex; justify-content: center; gap: 8px; margin-top: 45px; color: #92a19d; font-size: 11px; }

/* =========================================================
   LOGIN LOGO
   ========================================================= */

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    margin-bottom: 18px;

    /* Clip all four corners */
    overflow: hidden;
}

/* Actual logo */
.login-logo {
    display: block;
    align-items: center;

    width: 230px;
    height: auto;

    max-width: 100%;
    max-height: 150px;

    object-fit: contain;
    object-position: left center;

    /* Force clipping */
    overflow: hidden;
}


/* =========================================================
   MOBILE LOGO
   ========================================================= */

.mobile-logo {
    display: flex;
    align-items: center;

    gap: 12px;
    margin-bottom: 35px;

    width: fit-content;

    overflow: hidden;
    border-radius: 14px;
}

.mobile-login-logo {
    display: block;

    width: 190px;
    height: auto;

    max-width: 100%;
    max-height: 70px;

    object-fit: contain;

    border-radius: 14px;

    overflow: hidden;
}

/* ---------------- DASHBOARD ---------------- */
.dashboard-body {
    min-height: 100vh;
    color: var(--ink);
    background: #f6faff;
}

.topbar {
    height: 92px;
    width: 100%;
    padding: 0 7.5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid #e4eeee;
    position: relative;
    z-index: 20;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

/* The PNG is a horizontal wordmark, so give it a width rather than a square size. */
.topbar-logo {
    width: 220px;
    height: auto;
    max-width: 220px;
    max-height: 66px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.user-menu-wrap { position: relative; }
.user-menu-button {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 0;
    color: #285d66;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}
.user-icon { display: inline-flex; color: #28626b; }
.chevron { font-size: 20px; line-height: 1; margin-left: 2px; }
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    width: 250px;
    padding: 16px;
    border: 1px solid #dce9e8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(19,69,75,.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: .18s ease;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown strong { display: block; font-size: 14px; color: var(--ink); }
.user-dropdown small { display: block; margin-top: 4px; color: #789096; }
.dropdown-divider { height: 1px; background: #e7eeee; margin: 13px 0; }
.user-dropdown a { color: var(--blue-dark); text-decoration: none; font-size: 14px; font-weight: 700; }

.dashboard {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 92px);
    padding: 76px 30px 100px;
    background:
        linear-gradient(135deg, rgba(237,246,255,.96) 0%, rgba(255,255,255,.98) 50%, rgba(238,247,253,.94) 100%);
}

.dashboard::before {
    content: "";
    position: absolute;
    width: 780px;
    height: 500px;
    right: -240px;
    top: -30px;
    border-radius: 50%;
    background: rgba(205,226,246,.42);
    transform: rotate(-17deg);
    pointer-events: none;
}

.dashboard::after {
    content: "";
    position: absolute;
    width: 700px;
    height: 330px;
    left: -310px;
    bottom: -240px;
    border-radius: 50%;
    background: rgba(219,237,246,.58);
    transform: rotate(17deg);
    pointer-events: none;
}

.dashboard-heading,
.portal-grid {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-heading { margin-bottom: 51px; }
.dashboard-heading h1 { margin: 12px 0 13px; font-size: clamp(36px, 4vw, 46px); line-height: 1.12; letter-spacing: -1.3px; color: #073b42; }
.dashboard-heading p { margin: 0; color: #67858b; font-size: 18px; line-height: 1.5; }
.dot-separator { margin: 0 9px; color: #7ba0a5; }

.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.portal-card {
    min-height: 245px;
    padding: 28px 32px;
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.94);
    border: 1px solid #d9e7e6;
    border-radius: 17px;
    box-shadow: 0 3px 16px rgba(23,74,79,.025);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.portal-card:hover { transform: translateY(-4px); border-color: #c8dddd; box-shadow: 0 15px 35px rgba(23,74,79,.10); }
.portal-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.portal-card h3 { margin: 0 0 17px; font-size: 22px; line-height: 1.2; color: #073b42; }
.portal-card p { margin: 0; max-width: 290px; color: #66858b; font-size: 17px; line-height: 1.55; }

@media (max-width: 900px) {
    .topbar { padding: 0 30px; }
    .portal-grid { grid-template-columns: 1fr; max-width: 650px; }
    .portal-card { min-height: auto; }
}

@media (max-width: 850px) {
    .login-layout { grid-template-columns: 1fr; }
    .brand-panel { display: none; }
    .form-panel { min-height: 100vh; padding: 25px; }
    .mobile-logo { display: flex; }
}

@media (max-width: 600px) {
    .topbar { height: 76px; padding: 0 18px; }
    .topbar-logo { width: 175px; max-width: 175px; max-height: 55px; }
    .user-menu-button span:nth-child(2) { display: none; }
    .dashboard { min-height: calc(100vh - 76px); padding: 44px 20px 70px; }
    .dashboard-heading { margin-bottom: 34px; }
    .dashboard-heading h1 { font-size: 31px; }
    .dashboard-heading p { font-size: 16px; }
    .portal-grid { gap: 15px; }
    .portal-card { padding: 25px; }
    .portal-card h3 { font-size: 20px; }
    .portal-card p { font-size: 16px; }
}
