* {
    box-sizing: border-box;
}

.hg-auth-body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 16%, rgba(94, 207, 255, .16), transparent 32%),
        linear-gradient(135deg, #eef6ff 0%, #e5eef8 52%, #d7dce3 100%);
    color: #182435;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hg-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px;
}

.hg-login-shell {
    width: min(920px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 34px 70px rgba(31, 42, 62, .20);
}

.hg-login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 560px;
    overflow: hidden;
    padding: 58px 46px 34px;
    color: #fff;
    background:
        radial-gradient(circle at -8% 52%, rgba(15, 178, 232, .42), transparent 34%),
        radial-gradient(circle at 100% 24%, rgba(255, 255, 255, .14), transparent 34%),
        linear-gradient(180deg, #064b9d 0%, #0c73d4 55%, #1aa7e6 100%);
}

.hg-login-brand::before,
.hg-login-brand::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
}

.hg-login-brand::before {
    width: 380px;
    height: 380px;
    right: -210px;
    top: -120px;
}

.hg-login-brand::after {
    width: 390px;
    height: 390px;
    left: -250px;
    bottom: -140px;
    background: rgba(6, 181, 228, .28);
}

.hg-brand-center {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 390px;
    text-align: center;
}

.hg-brand-kicker {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, .86);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
}

.hg-brand-logo {
    display: grid;
    place-items: center;
    width: 136px;
    min-height: 108px;
    margin-bottom: 16px;
    color: #fff;
    font-size: 34px;
    font-weight: 800;
}

.hg-brand-logo img {
    display: block;
    width: auto;
    max-width: 136px;
    height: auto;
    max-height: 108px;
    object-fit: contain;
    filter: drop-shadow(0 13px 22px rgba(5, 61, 115, .24));
}

.hg-brand-center h1 {
    margin: 0;
    color: #fff;
    font-size: 34px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0;
}

.hg-brand-description {
    max-width: 290px;
    margin: 18px auto 0;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
}

.hg-brand-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 18px;
    color: rgba(255, 255, 255, .70);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.hg-brand-bottom span + span {
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, .34);
}

.hg-mobile-open {
    display: none;
}

.hg-login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 560px;
    padding: 72px 76px;
    background: #fff;
}

.hg-login-back {
    display: none;
}

.hg-form-logo {
    display: none;
}

.hg-login-head {
    margin-bottom: 40px;
}

.hg-login-head h2 {
    margin: 0 0 10px;
    color: #182435;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: 0;
}

.hg-login-head p {
    margin: 0;
    color: #6f7f95;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
}

.hg-login-form {
    display: grid;
    gap: 24px;
}

.hg-field {
    display: grid;
    gap: 8px;
}

.hg-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hg-field label,
.hg-field-row span {
    color: #182435;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hg-field input {
    width: 100%;
    min-height: 44px;
    padding: 0 2px;
    border: 0;
    border-bottom: 1px solid #45bfd1;
    border-radius: 0;
    background: transparent;
    color: #182435;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.hg-field input::placeholder {
    color: #a9b6c6;
}

.hg-field input:focus {
    border-bottom-color: #2378d4;
}

.hg-login-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #2d7fe0, #08b8d4);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 0 18px 30px rgba(22, 124, 210, .24);
}

