/* Login page redesign for Envision Technologies */
:root {
    color-scheme: light dark;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-gray-100: #f6f6f6;
    --color-gray-200: #e7e7e7;
    --color-gray-700: #5a5a5a;
    --color-overlay-dark: rgba(6, 15, 29, 0.78);
    --color-overlay-mid: rgba(6, 15, 29, 0.55);
    --color-card-shadow: rgba(16, 34, 56, 0.18);
    --color-input-border: rgba(0, 0, 0, 0.08);
    --transition-base: all 220ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--color-white);
    background-color: var(--color-black);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.login-page__background,
.login-page__background::after {
    position: fixed;
    inset: 0;
    z-index: -2;
}

.login-page__background {
    background: url("../wallpaper.avif") center center / cover no-repeat;
}

.login-page__background::after {
    content: "";
    z-index: -1;
    background: linear-gradient(104deg, rgba(6, 15, 26, 0.92) 0%, rgba(8, 18, 35, 0.78) 42%, rgba(9, 26, 45, 0.48) 64%, rgba(11, 32, 52, 0.18) 100%);
}

.login-page__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 650px);
    grid-template-areas: "hero panel";
    padding: 40px;
    gap: clamp(32px, 5vw, 64px);
    align-items: flex-start;
    flex: 1;
    width: 100%;
    margin: 0;
}

.login-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-width: 700px;
    width: 100%;
    padding-top: 0;
    min-height: clamp(520px, 70vh, 640px);
    grid-area: hero;
}

.login-hero__header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: clamp(48px, 7vw, 96px);
}

.login-hero__logo {
    width: clamp(160px, 26vw, 200px);
    height: auto;
}

.login-carousel {
    max-width: 700px;
    margin-top: auto;
    padding-top: 380px;
}

.login-carousel__item {
    display: none;
    flex-direction: column;
    gap: 25px;
}

.login-carousel__item.is-active {
    display: flex;
    animation: fade-in 320ms ease-in;
}

.login-carousel__title {
    font-size: clamp(32px, 3.6vw, 52px);
    line-height: 1.1;
    font-weight: 700;
    margin: 0;
}

.login-carousel__description {
    padding-bottom: 50px;
    font-size: 16px;
    line-height: 1.65;
    max-width: 60ch;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.login-carousel__dots {
    margin-top: 24px;
    display: inline-flex;
    gap: 14px;
}

.login-carousel__dot {
    display: inline-block;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.32);
    padding: 0;
    cursor: pointer;
    transition: var(--transition-base);
}

.login-carousel__dot.is-active {
    background: rgba(255, 255, 255, 0.9);
}

.login-panel {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    grid-area: panel;
}

.login-card {
    width: min(650px, 100%);
    background: rgba(255, 255, 255, 0.98);
    color: #0e1825;
    border-radius: 28px;
    padding: 60px 64px 60px;
    min-height: clamp(520px, 70vh, 640px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px var(--color-card-shadow);
    backdrop-filter: blur(1px);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.login-card:hover,
.login-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 30px 80px rgba(12, 24, 48, 0.28);
}

.login-card__heading {
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 700;
    margin-bottom: 12px;
}

.login-card__subtitle {
    font-size: 16px;
    color: #415064;
    margin-bottom: 36px;
}

.login-card__form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex: 1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-field.has-error .form-input {
    border-color: rgba(210, 59, 59, 0.6);
    background: rgba(255, 240, 240, 0.9);
}

.form-field.has-error .form-input:focus {
    box-shadow: 0 0 0 2px rgba(234, 82, 82, 0.18);
}

.form-field__label {
    font-size: 15px;
    font-weight: 600;
    color: #1b2a3a;
}

.form-field__control {
    position: relative;
}

.form-input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid var(--color-input-border);
    background-color: var(--color-gray-100);
    padding: 16px 54px 16px 60px;
    font-size: 15px;
    color: #15212f;
    transition: var(--transition-base);
}

.form-input:focus {
    outline: none;
    border-color: #b5c7ff;
    box-shadow: 0 0 0 2px rgba(88, 127, 255, 0.15);
    background-color: var(--color-white);
}

.form-input::placeholder {
    color: #8692a6;
}

