/* ===================================================
   CTCA Wagtail Admin Theme — Blue color scheme
   Overrides Wagtail's default teal with project blue
   =================================================== */

:root,
.w-theme-system,
.w-theme-light {
    /* ---------- Primary / accent ---------- */
    --w-color-primary: #2563eb;           /* blue-600 */
    --w-color-primary-200: #bfdbfe;       /* blue-200 */

    /* ---------- Secondary (sidebar, header) ---------- */
    --w-color-secondary: #1e3a8a;         /* blue-900 */
    --w-color-secondary-50: #eff6ff;
    --w-color-secondary-75: #dbeafe;
    --w-color-secondary-100: #bfdbfe;
    --w-color-secondary-200: #93c5fd;
    --w-color-secondary-400: #60a5fa;
    --w-color-secondary-600: #2563eb;
    --w-color-secondary-hue: 221;
    --w-color-secondary-saturation: 83%;
    --w-color-secondary-lightness: 53%;
}

/* Dark-mode overrides */
.w-theme-dark {
    --w-color-primary: #60a5fa;           /* blue-400 */
    --w-color-primary-200: #1e3a8a;       /* blue-900 */
    --w-color-secondary: #172554;
    --w-color-secondary-50: #1e3a8a;
    --w-color-secondary-75: #1e3a8a;
    --w-color-secondary-100: #1e40af;
    --w-color-secondary-200: #1d4ed8;
    --w-color-secondary-400: #3b82f6;
    --w-color-secondary-600: #60a5fa;
}

/* ========== Login page ========== */

body.login {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.login .content-wrapper {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 3rem 2.5rem 2.5rem;
    max-width: 420px;
    width: 100%;
    margin: 2rem auto;
}

body.login .content-wrapper > h1 {
    color: #1e3a8a;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Inputs */
body.login .login-form input[type="text"],
body.login .login-form input[type="password"],
body.login .login-form input[type="email"] {
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    padding: 0.65rem 0.85rem;
    transition: border-color 0.2s;
}

body.login .login-form input[type="text"]:focus,
body.login .login-form input[type="password"]:focus,
body.login .login-form input[type="email"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* Submit button */
body.login .button {
    background-color: #2563eb;
    border: none;
    border-radius: 8px;
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

body.login .button:hover {
    background-color: #1d4ed8;
}

/* Logo area at bottom of card */
body.login .login-logo {
    text-align: center;
    margin-top: 1.5rem;
}

/* Messages */
body.login .messages ul {
    padding: 0;
    list-style: none;
}

body.login .messages li.error {
    color: #dc2626;
    background: #fef2f2;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* ========== Sidebar ========== */

.sidebar {
    background-color: #1e3a8a !important;
}

.sidebar .sidebar-menu-item__link:hover,
.sidebar .sidebar-menu-item--active > .sidebar-menu-item__link {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

/* ---------- Sidebar sub-menu panel (设置/表单 etc.) ---------- */

.sidebar-sub-menu-panel {
    background-color: #dbeafe !important;   /* blue-100 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sidebar-sub-menu-panel h2 {
    color: #1e3a8a !important;              /* blue-900 */
    text-shadow: none !important;
}

.sidebar-sub-menu-panel h2 svg {
    color: #1e3a8a !important;              /* blue-900 */
    opacity: 1 !important;
}

.sidebar-menu-item--in-sub-menu .sidebar-menu-item__link {
    color: #1e293b !important;              /* slate-800 */
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased;
}

.sidebar-menu-item--in-sub-menu .sidebar-menu-item__link .menuitem-label {
    color: #1e293b !important;
}

.sidebar-menu-item--in-sub-menu .sidebar-menu-item__link:hover {
    background-color: #bfdbfe !important;   /* blue-200 */
    color: #1d4ed8 !important;              /* blue-700 */
}

.sidebar-menu-item--in-sub-menu .sidebar-menu-item__link:hover .menuitem-label {
    color: #1d4ed8 !important;
}

.sidebar-menu-item--in-sub-menu .sidebar-menu-item__link svg {
    color: #1e40af !important;              /* blue-800 */
}

.sidebar-menu-item--in-sub-menu .sidebar-menu-item__link:hover svg {
    color: #1d4ed8 !important;              /* blue-700 */
}

.sidebar-sub-menu-panel__footer {
    color: #475569 !important;              /* slate-600 */
}

/* ========== Action buttons ========== */

.button-small.bicolor,
.button.bicolor {
    background-color: #2563eb;
}

.button-small.bicolor:hover,
.button.bicolor:hover {
    background-color: #1d4ed8;
}

/* ========== Header ========== */

header[role="banner"] {
    background-color: #1e3a8a;
}

/* ========== Focus rings & links ========== */

a:not([class]) {
    color: #2563eb;
}

a:not([class]):hover {
    color: #1d4ed8;
}

/* ========== Progress / loading bar ========== */

#progress-bar {
    background-color: #60a5fa;
}