.hg-login-note {
    max-width: 290px;
    margin: 30px auto 0;
    color: #718096;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

.hg-login-panel .alert {
    margin-bottom: 22px;
}

@media (max-width: 760px) {
    .hg-auth-body {
        background: #eaf3fb;
    }

    .hg-login {
        min-height: 100svh;
        padding: 14px;
    }

    .hg-login-shell {
        width: min(390px, 100%);
        min-height: calc(100svh - 28px);
        display: block;
        overflow: visible;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .hg-login-brand,
    .hg-login-panel {
        width: 100%;
        min-height: calc(100svh - 28px);
        border-radius: 22px;
        box-shadow: 0 24px 48px rgba(31, 42, 62, .22);
    }

    .hg-login-brand {
        display: flex;
        padding: 46px 32px 34px;
    }

    .hg-brand-center {
        min-height: 0;
        flex: 1;
    }

    .hg-brand-kicker {
        margin-bottom: 24px;
        font-size: 25px;
        font-weight: 500;
    }

    .hg-brand-logo {
        width: 150px;
        min-height: 120px;
        margin-bottom: 18px;
    }

    .hg-brand-logo img {
        max-width: 150px;
        max-height: 120px;
    }

    .hg-brand-center h1 {
        font-size: 38px;
        font-weight: 600;
    }

    .hg-brand-description {
        max-width: 280px;
        margin-top: 20px;
        font-size: 13px;
    }

    .hg-mobile-open {
        position: relative;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 168px;
        min-height: 48px;
        margin: 34px auto 0;
        border: 1px solid rgba(255, 255, 255, .78);
        border-radius: 12px;
        background: rgba(255, 255, 255, .08);
        color: #fff;
        cursor: pointer;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
    }

    .hg-brand-bottom {
        font-size: 11px;
    }

    .hg-login-panel {
        display: none;
        padding: 38px 34px;
        background: #fff;
    }

    .hg-login-open .hg-login-brand {
        display: none;
    }

    .hg-login-open .hg-login-panel {
        display: flex;
        animation: hgLoginIn .22s ease-out;
    }

    .hg-login-back {
        display: inline-flex;
        width: fit-content;
        margin: 0 0 34px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #42536a;
        cursor: pointer;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
    }

    .hg-form-logo {
        display: grid;
        place-items: center;
        width: 92px;
        min-height: 70px;
        margin: 0 auto 28px;
        color: #0b72d2;
        font-size: 24px;
        font-weight: 600;
    }

    .hg-form-logo img {
        display: block;
        width: auto;
        max-width: 92px;
        height: auto;
        max-height: 70px;
        object-fit: contain;
    }

    .hg-login-head {
        margin-bottom: 34px;
    }

    .hg-login-head h2 {
        font-size: 29px;
        font-weight: 600;
    }

    .hg-login-head p {
        max-width: 290px;
        font-size: 13.5px;
    }
}

@media (max-width: 420px) {
    .hg-login {
        padding: 12px;
    }

    .hg-login-shell,
    .hg-login-brand,
    .hg-login-panel {
        min-height: calc(100svh - 24px);
    }

    .hg-login-brand {
        padding: 40px 28px 30px;
    }

    .hg-login-panel {
        padding: 34px 30px;
    }

    .hg-brand-kicker {
        font-size: 24px;
    }

    .hg-brand-center h1 {
        font-size: 36px;
    }
}

@keyframes hgLoginIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Final typography correction */
.hg-brand-kicker,
.hg-brand-center h1,
.hg-login-head h2,
.hg-field label,
.hg-field-row span,
.hg-login-submit,
.hg-mobile-open,
.hg-login-back,
.hg-brand-bottom {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.hg-brand-kicker {
    font-size: 17px !important;
    font-weight: 400 !important;
}

.hg-brand-center h1 {
    font-size: 33px !important;
    font-weight: 500 !important;
}

.hg-brand-description {
    color: rgba(255, 255, 255, .84) !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
}

.hg-brand-bottom {
    font-size: 11px !important;
    font-weight: 400 !important;
}

.hg-login-head h2 {
    color: #172235 !important;
    font-size: 31px !important;
    font-weight: 500 !important;
}

.hg-login-head p {
    color: #52657f !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.hg-field label,
.hg-field-row span {
    color: #172235 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: .04em !important;
}

.hg-field input {
    color: #172235 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.hg-login-submit {
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: .08em !important;
}

.hg-login-note {
    color: #52657f !important;
    font-size: 12.5px !important;
    font-weight: 400 !important;
}

.hg-form-logo {
    display: none !important;
}

@media (max-width: 760px) {
    .hg-brand-kicker {
        font-size: 24px !important;
        font-weight: 400 !important;
    }

    .hg-brand-center h1 {
        font-size: 36px !important;
        font-weight: 500 !important;
    }

    .hg-login-head h2 {
        font-size: 29px !important;
        font-weight: 500 !important;
    }

    .hg-login-head p {
        font-size: 13.5px !important;
    }

    .hg-form-logo {
        display: grid !important;
        place-items: center !important;
        width: 74px !important;
        height: 58px !important;
        min-height: 58px !important;
        max-height: 58px !important;
        margin: 0 auto 24px !important;
        overflow: hidden !important;
    }

    .hg-form-logo img {
        display: block !important;
        width: auto !important;
        max-width: 74px !important;
        height: auto !important;
        max-height: 58px !important;
        object-fit: contain !important;
    }

    .hg-field label,
    .hg-field-row span {
        font-weight: 500 !important;
    }

    .hg-login-submit {
        font-weight: 600 !important;
    }
}

/* Match admin dashboard typography rhythm */
.hg-auth-body {
    color: #313a46 !important;
    font-size: 14px !important;
}

.hg-brand-kicker {
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
}

.hg-brand-center h1 {
    font-size: 28px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

.hg-brand-description {
    max-width: 300px !important;
    color: rgba(255, 255, 255, .82) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
}

.hg-brand-bottom {
    font-size: 11px !important;
    font-weight: 500 !important;
}

.hg-login-head h2 {
    color: #111827 !important;
    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

.hg-login-head p {
    color: #8391a2 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
}

.hg-field label,
.hg-field-row span {
    color: #313a46 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: .02em !important;
}

.hg-field input {
    color: #313a46 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.hg-login-submit,
.hg-mobile-open {
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: .04em !important;
}

.hg-login-note {
    color: #8391a2 !important;
    font-size: 12.5px !important;
    font-weight: 400 !important;
}

@media (max-width: 760px) {
    .hg-brand-kicker {
        font-size: 18px !important;
        font-weight: 500 !important;
    }

    .hg-brand-center h1 {
        font-size: 30px !important;
        font-weight: 600 !important;
    }

    .hg-brand-description {
        font-size: 13px !important;
    }

    .hg-login-head h2 {
        font-size: 24px !important;
        font-weight: 600 !important;
    }

    .hg-login-head p {
        font-size: 13px !important;
    }
}

/* Mobile login form: blue stage with white card */
@media (max-width: 760px) {
    .hg-login-open .hg-login-shell {
        display: grid !important;
        place-items: center !important;
        width: min(390px, 100%) !important;
        min-height: calc(100svh - 28px) !important;
        padding: 16px !important;
        border-radius: 22px !important;
        overflow: hidden !important;
        background:
            radial-gradient(circle at -12% 30%, rgba(19, 184, 235, .34), transparent 36%),
            radial-gradient(circle at 112% 0%, rgba(255, 255, 255, .14), transparent 32%),
            linear-gradient(180deg, #064b9d 0%, #0b72d2 58%, #18a7e6 100%) !important;
        box-shadow: 0 24px 48px rgba(31, 42, 62, .22) !important;
    }

    .hg-login-open .hg-login-panel {
        width: 100% !important;
        min-height: calc(100svh - 72px) !important;
        padding: 34px 30px !important;
        border-radius: 20px !important;
        background: #fff !important;
        box-shadow: 0 22px 44px rgba(5, 42, 91, .18) !important;
    }

    .hg-login-open .hg-form-logo {
        width: 86px !important;
        height: 64px !important;
        min-height: 64px !important;
        max-height: 64px !important;
        margin: 0 auto 24px !important;
    }

    .hg-login-open .hg-form-logo img {
        max-width: 86px !important;
        max-height: 64px !important;
    }
}

/* Welcome panel emphasis */
.hg-brand-center h1 {
    font-size: 34px !important;
    font-weight: 600 !important;
}

.hg-brand-description {
    max-width: 340px !important;
    margin-top: 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.6 !important;
}

.hg-brand-bottom {
    font-size: 12px !important;
    font-weight: 600 !important;
}

@media (max-width: 760px) {
    .hg-brand-center h1 {
        font-size: 38px !important;
    }

    .hg-brand-description {
        max-width: 300px !important;
        font-size: 14px !important;
        line-height: 1.55 !important;
    }

    .hg-brand-bottom {
        flex-wrap: wrap !important;
        row-gap: 6px !important;
        font-size: 11.5px !important;
    }
}

@media (max-width: 420px) {
    .hg-brand-center h1 {
        font-size: 36px !important;
    }

    .hg-brand-description {
        max-width: 275px !important;
        font-size: 13.5px !important;
    }

    .hg-brand-bottom {
        font-size: 11px !important;
    }
}

/* Mobile open state layout fix */
@media (max-width: 760px) {
    .hg-login-open .hg-login {
        width: 100% !important;
        padding: 14px !important;
    }

    .hg-login-open .hg-login-shell {
        width: min(390px, 100%) !important;
        max-width: none !important;
        min-height: calc(100svh - 28px) !important;
        display: flex !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 14px !important;
        border-radius: 22px !important;
    }

    .hg-login-open .hg-login-panel {
        flex: 1 1 auto !important;
        align-self: stretch !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: auto !important;
        padding: 38px 32px !important;
        border-radius: 20px !important;
    }

    .hg-login-open .hg-login-head h2 {
        max-width: none !important;
        white-space: normal !important;
    }

    .hg-login-open .hg-login-form,
    .hg-login-open .hg-field,
    .hg-login-open .hg-field input,
    .hg-login-open .hg-login-submit {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Natural kerning */
.hg-auth-body,
.hg-brand-kicker,
.hg-brand-center h1,
.hg-brand-description,
.hg-brand-bottom,
.hg-login-head h2,
.hg-login-head p,
.hg-field label,
.hg-field-row span,
.hg-field input,
.hg-login-submit,
.hg-login-note,
.hg-mobile-open,
.hg-login-back {
    letter-spacing: 0 !important;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
}

.hg-brand-description {
    line-height: 1.68 !important;
}

.hg-brand-bottom {
    gap: 16px !important;
}

.hg-brand-bottom span + span {
    padding-left: 16px !important;
}

/* Mobile open card sizing */
@media (max-width: 760px) {
    .hg-login-open .hg-login {
        padding: 22px 20px !important;
    }

    .hg-login-open .hg-login-shell {
        width: min(390px, 100%) !important;
        min-height: calc(100svh - 44px) !important;
        padding: 20px 18px !important;
    }

    .hg-login-open .hg-login-panel {
        min-height: calc(100svh - 124px) !important;
        padding: 34px 32px !important;
    }
}

@media (max-width: 420px) {
    .hg-login-open .hg-login {
        padding: 20px 18px !important;
    }

    .hg-login-open .hg-login-shell {
        min-height: calc(100svh - 40px) !important;
        padding: 18px 16px !important;
    }

    .hg-login-open .hg-login-panel {
        min-height: calc(100svh - 112px) !important;
        padding: 32px 30px !important;
    }
}

/* Mobile form card balanced frame */
@media (max-width: 760px) {
    .hg-login-open .hg-login-shell {
        align-items: center !important;
        padding: 24px 18px !important;
    }

    .hg-login-open .hg-login-panel {
        min-height: 0 !important;
        height: auto !important;
        padding: 36px 30px !important;
        border-radius: 18px !important;
    }

    .hg-login-open .hg-login-back {
        margin-bottom: 28px !important;
    }

    .hg-login-open .hg-form-logo {
        margin-bottom: 24px !important;
    }

    .hg-login-open .hg-login-head {
        margin-bottom: 30px !important;
    }

    .hg-login-open .hg-login-form {
        gap: 20px !important;
    }

    .hg-login-open .hg-login-submit {
        margin-top: 4px !important;
    }
}

@media (max-width: 420px) {
    .hg-login-open .hg-login-shell {
        padding: 22px 16px !important;
    }

    .hg-login-open .hg-login-panel {
        padding: 34px 30px !important;
    }
}

/* Mobile form crop to content and move back outside card */
@media (max-width: 760px) {
    .hg-login-open .hg-login-shell {
        position: relative !important;
        align-items: center !important;
        padding: 92px 16px 66px !important;
    }

    .hg-login-open .hg-login-back {
        position: absolute !important;
        top: 34px !important;
        left: 34px !important;
        z-index: 3 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 0 !important;
        color: #fff !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        text-decoration: none !important;
    }

    .hg-login-open .hg-login-panel {
        justify-content: flex-start !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 34px 30px 36px !important;
        border-radius: 18px !important;
    }

    .hg-login-open .hg-form-logo {
        margin-bottom: 22px !important;
    }

    .hg-login-open .hg-login-head {
        margin-bottom: 28px !important;
    }

    .hg-login-open .hg-login-form {
        gap: 19px !important;
    }
}

@media (max-width: 420px) {
    .hg-login-open .hg-login-shell {
        padding: 86px 16px 60px !important;
    }

    .hg-login-open .hg-login-back {
        top: 32px !important;
        left: 32px !important;
    }
}

/* Mobile form bottom trim */
@media (max-width: 760px) {
    .hg-login-open .hg-login-shell {
        padding-bottom: 42px !important;
    }

    .hg-login-open .hg-login-panel {
        padding-bottom: 28px !important;
    }
}

@media (max-width: 420px) {
    .hg-login-open .hg-login-shell {
        padding-bottom: 36px !important;
    }

    .hg-login-open .hg-login-panel {
        padding-bottom: 26px !important;
    }
}

/* Mobile form card must follow content height */
@media (max-width: 760px) {
    .hg-login-open .hg-login-shell {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .hg-login-open .hg-login-panel {
        flex: 0 0 auto !important;
        align-self: center !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 34px 30px 38px !important;
    }
}

@media (max-width: 420px) {
    .hg-login-open .hg-login-panel {
        padding: 32px 30px 36px !important;
    }
}
