﻿html {
    font-size: 14px;
    height: 100%;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}


@media (max-height: 800px) {
    .login-wrapper {
        min-height: auto;
        max-height: calc(100vh - 150px);
        padding: 20px;
        align-items: flex-start;
    }

    .login-card {
        margin: 10px auto;
    }
}


@media (max-width: 992px) {
    .login-card-wide {
        max-width: 600px;
    }

    .login-columns.two-columns {
        flex-direction: column;
        gap: 20px;
    }

    .login-password-section {
        padding-left: 0;
        border-left: none;
        border-top: 2px solid #e0e0e0;
        padding-top: 20px;
    }
}

@media (max-width: 576px) {
    .login-wrapper {
        margin: 0;
        padding: 20px 10px;
        border-radius: 0;
        max-height: calc(100vh - 100px);
    }

    .login-card {
        border-radius: 12px;
    }

    .login-header {
        padding: 30px 20px;
        border-radius: 12px 12px 0 0;
    }

        .login-header h1 {
            font-size: 1.5rem;
        }

    .login-body {
        padding: 30px 20px;
    }
}

@media (max-height: 600px) {
    .login-wrapper {
        max-height: calc(100vh - 80px);
        padding: 10px 20px;
    }

    .login-header {
        padding: 20px;
    }

        .login-header h1 {
            font-size: 1.5rem;
        }

    .login-body {
        padding: 20px;
    }

    .form-floating {
        margin-bottom: 1rem;
    }
}

@media (max-height: 800px) {
    .login-wrapper {
        min-height: auto;
        max-height: calc(100vh - 150px);
        padding: 20px;
        align-items: flex-start;
    }

    .login-card {
        margin: 10px auto;
    }
}


@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
}

