:root{
  --primary:#1F3556;
  --secondary:#3F4F63;
  --accent:#B89B5E;
  --background:#F7F4EE;
  --surface:#FFFFFF;
  --text:#1F2933;
  --muted:#667085;
  --sidebar:#111827;
  --radius:14px;
  --line:rgba(31,53,86,.12);
  --line-strong:rgba(31,53,86,.18);
  --shadow:0 18px 50px rgba(17,24,39,.08);
  --shadow-soft:0 10px 28px rgba(17,24,39,.055);
  --focus:0 0 0 4px rgba(184,155,94,.18);
}
*{box-sizing:border-box}
html{font-size:16px;scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;font-family:"Segoe UI",Aptos,"Helvetica Neue",Arial,sans-serif;font-size:14px;line-height:1.55;color:var(--text);background:radial-gradient(circle at 8% 4%,rgba(184,155,94,.14),transparent 26rem),radial-gradient(circle at 92% 0%,rgba(31,53,86,.08),transparent 24rem),linear-gradient(135deg,var(--background),#F2EFE8 56%,#F7F4EE)}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
img,svg{max-width:100%}
.hidden{display:none!important}
:focus-visible{outline:none;box-shadow:var(--focus)}
::selection{background:rgba(184,155,94,.28)}

/* Typography: refined, legible, never oversized */
h1,h2{font-family:Georgia,"Times New Roman",serif;color:#172033;letter-spacing:-.012em;font-weight:500;margin:0 0 8px}
h1{font-size:24px;line-height:1.14}
h2{font-size:20px;line-height:1.22}
h3{font-size:16px;line-height:1.3;font-weight:650;margin:0 0 6px;color:#172033}
p{margin:0 0 12px;color:#526070}.muted{color:var(--muted)}.small{font-size:12px;line-height:1.45}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.13em;color:#8A6F3D;font-weight:700;margin-bottom:8px}.custom-css-note{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;color:#667085}

/* Auth / public pages */
.auth-shell{min-height:100vh;display:grid;grid-template-columns:1.02fr .98fr;background:linear-gradient(135deg,#F7F4EE,#EFEADF)}
.auth-visual{position:relative;overflow:hidden;padding:44px;background:linear-gradient(135deg,#0B1220 0%,var(--primary) 61%,#31445F 100%);color:#fff;display:flex;flex-direction:column;justify-content:space-between;isolation:isolate}
.auth-visual:before{content:"";position:absolute;inset:22px;border:1px solid rgba(255,255,255,.08);border-radius:22px;pointer-events:none;z-index:-1}
.auth-visual:after{content:"";position:absolute;right:-9rem;bottom:-9rem;width:25rem;height:25rem;border-radius:50%;background:radial-gradient(circle,rgba(184,155,94,.22),rgba(184,155,94,0) 67%);z-index:-1}
.auth-copy{position:relative;z-index:1;max-width:660px}.auth-copy h1{color:#fff}.auth-copy p{color:rgba(255,255,255,.78)}
.auth-panel{display:flex;align-items:center;justify-content:center;padding:40px 30px}
.auth-card{width:min(430px,100%);background:rgba(255,255,255,.94);border:1px solid rgba(31,53,86,.12);border-radius:18px;box-shadow:0 22px 60px rgba(17,24,39,.11);padding:28px}
.public-page{min-height:100vh;display:grid;place-items:center;padding:24px}.public-card{max-width:860px;width:100%;background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:24px}

/* Brand */
.brand-lock{display:flex;align-items:center;gap:12px;min-width:0}.brand-mark{width:42px;height:42px;min-width:42px;border-radius:14px;background:linear-gradient(135deg,var(--primary),var(--accent));display:grid;place-items:center;color:#fff;font-weight:700;letter-spacing:-.03em;box-shadow:0 16px 34px rgba(0,0,0,.18)}.brand-name{font-family:Georgia,"Times New Roman",serif;font-size:20px;line-height:1.1;font-weight:500;letter-spacing:-.01em;color:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.brand-subtitle{font-size:12px;color:rgba(255,255,255,.64)}

/* Layout */
.app{display:grid;grid-template-columns:268px minmax(0,1fr);min-height:100vh}.main{min-width:0}.content{padding:24px;max-width:1440px;width:100%}
.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,var(--sidebar),#0B1220);color:#fff;padding:18px;display:flex;flex-direction:column;gap:18px;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none;box-shadow:14px 0 40px rgba(17,24,39,.12);z-index:40}.sidebar::-webkit-scrollbar{display:none}.sidebar .brand-lock{padding:2px 2px 4px}.nav{display:flex;flex-direction:column;gap:4px}.nav-section{font-size:10px;text-transform:uppercase;letter-spacing:.13em;color:rgba(255,255,255,.43);margin:12px 10px 4px}.nav a{display:flex;align-items:center;gap:10px;min-height:38px;padding:9px 10px;border-radius:12px;color:rgba(255,255,255,.76);font-weight:550;transition:background .16s ease,color .16s ease,box-shadow .16s ease}.nav a:hover{background:rgba(255,255,255,.075);color:#fff}.nav a.active,.nav a[aria-current="page"]{background:rgba(184,155,94,.16);color:#fff;box-shadow:inset 3px 0 0 var(--accent)}.icon{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}.nav .icon{color:#D9C58D}.sidebar-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.09);padding-top:12px;color:rgba(255,255,255,.68);word-break:break-word}.sidebar-backdrop{display:none}
.topbar{height:66px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 26px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.72);backdrop-filter:blur(16px);position:sticky;top:0;z-index:30}.mobile-menu{display:none;border:1px solid var(--line);background:#fff;color:var(--primary);border-radius:10px;width:38px;height:38px;align-items:center;justify-content:center}

/* Cards and sections */
.hero{background:linear-gradient(135deg,#111827 0%,var(--primary) 58%,var(--secondary) 100%);color:#fff;border-radius:18px;padding:24px;box-shadow:0 24px 70px rgba(17,24,39,.18);display:flex;align-items:flex-start;justify-content:space-between;gap:20px;overflow:hidden;position:relative;isolation:isolate}.hero:after{content:"";position:absolute;right:-70px;bottom:-100px;width:260px;height:260px;border-radius:50%;border:1px solid rgba(255,255,255,.16);background:rgba(184,155,94,.12);z-index:-1}.hero h1,.hero h2{color:#fff}.hero p{color:rgba(255,255,255,.78)}
.grid{display:grid;gap:16px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.panel{background:rgba(255,255,255,.91);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-soft);padding:18px;position:relative}.panel.compact{padding:14px}.panel-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}.metric{display:flex;flex-direction:column;gap:4px}.metric strong{font-family:Georgia,"Times New Roman",serif;font-size:22px;line-height:1.12;font-weight:500;color:var(--primary)}
.matter-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.matter-card{display:flex;flex-direction:column;gap:8px;padding:16px;border:1px solid rgba(31,53,86,.12);border-radius:var(--radius);background:linear-gradient(180deg,#fff,rgba(248,246,241,.72));box-shadow:0 10px 24px rgba(17,24,39,.045);transition:border-color .16s ease,box-shadow .16s ease}.matter-card:hover{border-color:rgba(184,155,94,.35);box-shadow:0 16px 34px rgba(17,24,39,.075)}.matter-card strong{font-family:Georgia,"Times New Roman",serif;font-size:18px;font-weight:500;color:#172033}.matter-card p{font-size:13px;margin:0;color:#526070}
.timeline{display:flex;flex-direction:column;gap:10px}.timeline-item{border-left:2px solid rgba(184,155,94,.45);padding-left:12px}.kanban{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.kanban-col{background:rgba(255,255,255,.66);border:1px solid var(--line);border-radius:var(--radius);padding:12px}.task-card{background:#fff;border:1px solid rgba(31,53,86,.1);border-radius:12px;padding:12px;margin-top:10px;box-shadow:0 7px 18px rgba(17,24,39,.04)}.portal-wrap{max-width:1120px;margin:0 auto}

/* Buttons, badges, forms */
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:10px;border:1px solid rgba(31,53,86,.14);padding:8px 12px;background:#fff;color:var(--primary);font-weight:650;min-height:38px;line-height:1.2;box-shadow:none;white-space:nowrap;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.btn:hover{background:#F8F6F1;border-color:rgba(184,155,94,.32);color:#172033}.btn:active{transform:translateY(1px)}.btn.primary{background:var(--primary);color:#fff;border-color:var(--primary)}.btn.primary:hover{background:#172944;color:#fff;border-color:#172944}.btn.accent{background:var(--accent);color:#111827;border-color:var(--accent)}.btn.accent:hover{background:#D0B16E;color:#111827}.btn.ghost{background:transparent;color:inherit;border-color:rgba(31,53,86,.12)}.topbar .btn.ghost{color:var(--primary)}.sidebar .btn.ghost{color:#fff;border-color:rgba(255,255,255,.16)}.btn.danger{background:#991B1B;color:#fff;border-color:#991B1B}.btn.danger:hover{background:#7F1D1D;color:#fff}.chip,.badge{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(31,53,86,.12);background:rgba(31,53,86,.06);color:var(--primary);border-radius:999px;padding:4px 9px;font-size:12px;font-weight:600;line-height:1.2}.badge.gold{background:rgba(184,155,94,.16);color:#6F5520;border-color:rgba(184,155,94,.22)}.badge.green{background:rgba(22,163,74,.11);color:#166534;border-color:rgba(22,163,74,.16)}.badge.red{background:rgba(220,38,38,.10);color:#991B1B;border-color:rgba(220,38,38,.16)}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.field{display:flex;flex-direction:column;gap:6px}.field.full,.check-row.full{grid-column:1/-1}label,.label{font-size:12px;font-weight:700;color:#344054}input,select,textarea{width:100%;border:1px solid rgba(31,53,86,.16);background:#fff;border-radius:10px;padding:10px 11px;outline:none;color:var(--text);min-height:40px}textarea{min-height:112px;resize:vertical}input[type="checkbox"],input[type="radio"]{min-height:0;width:auto}input[type="color"]{padding:4px;min-height:42px}input::placeholder,textarea::placeholder{color:#98A2B3}input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:var(--focus)}.check-row{display:flex;align-items:center;gap:9px}.check-row label{font-weight:600;color:#526070}.flash{padding:11px 13px;border-radius:12px;margin-bottom:12px;border:1px solid}.flash.success{background:rgba(22,163,74,.10);border-color:rgba(22,163,74,.18);color:#166534}.flash.error{background:rgba(220,38,38,.10);border-color:rgba(220,38,38,.18);color:#991B1B}

/* Tables */
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:var(--radius);background:#fff;box-shadow:0 10px 24px rgba(17,24,39,.045)}table{width:100%;border-collapse:collapse;min-width:680px}th,td{padding:12px;border-bottom:1px solid rgba(31,53,86,.08);text-align:left;vertical-align:top}th{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#667085;background:#F8F6F1;font-weight:700;white-space:nowrap}td{font-size:14px}tbody tr:hover{background:rgba(184,155,94,.045)}tr:last-child td{border-bottom:0}

/* Mobile responsiveness */
@media(max-width:1180px){.grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}.kanban{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:920px){body.nav-open{overflow:hidden}.app{grid-template-columns:1fr}.sidebar{position:fixed;left:-292px;width:280px;max-width:82vw;height:100dvh;transition:left .2s ease;box-shadow:24px 0 70px rgba(17,24,39,.26)}.sidebar.open{left:0}.sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(11,18,32,.44);opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:35}.sidebar.open + .sidebar-backdrop,body.nav-open .sidebar-backdrop{opacity:1;pointer-events:auto}.mobile-menu{display:inline-flex}.topbar{padding:0 14px;height:auto;min-height:62px}.topbar>.actions:last-child{justify-content:flex-end}.content{padding:16px}.hero{flex-direction:column;padding:20px}.grid.two,.grid.three,.grid.four,.form-grid,.kanban,.matter-cards{grid-template-columns:1fr}.auth-shell{grid-template-columns:1fr}.auth-visual{display:none}.auth-panel{padding:24px 16px}.public-page{padding:16px}.panel{padding:16px}.table-wrap{border-radius:12px}table{min-width:620px}.brand-name{max-width:180px}}
@media(max-width:560px){body{font-size:13px}h1{font-size:22px}h2{font-size:18px}.content{padding:12px}.hero,.public-card,.auth-card{border-radius:14px;padding:18px}.panel{border-radius:14px;padding:14px}.topbar .eyebrow{display:none}.topbar .actions{gap:6px}.topbar .btn{padding:8px 9px}.btn{width:auto;white-space:normal}.actions .btn{flex:1 1 auto}.metric strong{font-size:20px}.brand-mark{width:38px;height:38px;min-width:38px}.brand-name{font-size:18px}}
/* =========================================================
   HyLegal Mobile Refinement Patch
   Fixes low contrast, clipped text, oversized radius issues
   ========================================================= */

:root {
    --hy-navy: #17243a;
    --hy-navy-2: #1f3556;
    --hy-text: #17202f;
    --hy-muted: #526173;
    --hy-border: rgba(31, 53, 86, 0.16);
    --hy-gold: #b89b5e;
    --hy-bg: #f3efe7;
    --hy-surface: #ffffff;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    color: var(--hy-text) !important;
    background: linear-gradient(135deg, #f3efe7, #eee8dd) !important;
}

/* Improve readable contrast */
p,
li,
td,
label,
.small,
.muted,
.card p,
.panel p,
.auth-card p,
.portal-card p {
    color: var(--hy-muted) !important;
}

/* Keep headings elegant but not huge */
h1 {
    font-size: clamp(21px, 5vw, 24px) !important;
    line-height: 1.18 !important;
}

h2 {
    font-size: clamp(18px, 4.2vw, 22px) !important;
    line-height: 1.22 !important;
}

h3 {
    font-size: clamp(16px, 3.8vw, 20px) !important;
    line-height: 1.25 !important;
}

/* Prevent text clipping inside rounded elements */
.panel,
.card,
.auth-card,
.portal-card,
.stat-card,
.workspace-card,
.table-card,
.page-hero,
.portal-hero,
.brand-hero,
.feature-card,
.metric-card {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Make rounded corners less aggressive on mobile */
.panel,
.card,
.auth-card,
.portal-card,
.stat-card,
.workspace-card,
.table-card {
    border-radius: 14px !important;
}

/* Buttons: prevent overlay/clipped text */
.btn,
button,
button.btn,
a.btn,
input[type="submit"] {
    min-height: 42px !important;
    height: auto !important;
    padding: 10px 15px !important;
    border-radius: 10px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    max-width: 100% !important;
}

/* Ensure button text stays readable */
.btn.primary,
button.primary,
a.btn.primary {
    background: #1f3556 !important;
    color: #ffffff !important;
    border-color: #1f3556 !important;
}

.btn.ghost,
.btn.light,
a.btn.ghost,
button.btn.ghost {
    background: #ffffff !important;
    color: #1f3556 !important;
    border: 1px solid rgba(31, 53, 86, 0.18) !important;
}

/* Badges often cut text on mobile */
.badge,
.status,
.pill,
.tag {
    height: auto !important;
    min-height: 26px !important;
    line-height: 1.25 !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    white-space: normal !important;
    overflow: visible !important;
    color: #1f3556 !important;
    background: rgba(184, 155, 94, 0.14) !important;
    border: 1px solid rgba(184, 155, 94, 0.24) !important;
}

/* Form fields: better mobile spacing */
input,
select,
textarea {
    min-height: 42px !important;
    height: auto !important;
    line-height: 1.35 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    color: #17202f !important;
    background: #ffffff !important;
    border: 1px solid rgba(31, 53, 86, 0.18) !important;
}

textarea {
    min-height: 110px !important;
}

/* Tables should scroll, not squeeze */
.table-wrap,
.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

table {
    min-width: 720px;
}

/* Mobile layout */
@media (max-width: 760px) {
    body {
        background: #f3efe7 !important;
    }

    .app-shell,
    .layout,
    .main-layout {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .content,
    .main-content,
    main {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px !important;
        overflow-x: hidden !important;
    }

    .topbar,
    .app-topbar {
        padding: 12px 14px !important;
        border-radius: 0 0 14px 14px !important;
        gap: 10px !important;
    }

    .page-hero,
    .portal-hero,
    .brand-hero {
        border-radius: 16px !important;
        padding: 18px !important;
        margin-bottom: 14px !important;
        overflow: visible !important;
    }

    .page-hero p,
    .portal-hero p,
    .brand-hero p {
        color: rgba(255, 255, 255, 0.84) !important;
        line-height: 1.45 !important;
    }

    .grid,
    .grid.two,
    .grid.three,
    .grid.four,
    .cards,
    .dashboard-grid,
    .module-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .panel,
    .card,
    .auth-card,
    .portal-card,
    .workspace-card {
        padding: 14px !important;
        border-radius: 14px !important;
        box-shadow: 0 10px 24px rgba(17, 24, 39, 0.07) !important;
    }

    .auth-shell {
        display: block !important;
        min-height: 100dvh !important;
        background: #f3efe7 !important;
    }

    .auth-visual {
        min-height: auto !important;
        padding: 22px 18px !important;
        border-radius: 0 0 18px 18px !important;
        overflow: visible !important;
    }

    .auth-panel {
        padding: 16px !important;
    }

    .auth-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .brand-lock {
        gap: 10px !important;
        min-width: 0 !important;
    }

    .brand-name,
    .brand-subtitle {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .brand-mark {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        border-radius: 12px !important;
    }

    .sidebar {
        max-width: 88vw !important;
        overflow-y: auto !important;
        scrollbar-width: none !important;
    }

    .sidebar::-webkit-scrollbar {
        display: none !important;
    }

    .nav a {
        min-height: 42px !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
        white-space: normal !important;
        line-height: 1.25 !important;
    }

    .nav-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
    }

    .actions,
    .button-row,
    .form-actions,
    .toolbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .actions .btn,
    .button-row .btn,
    .form-actions .btn,
    .toolbar .btn {
        width: 100% !important;
    }
}

/* Extra small phones */
@media (max-width: 390px) {
    .content,
    .main-content,
    main {
        padding: 10px !important;
    }

    .panel,
    .card,
    .auth-card,
    .portal-card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .btn,
    button,
    a.btn {
        padding: 10px 12px !important;
    }
}
/* =========================================================
   HyLegal Premium Login Background
   Mobile + Desktop refined law-firm background design
   ========================================================= */

.auth-shell {
    position: relative !important;
    min-height: 100dvh !important;
    isolation: isolate !important;
    background:
        linear-gradient(
            90deg,
            rgba(10, 18, 32, 0.94) 0%,
            rgba(18, 34, 58, 0.86) 42%,
            rgba(243, 239, 231, 0.96) 60%
        ),
        url("/brand/login-law-bg.png") center center / cover no-repeat !important;
}

.auth-shell::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: -1 !important;
    background:
        radial-gradient(circle at 18% 18%, rgba(184, 155, 94, 0.20), transparent 32rem),
        radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.10), transparent 26rem),
        linear-gradient(180deg, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.22)) !important;
    pointer-events: none !important;
}

.auth-visual {
    background: transparent !important;
    color: #ffffff !important;
}

.auth-copy h1,
.auth-visual h1 {
    color: #ffffff !important;
    font-size: 24px !important;
    line-height: 1.16 !important;
}

.auth-copy p,
.auth-visual p,
.auth-visual .small {
    color: rgba(255, 255, 255, 0.82) !important;
}

.auth-panel {
    background: transparent !important;
}

.auth-card {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    box-shadow:
        0 28px 80px rgba(10, 18, 32, 0.24),
        0 1px 0 rgba(255, 255, 255, 0.85) inset !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 18px !important;
    overflow: visible !important;
}

.auth-card h2 {
    color: #0f172a !important;
    font-size: 24px !important;
    line-height: 1.16 !important;
}

.auth-card p,
.auth-card label,
.auth-card .small,
.auth-card .muted {
    color: #35445a !important;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[name="_username"],
.auth-card input[name="_password"] {
    min-height: 46px !important;
    height: auto !important;
    border-radius: 12px !important;
    border: 1px solid rgba(31, 53, 86, 0.18) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    color: #17202f !important;
    line-height: 1.35 !important;
    padding: 11px 13px !important;
    box-shadow: none !important;
}

.auth-card input:focus {
    border-color: #b89b5e !important;
    box-shadow: 0 0 0 4px rgba(184, 155, 94, 0.16) !important;
    outline: none !important;
}

.auth-card .btn.primary,
.auth-card button.btn.primary,
.auth-card button[type="submit"] {
    min-height: 46px !important;
    height: auto !important;
    border-radius: 12px !important;
    background: #1f3556 !important;
    color: #ffffff !important;
    border: 1px solid #1f3556 !important;
    box-shadow: 0 14px 28px rgba(31, 53, 86, 0.20) !important;
    line-height: 1.25 !important;
    padding: 12px 16px !important;
    overflow: visible !important;
}

.auth-card .btn.primary:hover,
.auth-card button[type="submit"]:hover {
    background: #172944 !important;
    border-color: #172944 !important;
}

/* Make checkbox cleaner */
.auth-card input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    border-radius: 5px !important;
    accent-color: #1f3556 !important;
}

.check-row {
    align-items: center !important;
    gap: 10px !important;
    color: #35445a !important;
}

/* =========================================================
   Mobile login refinement
   ========================================================= */

@media (max-width: 760px) {
    .auth-shell {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        min-height: 100dvh !important;
        padding: 18px 14px 28px !important;
        background:
            linear-gradient(
                180deg,
                rgba(10, 18, 32, 0.58) 0%,
                rgba(10, 18, 32, 0.42) 22%,
                rgba(243, 239, 231, 0.92) 52%,
                rgba(243, 239, 231, 0.98) 100%
            ),
            url("/brand/login-law-bg.png") center top / cover no-repeat !important;
    }

    .auth-shell::before {
        background:
            radial-gradient(circle at 50% 0%, rgba(184, 155, 94, 0.20), transparent 20rem),
            linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 38%) !important;
    }

    .auth-visual {
        display: none !important;
    }

    .auth-panel {
        width: 100% !important;
        min-height: auto !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }

    .auth-card {
        width: 100% !important;
        max-width: 430px !important;
        margin: 18px auto 0 !important;
        padding: 22px !important;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.94) !important;
        box-shadow:
            0 22px 60px rgba(10, 18, 32, 0.24),
            0 1px 0 rgba(255, 255, 255, 0.90) inset !important;
    }

    .auth-card h2 {
        font-size: 24px !important;
        margin-bottom: 8px !important;
    }

    .auth-card p {
        font-size: 15px !important;
        line-height: 1.45 !important;
    }

    .auth-card label {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }

    .auth-card input[type="email"],
    .auth-card input[type="password"],
    .auth-card input[name="_username"],
    .auth-card input[name="_password"] {
        min-height: 44px !important;
        border-radius: 11px !important;
        font-size: 15px !important;
    }

    .auth-card .field {
        margin-top: 12px !important;
    }

    .auth-card button[type="submit"] {
        width: 100% !important;
        min-height: 46px !important;
        font-size: 15px !important;
    }

    .auth-card .small.muted {
        font-size: 13px !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
    }
}

/* Very small phones */
@media (max-width: 390px) {
    .auth-shell {
        padding: 12px 10px 24px !important;
    }

    .auth-card {
        padding: 18px !important;
        border-radius: 16px !important;
    }

    .auth-card h2 {
        font-size: 22px !important;
    }
}
/* =========================================================
   HyLegal refined login branding
   ========================================================= */

.brand-lock-refined {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.brand-mark-svg {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background:
        linear-gradient(135deg, rgba(184,155,94,0.18), rgba(255,255,255,0.08)) !important;
    border: 1px solid rgba(184,155,94,0.34) !important;
    box-shadow: 0 16px 34px rgba(0,0,0,0.22) !important;
    overflow: hidden !important;
}

.brand-mark-svg svg {
    width: 34px !important;
    height: 34px !important;
    display: block !important;
}

.auth-card-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    margin-bottom: 18px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid rgba(31, 53, 86, 0.10) !important;
}

.auth-wordmark {
    display: block !important;
    width: 168px !important;
    max-width: 72% !important;
    height: auto !important;
    object-fit: contain !important;
}

.auth-card-brand span {
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: #667085 !important;
}

.auth-card h2 {
    margin-top: 0 !important;
}

/* Remove old ugly text mark styling from login only */
.auth-visual .brand-mark {
    display: none !important;
}

/* Mobile refinement */
@media (max-width: 760px) {
    .auth-card-brand {
        align-items: center !important;
        text-align: center !important;
        margin-bottom: 16px !important;
        padding-bottom: 14px !important;
    }

    .auth-wordmark {
        width: 150px !important;
        max-width: 80% !important;
    }

    .auth-card-brand span {
        font-size: 12.5px !important;
    }

    .brand-mark-svg {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        border-radius: 12px !important;
    }

    .brand-mark-svg svg {
        width: 31px !important;
        height: 31px !important;
    }
}
