/* style.css — Стили для страницы входа в IoT-систему */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0a0e1a;
    color: #e0e0e0;
    position: relative;
    overflow: hidden;
}

/* Фоновое изображение с затемнением */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.25) saturate(0.9) hue-rotate(180deg);
    z-index: -1;
}

.bg-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(10, 14, 26, 0.4) 0%, rgba(10, 14, 26, 0.9) 100%);
}

/* Контейнер входа */
.login-container {
    background: rgba(18, 24, 38, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 180, 255, 0.25);
    border-radius: 16px;
    padding: 40px 35px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 180, 255, 0.08);
    position: relative;
    z-index: 1;
    animation: fadeIn 0.6s ease-out;
    /* Защита от переполнения */
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Логотип */
.logo {
    text-align: center;
    margin-bottom: 10px;
}

.logo img {
    max-width: 100px;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(0, 180, 255, 0.5));
}

/* Заголовок */
h1 {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #00b4ff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(0, 180, 255, 0.4);
}

/* Показ устройств */
.devices-showcase {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 10px 0;
    flex-wrap: wrap; /* Чтобы на узких экранах они переносились */
}

/* Жесткое ограничение размеров иконок */
.devices-showcase img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain; /* Сохраняет пропорции */
    opacity: 0.8;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(0, 180, 255, 0.3));
    display: block;
}

.devices-showcase img:hover {
    opacity: 1;
    transform: translateY(-4px) scale(1.1);
    filter: drop-shadow(0 0 12px rgba(0, 180, 255, 0.6));
}

/* Форма */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #7a8fa6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(0, 180, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #00b4ff;
    box-shadow: 0 0 15px rgba(0, 180, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

.input-group input::placeholder {
    color: #4a5a6a;
    font-style: italic;
}

/* Кнопка входа */
.btn-login {
    margin-top: 5px;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #00b4ff 0%, #0077cc 100%);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 180, 255, 0.35);
}

.btn-login:hover {
    background: linear-gradient(135deg, #33c4ff 0%, #0099ff 100%);
    box-shadow: 0 6px 30px rgba(0, 180, 255, 0.55);
    transform: translateY(-2px);
}

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

/* Информационный блок */
.info-block {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 180, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-text {
    font-size: 0.9rem;
    color: #9aabbf;
    line-height: 1.5;
    text-align: center;
}

.info-text strong {
    color: #00b4ff;
}

.warning-text {
    font-size: 0.85rem;
    color: #ff6b6b;
    line-height: 1.5;
    text-align: center;
    background: rgba(255, 107, 107, 0.08);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.warning-text strong {
    color: #ff4444;
}

/* Блок ошибки (auth.php) */
.error-block {
    background: rgba(255, 68, 68, 0.12);
    border: 1px solid rgba(255, 68, 68, 0.4);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    color: #ff6b6b;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 20px 0;
}

/* Кнопка "Назад" (auth.php) */
.btn-back {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 28px;
    border-radius: 8px;
    background: rgba(0, 180, 255, 0.12);
    border: 1px solid rgba(0, 180, 255, 0.4);
    color: #00b4ff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.btn-back:hover {
    background: rgba(0, 180, 255, 0.25);
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.3);
    transform: translateY(-2px);
}

/* Адаптивность */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
        margin: 15px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .logo img {
        max-width: 80px;
    }

    .devices-showcase img {
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }

    .info-text {
        font-size: 0.82rem;
    }

    .warning-text {
        font-size: 0.78rem;
    }
}