:root { --bg: #121212; --card: #1e1e1e; --text: #e0e0e0; --primary: #FF7C45; --input-bg: #2d2d2d; --border: #444; }
[data-theme="light"] { --bg: #f8f9fa; --card: #ffffff; --text: #212529; --primary: #FF7C45; --input-bg: #f8f9fa; --border: #dee2e6; }

html, body {
    height: 100%; 
    margin: 0;
}

* { box-sizing: border-box; }

body { 
    min-height: 100%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    background: var(--bg); 
    color: var(--text); 
    font-family: 'Segoe UI', sans-serif; 
    transition: all 0.3s; 
    position: relative; 
}

/* === НОВЫЙ ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ === */
.theme-switch-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: block;
    width: 60px;
    height: 30px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.theme-switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--border);
    transition: .4s;
    border-radius: 34px;
    backdrop-filter: blur(5px);
}

.theme-slider .icon-wrapper {
    position: absolute;
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: var(--card);
    transition: .4s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    overflow: hidden;
}

.icon-sun, .icon-moon {
    position: absolute;
    font-size: 14px;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    line-height: 1;
}

.icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
.icon-moon { opacity: 0; transform: rotate(-180deg) scale(0); }

/* Активное состояние (Темная тема) */
.theme-switch-container input:checked + .theme-slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

.theme-switch-container input:checked + .theme-slider .icon-wrapper {
    transform: translateX(30px);
    background-color: #fff;
    color: #000;
}

.theme-switch-container input:checked + .theme-slider .icon-sun {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

.theme-switch-container input:checked + .theme-slider .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.logo { 
    width: 150px; 
    height: 150px; 
    max-width: 100%;
    margin-bottom: 30px; 
}

.card { background: var(--card); padding: 40px; border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.4); max-width: 380px; width: 90%; text-align: center; border: 1px solid var(--border); }

h1 { margin: 0 0 30px; font-size: 32px; font-weight: 600; }

input { width: 100%; padding: 15px; margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--input-bg); color: var(--text); font-size: 16px; }
input:focus { outline: none; border-color: var(--primary); }

button { width: 100%; padding: 15px; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 17px; cursor: pointer; margin-top: 15px; font-weight: 600; }
button:hover { background: #FF7C45; }

.error { color: #ff6b6b; margin-top: 15px; font-size: 14px; }

label { display: flex; align-items: center; justify-content: center; margin: 15px 0; font-size: 14px; cursor: pointer; }
label input { width: auto; margin-right: 8px; }
/* === КРАСИВЫЙ ЧЕКБОКС "ЗАПОМНИТЬ МЕНЯ" === */
.remember-container {
    margin: 20px 0 10px 0;
    display: flex;
    justify-content: center;
}

.remember-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    gap: 12px;
}

.remember-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.remember-slider {
    position: relative;
    width: 46px;
    height: 24px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remember-slider-inner {
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background: var(--text);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    opacity: 0.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.remember-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

/* Когда включено */
.remember-switch input:checked + .remember-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-switch input:checked + .remember-slider .remember-slider-inner {
    transform: translateX(22px);
    background: white;
    opacity: 1;
}

.remember-switch input:checked + .remember-slider::before {
    transform: translate(-50%, -50%) scale(1);
}

/* Ховер эффект */
.remember-switch:hover .remember-slider {
    box-shadow: 0 0 15px rgba(255, 124, 69, 0.3);
}

.remember-text {
    color: var(--text);
    transition: color 0.3s;
    font-weight: 500;
}

.remember-switch input:checked ~ .remember-text {
    color: var(--primary);
    font-weight: 600;
}
@media (max-width: 480px) {
    .remember-switch {
        gap: 8px; /* меньше отступ между ползунком и текстом */
        font-size: 12px; /* чуть меньше текст */
    }

    .remember-slider {
        width: 40px; /* немного меньше ползунок */
        height: 20px;
    }

    .remember-slider-inner {
        width: 16px;
        height: 16px;
        left: 2px;
        bottom: 2px;
    }

    .remember-switch input:checked + .remember-slider .remember-slider-inner {
        transform: translateX(20px);
    }

    .remember-text {
        white-space: nowrap; /* чтобы текст не переносился */
    }
}

/* Убираем стандартный title, если библиотека добавит свой, или стилизуем canvas */
#qrcode canvas, #qrcode img {
    display: block;
    max-width: 100%;
    height: auto;
}
.qr-wrapper {
    background: #ffffff;
    padding: 10px;      /* Внутренний отступ */
    border: 1px solid #e0e0e0; /* Тонкая серая граница */
    outline: 4px solid rgba(228, 92, 1, 0.1); /* Вторая полупрозрачная оранжевая рамка */
    border-radius: 16px;
    display: inline-block;
    line-height: 0;
}
/* Контейнер для позиционирования */
.qr-stack {
    position: relative; /* Важно! */
    width: 250px;      /* Размер должен совпадать с размером QR в JS */
    height: 250px;
    margin: 0 auto;
}

/* Сам QR код */
#qrcode {
    width: 100%;
    height: 100%;
}

/* Логотип поверх кода */
.qr-logo-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Центрирование */
    
    width: 60px;  /* Размер логотипа */
    height: 60px;
    
    /* === КРАСОТА === */
    border-radius: 20%; /* Делает круг */
    border: 4px solid white; /* Белая рамка вокруг лисенка */
    background: black; /* Фон под лисенком (если он прозрачный) */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); /* Тень */
    object-fit: cover;
    z-index: 10; /* Поверх QR кода */
}