/* Общие стили для гостевых страниц */

@media (min-width: 992px) {
    .login-container-wide {
        max-width: 900px;
        margin: 0 auto;
    }

    .login-box-horizontal {
        display: flex;
        align-items: center;
        min-height: 450px;
    }

    .login-left-section {
        flex: 0 0 45%;
        padding: 0rem 3rem 0rem 2rem;
    }

    .login-right-section {
        flex: 1;
        padding: 2rem 2rem 2rem 3rem;
    }

    .logo-section {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .logo-section img {
        width: 64px;
        height: 64px;
    }

    .logo-section h1 {
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
        line-height: 1.2;
    }

    .description-text {
        color: #666666;
        margin-bottom: 2rem;
        line-height: 1.6;
    }

    body.dark-mode .description-text,
    [data-bs-theme="dark"] .description-text {
        color: rgba(255, 255, 255, 0.8);
    }

    @media (prefers-color-scheme: dark) {
        .description-text {
            color: rgba(255, 255, 255, 0.8);
        }
    }
}

@media (max-width: 991px) {
    .login-container-wide {
        max-width: 100%;
    }

    .login-box-horizontal {
        display: block;
    }

    .login-left-section {
        display: none;
    }

    .login-right-section {
        padding: 1.2rem;
    }

    .mobile-logo {
        text-align: center;
        margin-bottom: 2rem;
    }

    .mobile-logo img {
        width: 60px;
        margin-bottom: 1rem;
    }

    .mobile-logo h2 {
        font-size: 1.3rem;
        font-weight: 600;
    }

    /* Убираем отступы и делаем карточку на всю ширину */
    .min-vh-100 {
        padding: 0 !important;
        background: #ffffff;
    }

    .login-box-container {
        border: none;
        border-radius: 0;
        margin-bottom: 0;
        box-shadow: none;
        background: #ffffff;
    }

    /* Убираем отступы footer на мобильных */
    .footer-buttons {
        padding: 1rem;
        background: #ffffff;
    }

    /* Тёмная тема для мобильных */
    body.dark-mode .min-vh-100,
    [data-bs-theme="dark"] .min-vh-100 {
        background: #1a1a1a;
    }

    body.dark-mode .login-box-container,
    [data-bs-theme="dark"] .login-box-container {
        background: #1a1a1a;
    }

    body.dark-mode .footer-buttons,
    [data-bs-theme="dark"] .footer-buttons {
        background: #1a1a1a;
    }

    /* Автоматическая тёмная тема */
    @media (prefers-color-scheme: dark) {
        .min-vh-100 {
            background: #1a1a1a;
        }

        .login-box-container {
            background: #1a1a1a;
        }

        .footer-buttons {
            background: #1a1a1a;
        }
    }
}

.form-control {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-login {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    opacity: 1;
}

.download-app-link {
    display: inline-block;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: opacity 0.2s;
}

.download-app-link:hover {
    color: inherit;
    text-decoration: none;
    opacity: 0.7;
}

.create-account-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.title-text {
    font-size: 26px;
    margin-bottom: 0px;
}

.login-box-container {
    margin-bottom: 10px;
}

/* Стили для кнопок ролей */
.role-buttons {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.5rem;
}

.role-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.3rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    text-decoration: none;
    color: var(--bs-body-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.role-btn:last-child {
    border-bottom: none;
}

/* Светлая тема */
.role-btn {
    color: #333333;
    border-bottom-color: #e0e0e0;
}

.role-btn:hover {
    background: rgba(0, 0, 0, 0.02);
    transform: none;
    text-decoration: none;
    color: #333333;
    box-shadow: none;
}

.role-btn .role-desc {
    color: #666666;
}

/* Тёмная тема */
body.dark-mode .role-btn,
[data-bs-theme="dark"] .role-btn {
    background: transparent;
    border-bottom-color: #333333;
    color: #c8d1d9;
}

body.dark-mode .role-btn:hover,
[data-bs-theme="dark"] .role-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #c8d1d9;
    box-shadow: none;
}

body.dark-mode .role-btn .role-desc,
[data-bs-theme="dark"] .role-btn .role-desc {
    color: #8b949e;
}

/* Автоматическая тёмная тема через prefers-color-scheme */
@media (prefers-color-scheme: dark) {
    .role-btn {
        background: transparent;
        border-bottom-color: #333333;
        color: #c8d1d9;
    }

    .role-btn:hover {
        background: rgba(255, 255, 255, 0.05);
        color: #c8d1d9;
        box-shadow: none;
    }

    .role-btn .role-desc {
        color: #8b949e;
    }
}

.role-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.role-btn .role-icon {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bs-light);
}

body.dark-mode .role-btn .role-icon,
[data-bs-theme="dark"] .role-btn .role-icon {
    background: none;
}

@media (prefers-color-scheme: dark) {
    .role-btn .role-icon {
        background: none;
    }
}

.role-btn .role-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.role-btn .role-text {
    flex: 1;
}

.role-btn .role-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    color: inherit;
}

.role-btn .role-desc {
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.3;
}

.role-registration-link {
    color: var(--bs-primary);
    text-decoration: none;
    font-size: 0.80rem;
    margin-top: 0.25rem;
    display: inline-block;
    transition: opacity 0.2s;
}

.role-registration-link:hover {
    text-decoration: underline;
    color: var(--bs-primary);
    opacity: 0.8;
}

.role-btn .spinner {
    position: absolute;
    right: 1rem;
    display: none;
}

.role-btn.loading .spinner {
    display: block;
}

/* Нижние кнопки */
.footer-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
}

@media (max-width: 991px) {
    .footer-buttons {
        justify-content: center;
    }
}

.footer-btn {
    background: transparent;
    border: none;
    color: inherit;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: opacity 0.2s;
    font-size: 0.9rem;
}

.footer-btn:hover {
    opacity: 0.7;
    color: inherit;
    text-decoration: none;
}

.language-selector select {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.9rem;
}

.language-selector select:focus {
    outline: none;
}