.form-field__icon {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 24px;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.form-field__icon svg {
    width: 18px;
    height: 18px;
    color: #303f52;
}

.toggle-password {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #5a6a81;
    transition: color 160ms ease;
}

.toggle-password:focus-visible {
    outline: 2px solid #0d1726;
    outline-offset: 2px;
}

.toggle-password:hover {
    color: #232e40;
}

.form-field__error {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #c02727;
}

.login-card__error {
    border-radius: 12px;
    border: 1px solid rgba(180, 30, 30, 0.18);
    background: rgba(255, 97, 97, 0.16);
    padding: 14px 18px;
    font-size: 14px;
    color: #8a1a1a;
}

.login-card__submit {
    margin-top: 10px;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: #000000;
    color: var(--color-white);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-card__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.login-card__submit:active {
    transform: translateY(0);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.16);
}

.login-card__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-card__footnote {
    margin-top: auto;
    padding-top: 110px;
    font-size: 14px;
    line-height: 1.65;
    color: #546176;
}

.login-footer {
    background: rgba(0, 0, 0, 0.88);
    padding: 12px 64px 5px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.6;
}

.login-footer__text {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.login-footer__copyright {
    letter-spacing: 0.18em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.login-errors {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

@media (max-width: 1280px) {
    .login-page__layout {
        padding: 40px;
        gap: clamp(28px, 5vw, 56px);
    }

    .login-card {
        padding: 48px 44px 40px;
    }
}

@media (max-width: 1024px) {
    .login-page__layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "logo"
            "panel"
            "carousel";
        padding: clamp(32px, 5vw, 40px);
        gap: clamp(28px, 6vw, 44px);
        max-width: none;
        justify-items: center;
    }

    .login-panel {
        justify-content: center;
        width: 100%;
    }

    .login-hero {
        display: contents;
    }

    .login-carousel {
        grid-area: carousel;
        margin: clamp(28px, 8vw, 60px) auto 0;
        width: 100%;
        max-width: 640px;
        padding-top: 0;
        padding-bottom: 24px;
    }

    .login-card {
        margin: 0 auto;
    }

    .login-hero__header {
        grid-area: logo;
        width: 100%;
        max-width: 640px;
        justify-content: center;
        margin: 0 0 clamp(28px, 6vw, 48px);
    }
}

@media (max-width: 780px) {
    body.login-page {
        background-color: #020912;
    }

    .login-page__background::after {
        background: linear-gradient(180deg, rgba(4, 8, 12, 0.88) 0%, rgba(6, 12, 22, 0.78) 48%, rgba(8, 18, 34, 0.48) 100%);
    }

    .login-page__layout {
        padding: 28px 20px 24px;
        grid-template-areas:
            "logo"
            "panel"
            "carousel";
        gap: 28px;
    }

    .login-hero__header {
        justify-content: center;
        margin: 0 auto 24px;
    }

    .login-hero {
        display: contents;
    }

    .login-carousel {
        margin-top: 40px;
        text-align: center;
        max-width: 560px;
        padding-top: 0;
        padding-bottom: 24px;
    }

    .login-carousel__description {
        max-width: none;
    }

    .login-carousel__dots {
        justify-content: center;
    }

    .login-panel {
        width: 100%;
    }

    .login-card {
        padding: 44px 28px 36px;
        border-radius: 24px;
        min-height: auto;
        transform: none;
        box-shadow: 0 18px 36px rgba(12, 24, 48, 0.22);
    }

    .login-card:hover,
    .login-card:focus-within {
        transform: none;
        box-shadow: 0 22px 44px rgba(12, 24, 48, 0.24);
    }

    .login-footer {
        padding: 20px 20px 32px;
    }

    .login-footer__text {
        text-align: left;
    }
}

@media (max-width: 540px) {
    .login-hero__brand-name {
        font-size: 18px;
    }

    .login-hero__brand-subtitle {
        font-size: 11px;
    }

    .login-carousel__title {
        font-size: 30px;
    }

    .form-input {
        padding: 14px 50px 14px 54px;
        font-size: 14px;
    }

    .login-card__subtitle {
        font-size: 15px;
    }

    .login-card__footnote {
        font-size: 13px;
        padding-top: 44px;
    }
}