header {
    flex-shrink: 0;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

    .main-container > main {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

.first-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    /*    align-items: center;*/
    padding: 0px 20px 0px 0px;
    /*    gap: 20px;*/
}

footer {
    flex-shrink: 0;
    padding: 0.5rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
}

.extAppList {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 450px));
    gap: 15px;
    padding: 30px;
    justify-content: center;
    align-content: center;
}

    .extAppList > div {
        transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
        padding: 15px 30px;
        border-radius: 18px;
        cursor: pointer;
        width: 450px;
        height: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .extAppList > div:hover {
            transform: translateY(-12px) scale(1.05);
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
        }

        .extAppList > div:active {
            transform: translateY(-3px) scale(0.98);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
            opacity: 0.9;
        }

    .extAppList a {
        text-decoration: none;
        color: inherit;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

.extApp_logo {
    max-height: 120px;
    max-width: 100%;
    object-fit: contain;
    transition: filter 0.2s ease;
}

.extAppList > div:hover .extApp_logo {
    filter: brightness(1.1);
}

.extAppList > div:active .extApp_logo {
    filter: brightness(0.95);
}

.extAppList h2 {
    margin: 0;
    transition: color 0.2s ease;
    font-size: 1.8rem;
}

.extAppList > div:hover h2 {
    color: #258cfb;
}

/* Адаптивна сітка для різних розмірів екранів */
@media (max-width: 1200px) {
    .extAppList {
        grid-template-columns: repeat(auto-fit, minmax(375px, 375px));
        gap: 12px;
    }

        .extAppList > div {
            width: 375px;
            height: 125px;
            padding: 12px 22px;
        }

    .extApp_logo {
        max-height: 98px;
    }

    .extAppList h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 991px) {
    .extAppList {
        grid-template-columns: repeat(auto-fit, minmax(375px, 375px));
        padding: 15px;
        gap: 12px;
        align-content: baseline; /* ✅ ЗМІНЕНО: для однієї колонки */
    }
}

    @media (max-width: 576px) {
        .extAppList {
            grid-template-columns: 1fr;
            gap: 12px;
            align-content: baseline; /* ✅ ЗМІНЕНО: для однієї колонки */
        }

            .extAppList > div {
                width: 100%;
                max-width: 450px;
                height: 150px;
                margin: 0 auto;
            }
    }

    .login-wrapper {
        min-height: calc(100vh - 150px);
        max-height: calc(100vh - 200px);
        display: flex;
        align-items: center;
        justify-content: center;
        background-image: url('/img/MqLoginBackground.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        position: relative;
        padding: 40px 20px;
        /* margin: 0 -12px; */
        overflow-y: auto;
        overflow-x: hidden;
    }

    /*             .login-wrapper::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                /* background: linear-gradient(135deg, rgba(114, 55, 149, 0.7) 0%, rgba(61, 45, 130, 0.7) 50%, rgba(228, 54, 18, 0.7) 50%, rgba(243, 146, 0, 0.7) 100%); 
                background: rgba(255, 255, 255, 0.7);
                z-index: 1;
            } */

    .login-card {
        background: white;
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        overflow: visible;
        max-width: 450px;
        width: 100%;
        animation: slideIn 0.5s ease;
        transition: max-width 0.3s ease;
        margin: 20px auto;
        flex-shrink: 0;
        position: relative;
        z-index: 2;
    }

    .login-card-wide {
        max-width: 900px;
    }

    .login-header {
        background: linear-gradient(135deg, rgba(114, 55, 149, 0.17) 0%, rgba(61, 45, 130, 0.34) 100%);
        padding: 20px 30px;
        text-align: center;
        color: white;
        border-radius: 20px 20px 0 0;
    }

        .login-header h1 {
            margin: 0;
            font-size: 2rem;
            font-weight: 600;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
        }

    .login-body {
        padding: 30px 30px;
    }

    .login-columns {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

        .login-columns.two-columns {
            flex-direction: row;
            gap: 30px;
            align-items: flex-start;
        }

    .login-main-section {
        flex: 1;
        min-width: 0;
    }

    .login-password-section {
        flex: 1;
        min-width: 0;
        padding-left: 30px;
        border-left: 2px solid #e0e0e0;
        animation: slideInRight 0.5s ease;
    }



    .form-floating {
        position: relative;
        margin-bottom: 1.5rem;
    }

        .form-floating input {
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            padding: 1rem 0.75rem;
            font-size: 1rem;
            transition: all 0.3s ease;
            width: 100%;
        }

            .form-floating input:focus {
                border-color: #723795;
                box-shadow: 0 0 0 0.2rem rgba(114, 55, 149, 0.25);
                outline: none;
            }

        .form-floating label {
            padding: 1rem 0.75rem;
            color: #666;
        }

    .btn-login {
        background: linear-gradient(135deg, #e43612 0%, #f39200 100%);
        border: none;
        border-radius: 12px;
        padding: 14px;
        font-size: 1.1rem;
        font-weight: 600;
        color: white;
        width: 100%;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(228, 54, 18, 0.3);
        margin-top: 10px;
    }

        .btn-login:hover {
            background: linear-gradient(135deg, #d63010 0%, #e08800 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(228, 54, 18, 0.4);
        }

        .btn-login:active {
            transform: translateY(0);
            box-shadow: 0 2px 10px rgba(228, 54, 18, 0.3);
        }

    .password-warning {
        background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
        border-left: 4px solid #e43612;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
    }

        .password-warning p {
            margin: 0 0 10px 0;
            font-size: 0.9rem;
        }

            .password-warning p:first-child {
                font-weight: 600;
            }

            .password-warning p:last-child {
                margin-bottom: 0;
                color: #666;
                font-size: 0.85rem;
            }

    .text-danger {
        color: #e43612 !important;
    }

    .validation-summary-errors {
        background: #fff5f5;
        border: 1px solid #e43612;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 20px;
    }

        .validation-summary-errors ul {
            margin: 0;
            padding-left: 20px;
        }


    .login-wrapper::-webkit-scrollbar {
        width: 8px;
    }

    .login-wrapper::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }

    .login-wrapper::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }

        .login-wrapper::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.5);
        }


.btn-passkey-login-delete {
    flex: 1 1 0;
    border-radius: 6px;
    padding: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}
.btn-passkey-login-auto {
    flex: 1 1 0;
    background: linear-gradient(135deg, #e43612 0%, #f39200 100%);
    border: none;
    border-radius: 6px;
    padding: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(228, 54, 18, 0.3);
}
    .btn-passkey-login-auto:hover {
        box-shadow: rgba(228, 54, 18, 0.4) 0px 6px 20px;
        color: white;
        background: linear-gradient(135deg, #f39200 0%, #e43612 100%);
    }

/* Autofill detection тригеру при автозаповненні логіна */
@keyframes onAutofill {
    from {
    }

    to {
    }
}
input:-webkit-autofill {
    animation-name: onAutofill;
    animation-duration: 1ms;
}
/* Autofill detection */