/* Login page additions on top of custom.css / ge.css. The look stays the original one. */

/* Compact header on the login pages (the shared layout's logo is 105px tall). */
.navbar-laravel {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

/* custom.css fixes the white logo box at 150x130px; shrink the box, not just the image. */
.navbar-laravel .brand-logo {
    width: auto;
}

.navbar-laravel .school-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 56px;
    padding: 4px 6px !important;
}

.navbar-laravel .school-logo img {
    display: block;
    height: 48px;
    width: auto;
}

.navbar-laravel .navbar-nav {
    align-items: center;
}

.navbar-laravel .nav-link {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

/* The header has no mobile menu: on phones keep logo and links on one compact row instead of a stacked column. */
@media (max-width: 767.98px) {
    .navbar-laravel {
        flex-wrap: nowrap;
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .navbar-laravel .brand-logo {
        flex-shrink: 0;
    }

    .navbar-laravel .navbar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-left: auto;
    }

    .navbar-laravel .navbar-nav .nav-link,
    .navbar-laravel .navbar-nav > li.nav-link {
        padding: .25rem .4rem;
        font-size: 13px;
        white-space: nowrap;
    }

    .navbar-laravel .navbar-nav > li.nav-link .nav-link_menu_lang {
        font-size: 12px;
    }
}

/*
 * Centre the login block (and the error card) on the whole screen, not just the area below the header:
 * a bottom margin equal to the header height balances the header, so the free space's centre is the screen's centre.
 */
:root {
    --login-navbar-height: 64px;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#app > .navbar-laravel {
    min-height: var(--login-navbar-height);
}

#app > main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: var(--login-navbar-height);
}

/* Same image placement as .bg; it only scales up (keeping its aspect ratio) if a keyboard warning makes the card taller than the image. */
.login-bg {
    background-size: cover;
    background-position: left top;
}

/*
 * The form rows are ".row.col-md-12": the row's -15px side margins plus the column's fixed 100% width
 * shift every row 15px to the left (very visible on phones). Cancel the margins so the rows are centred.
 */
.login-bg .row.col-md-12 {
    margin-left: 0;
    margin-right: 0;
}

@media (max-width: 767.98px) {
    .login-bg .row.col-md-12 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .login-bg .row.col-md-12 > [class*="col-md-"] {
        padding-left: 0;
        padding-right: 0;
    }
}

.login-label {
    color: #fff;
    font-size: 15px;
    margin-bottom: .35rem;
    padding-left: 1rem;
}

.login-link,
.login-link:hover,
.login-link:focus {
    color: #ffa619;
    font-size: 15px;
    font-weight: 600;
}

.login-link:hover,
.login-link:focus {
    text-decoration: underline;
}

.login-warning {
    color: #ffd27f;
    font-size: 13px;
    margin-top: .35rem;
    padding-left: 1rem;
}

/* Password recovery pages: intro text, password rules hint and "link sent" badge. */
.login-intro {
    margin: 0;
    color: #fff;
    font-size: 15px;
    text-align: center;
}

.login-hint {
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    margin-top: .4rem;
    padding-left: 1rem;
}

.login-success-jump,
.login-success-jump:hover,
.login-success-jump:focus {
    display: inline-block;
    margin-top: .6rem;
    padding: .3rem .9rem;
    color: #fff;
    background: #198754;
    border-radius: 1rem;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.login-success-jump::before {
    content: '\2713';
    margin-right: .4rem;
}

.login-success-jump:hover,
.login-success-jump:focus {
    background: #157347;
    text-decoration: underline;
}

/* Inputs: keep the original pill shape, but with readable text, a visible focus ring and a strong error state. */
.login-bg .form-control.bd50 {
    height: 52px;
    padding: 0 1.25rem;
    font-size: 16px;
    color: #212529;
    background-color: #fff;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out, background-color .15s ease-in-out;
}

.login-bg .form-control.bd50::placeholder {
    color: #8a9199;
    font-size: 15px;
    font-style: normal;
}

.login-bg .form-control.bd50:focus {
    border-color: #ffa619;
    box-shadow: 0 0 0 4px rgba(255, 166, 25, .45);
}

.login-bg .form-control.bd50.is-invalid {
    border-color: #ff4d4f;
    background-color: #fff1f1;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.1rem center;
    background-size: 22px 22px;
    padding-right: 3.25rem;
    box-shadow: 0 0 0 4px rgba(255, 77, 79, .55);
}

.login-bg .form-control.bd50.is-invalid:focus {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 5px rgba(255, 77, 79, .7);
}

/* Error message under a field: a solid red badge stays readable on the dark photo. */
.login-error-jump,
.login-error-jump:hover,
.login-error-jump:focus {
    display: inline-block;
    margin-top: .6rem;
    padding: .3rem .9rem;
    color: #fff;
    background: #dc3545;
    border-radius: 1rem;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.login-error-jump::before {
    content: '\26A0';
    margin-right: .4rem;
}

.login-error-jump:hover,
.login-error-jump:focus {
    background: #c82333;
    text-decoration: underline;
}

.password-wrapper {
    position: relative;
}

/* Password field: eye toggle at the right edge, error icon just left of it. */
.login-bg .password-wrapper .form-control.bd50 {
    padding-right: 4rem;
}

.login-bg .password-wrapper .form-control.bd50.is-invalid {
    padding-right: 6.25rem;
    background-position: right 3.75rem center;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: .6rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: #868e96;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.password-toggle:hover {
    color: #343a40;
    background-color: #f1f3f5;
}

.password-toggle:focus {
    outline: 0;
    color: #343a40;
    box-shadow: 0 0 0 3px rgba(255, 166, 25, .6);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .icon-eye-off,
.password-toggle.is-revealed .icon-eye {
    display: none;
}

.password-toggle.is-revealed .icon-eye-off {
    display: block;
}

/* Caps Lock icon inside the field, left of the eye; the text padding grows instead of anything moving. */
.caps-icon {
    position: absolute;
    top: 50%;
    right: 3.1rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 2.5rem;
    color: #e08a00;
    pointer-events: none;
    animation: caps-icon-in .15s ease-out;
}

.caps-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-bg .password-wrapper.caps-on .form-control.bd50 {
    padding-right: 5.75rem;
}

.login-bg .password-wrapper.caps-on .form-control.bd50.is-invalid {
    padding-right: 8rem;
    background-position: right 5.5rem center;
}

@keyframes caps-icon-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Caps Lock: a floating tooltip under the field, so it never moves the layout. */
.caps-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 1rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .75rem;
    background: #212529;
    color: #fff;
    border-radius: .5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    animation: caps-tooltip-in .15s ease-out;
}

.caps-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 1.1rem;
    width: 10px;
    height: 10px;
    background: #212529;
    transform: rotate(45deg);
}

.caps-tooltip svg {
    width: 15px;
    height: 15px;
    fill: #ffa619;
}

@keyframes caps-tooltip-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-help-card {
    background: #fff;
}

.login-help-card .alert {
    font-size: 15px;
}

.login-help {
    color: #343a40;
    font-size: 14px;
}

.login-help summary {
    color: #0056b3;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.login-help ul {
    padding-left: 1.2rem;
    margin: .5rem 0 0;
}
