body.logivery-login-active {
    --logivery-login-background: #eef3f0;
    --logivery-login-panel: #fff;
    --logivery-login-overlay: rgba(13, 54, 42, .72);
    --logivery-login-overlay-opacity: 1;
    --logivery-login-primary: #16875b;
    --logivery-login-side-text: #fff;
    --logivery-login-footer-link-color: #fff;
    --logivery-login-radius: 18px;
    min-height: 100vh;
    background-color: var(--logivery-login-background);
    background-image: var(--logivery-login-background-image, none);
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.logivery-login-active .container.content {
    width: 100%;
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
    box-sizing: border-box;
    padding: clamp(20px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Reserve room for the links and the native EspoCRM footer. The native login
   styles can assign a full-height value to the centering container; height:auto
   prevents that value from pushing the link row below the viewport. */
.logivery-login-has-footer-links .container.content {
    padding-block: clamp(18px, 3.5vh, 42px);
}

@media (min-width: 1024px) {
    body.logivery-login-active.logivery-login-has-footer-links:not(.logivery-login-layout-centered) .container-centering {
        height: auto;
        min-height: min(620px, calc(100vh - 200px));
        min-height: min(620px, calc(100dvh - 200px));
    }
}

.logivery-login-links {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 14px 18px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 22px;
    text-align: center;
}

.logivery-login-links a {
    color: var(--logivery-login-footer-link-color);
    font-family: inherit;
    font-size: 21px;
    font-weight: 400;
    line-height: 1.55;
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}

.logivery-login-links a:hover,
.logivery-login-links a:focus {
    color: var(--logivery-login-footer-link-color);
    text-decoration: underline;
}

.logivery-login-layout-centered .logivery-login-links {
    width: min(470px, 100%);
}

.branding-footer-link-header,
.branding-footer-link-row {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(240px, 1.5fr) 120px auto;
    gap: 10px;
    align-items: center;
}

.branding-footer-link-header {
    margin-bottom: 7px;
    color: var(--text-muted-color, #777);
    font-size: 12px;
    font-weight: 600;
}

.branding-footer-link-row + .branding-footer-link-row {
    margin-top: 8px;
}

.branding-footer-link-checkbox {
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
}

.branding-footer-link-remove {
    padding-inline: 4px;
}

.branding-footer-link-add {
    margin-top: 12px;
}

.branding-footer-links-empty {
    margin: 0 0 10px;
}

.logivery-login-active .container-centering {
    width: min(1120px, 100%);
    min-height: min(680px, calc(100vh - 144px));
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
    padding: 0;
    border-radius: var(--logivery-login-radius);
    overflow: hidden;
    /* The form owns its opaque surface. The grid itself must stay transparent
       so side-overlay opacity can reveal the full-page background image. */
    background: transparent;
    box-shadow: 0 24px 80px rgba(18, 38, 31, .18);
}

.logivery-login-layout-imageRight .container-centering {
    grid-template-columns: minmax(360px, .75fr) minmax(0, 1.25fr);
}

.logivery-login-active #login.logivery-login-card {
    /* EspoCRM's block-center-sm class applies a relative top offset intended
       for the stock standalone card. In the split grid that offset moves the
       entire form down and leaves the upper-right corner empty. */
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--logivery-login-panel);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logivery-login-active #login .panel-heading,
.logivery-login-active #login .panel-body {
    width: min(430px, 100%);
    margin-inline: auto;
    padding-inline: clamp(28px, 4vw, 58px);
    background: transparent;
}

.logivery-login-active #login .panel-heading {
    padding-top: 42px;
    padding-bottom: 14px;
}

.logivery-login-active #login .panel-body {
    padding-top: 14px;
    padding-bottom: 42px;
}

.logivery-login-active #login .logo-container {
    width: 100%;
    height: auto;
    min-height: 76px;
    border-radius: 0;
    display: flex;
    align-items: center;
}

.logivery-login-active #login .logo-container img.logo {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: 110px;
    object-fit: contain;
    object-position: center;
}

.logivery-login-active #login .form-control {
    min-height: 46px;
    border-radius: calc(var(--logivery-login-radius) * .5);
}

.logivery-login-active #login #btn-login,
.logivery-login-active #login #sign-in {
    min-height: 44px;
    border-radius: calc(var(--logivery-login-radius) * .5);
}

.logivery-login-active #login #btn-login,
.logivery-login-active #login #sign-in.btn-primary {
    border-color: var(--logivery-login-primary);
    background-color: var(--logivery-login-primary);
}

.logivery-login-active #login #sign-in {
    width: 100%;
    border-color: var(--logivery-login-primary);
    color: var(--logivery-login-primary);
}

.logivery-login-active #login a,
.logivery-login-active #login .btn-link {
    color: var(--logivery-login-primary);
}

.logivery-login-side {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    color: var(--logivery-login-side-text);
    background: transparent;
}

.logivery-login-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--logivery-login-overlay);
    opacity: var(--logivery-login-overlay-opacity);
    z-index: 0;
}

.logivery-login-side-content {
    position: relative;
    z-index: 2;
    max-width: none;
    flex: 0 0 auto;
    margin-top: auto;
    padding: clamp(38px, 5vw, 72px);
    overflow: hidden;
}

.logivery-login-side-content > * {
    position: relative;
    z-index: 1;
}

.logivery-login-side-media {
    position: relative;
    z-index: 1;
    flex: 1 1 320px;
    min-height: 280px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.logivery-login-side-foreground {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: contain;
    object-position: top center;
}

.logivery-login-side-no-image .logivery-login-side-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.logivery-login-side h1 {
    margin: 0 0 18px;
    color: inherit;
    font-size: clamp(32px, 4vw, 58px);
    font-weight: 650;
    line-height: 1.04;
    letter-spacing: -.03em;
}

.logivery-login-side p {
    margin: 0;
    color: inherit;
    font-size: clamp(16px, 1.6vw, 21px);
    line-height: 1.55;
    white-space: pre-line;
}

.logivery-login-legal {
    margin: 28px 0 0;
    color: var(--text-soft, #707070);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-line;
}

.logivery-login-layout-centered .container-centering {
    display: block;
    width: min(470px, 100%);
    min-height: 0;
}

.logivery-login-active > footer {
    background: transparent;
}

@media (max-width: 1023px) {
    .logivery-login-active .container.content {
        padding: 24px;
    }

    .logivery-login-active .container-centering,
    .logivery-login-layout-imageRight .container-centering {
        display: block;
        width: min(480px, 100%);
        min-height: 0;
    }

    .logivery-login-active .logivery-login-side {
        display: none;
    }
}

@media (max-width: 575px) {
    .logivery-login-active .container.content {
        min-height: calc(100vh - 42px);
        padding: 0;
        align-items: stretch;
    }

    .logivery-login-active .container-centering {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .logivery-login-active #login.logivery-login-card {
        min-height: calc(100vh - 42px);
    }

    .logivery-login-links {
        padding: 12px 16px 16px;
        gap: 8px 16px;
    }
}

@media (max-width: 767px) {
    .branding-footer-link-header {
        display: none;
    }

    .branding-footer-link-row {
        grid-template-columns: 1fr auto;
    }

    .branding-footer-link-text,
    .branding-footer-link-url {
        grid-column: 1 / -1;
    }
}
