/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6fb;
    min-height: 100vh;
    position: relative;
    color: #2c3e50;
    line-height: 1.6;
}
.page-bg {
    position: fixed;
    z-index: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(120deg, #e0e7ff 0%, #f4f6fb 60%, #ede9fe 100%);
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px 35px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* Стили для новой SVG-иконки приложения */
.app-logo-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-right: 8px;
    background: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(59,130,246,0.10);
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #ff9800 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 18px #ff980033;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #ff9800 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 28px #ff980044;
}

.btn-secondary {
    background: linear-gradient(90deg, #ffe0b2 0%, #f4f6fb 100%);
    color: #3b3b3b;
    border: 1px solid #ff9800;
    font-weight: 500;
    box-shadow: 0 2px 8px #ff980011;
}

.btn-secondary:hover {
    background: linear-gradient(90deg, #fff3e0 0%, #e0e7ff 100%);
    color: #ff9800;
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 16px #ff980022;
}

/* Основной контент */
.main-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Тумблер */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(100, 116, 139, 0.10);
    transition: background 0.35s cubic-bezier(.4,0,.2,1), box-shadow 0.35s cubic-bezier(.4,0,.2,1);
    border-radius: 34px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* Новый оттенок для тумблера автозаполнения при обновлении лида */
.autoFillUpdate-slider {
    background: rgba(167, 139, 250, 0.13);
}
input:checked + .autoFillUpdate-slider {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 30px;
    width: 30px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #fff 60%, #ffe0b2 100%);
    transition: 0.35s cubic-bezier(.4,0,.2,1);
    border-radius: 50%;
    box-shadow: 0 2px 8px #ff980022;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%);
    box-shadow: 0 0 0 8px #a78bfa22, 0 2px 12px #a78bfa33;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px) scale(1.12);
    background: linear-gradient(135deg, #ffe0b2 0%, #c7d2fe 100%);
    box-shadow: 0 4px 16px #ff980033;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    width: 100%; /* Добавлено для выравнивания */
    flex-grow: 1; /* Добавлено для выравнивания */
}

.toggle-label:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.toggle-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.toggle-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.toggle-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex; /* Добавлено для выравнивания */
    gap: 20px; /* Добавлено для выравнивания */
}

.toggle-container h3 {
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.toggle-actions {
    text-align: center;
    margin-top: 20px;
}

.toggle-actions .btn {
    font-size: 14px;
    padding: 10px 20px;
}

.toggle-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-actions .btn i {
    margin-right: 8px;
}

/* Информационная секция */
.info-section {
    margin-top: 40px;
}

.info-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 30px;
    text-align: center;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.info-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.info-icon i {
    font-size: 24px;
    color: white;
}

/* Стили для info-step (цифры в кружках вместо иконок) */
.info-step {
    font-size: 24px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.10);
    letter-spacing: 1px;
}

.info-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
}

.info-card p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* Стили для модальных окон */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 41, 59, 0.18);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.modal-window {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
    padding: 32px 28px 24px 28px;
    min-width: 320px;
    max-width: 95vw;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(59, 130, 246, 0.08);
    animation: fadeIn 0.4s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 32px #3b82f622, 0 2px 12px #3b82f622;
}
.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
}
.modal-actions {
    display: flex;
    gap: 16px;
    margin-top: 18px;
    justify-content: center;
}

/* Оверлей загрузки для переключателя автозаполнения */
.toggle-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(.4,0,.2,1);
    transform: scale(0.8);
}
.toggle-loading-spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #ff9800;
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    box-shadow: 0 2px 8px #ff980033;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Уведомления */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.notification {
    background: #3b82f6;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.info {
    background: #3b82f6;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .toggle-container {
        padding: 20px;
    }
    
    .toggle-label {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .info-card {
        padding: 25px;
    }
    
    #notificationContainer {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 22px;
    }
    
    .main-content {
        padding: 25px;
    }
    
    .toggle-title {
        font-size: 16px;
    }
    
    .toggle-description {
        font-size: 13px;
    }
    
    .info-icon {
        width: 50px;
        height: 50px;
    }
    
    .info-icon i {
        font-size: 20px;
    }
    .modal-window {
        padding: 18px 8px 12px 8px;
        min-width: 0;
    }
    .modal-title {
        font-size: 17px;
    }
}

.toggle-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}
.main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 36px;
    flex-wrap: wrap;
    animation: fadeIn 0.7s cubic-bezier(.4,0,.2,1);
}
.main-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
    text-align: center;
    letter-spacing: -1px;
    text-shadow: 0 2px 12px #e0e7ff;
}
#refreshStatusBtn {
    height: 48px;
    font-size: 1.08rem;
    padding: 0 32px;
    border-radius: 14px;
    margin: 0;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(59,130,246,0.18);
    transition: background 0.38s, box-shadow 0.38s, color 0.38s, transform 0.38s;
    font-weight: 600;
}
#refreshStatusBtn:hover {
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(59,130,246,0.23);
    transform: translateY(-2px) scale(1.05);
}
#refreshStatusBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
#refreshStatusBtn .fa-sync-alt.fa-spin {
    animation: spin 0.8s cubic-bezier(.4,0,.2,1) infinite;
    animation-fill-mode: forwards;
    transition: transform 0.5s cubic-bezier(.4,0,.2,1);
}
#refreshStatusBtn .fa-sync-alt.fa-spin-stop {
    animation: spin-stop 0.7s cubic-bezier(.4,0,.2,1) 1;
    animation-fill-mode: forwards;
}
@keyframes spin-stop {
    0% { transform: rotate(0deg); }
    80% { transform: rotate(320deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(.4,0,.2,1) 0.1s forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

.toggle-cards-row {
    display: flex;
    gap: 40px;
    margin-bottom: 24px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.toggle-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0;
    min-width: 420px;
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    transition: box-shadow 0.38s cubic-bezier(.4,0,.2,1), background 0.38s cubic-bezier(.4,0,.2,1), transform 0.38s cubic-bezier(.4,0,.2,1);
    margin-bottom: 0;
    opacity: 1;
}
.toggle-card:hover, .toggle-card:focus-within {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
    background: rgba(255, 255, 255, 0.95);
}
.toggle-card-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 44px 44px 38px 44px;
    min-height: 130px;
}
.toggle-card-text {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
}
.toggle-title {
    font-size: 1.32rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px #e3e8ff;
}
.toggle-description {
    font-size: 1.08rem;
    color: #64748b;
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: 0.1px;
}
.toggle-loading-anim .toggle-slider,
.toggle-loading-anim .autoFillUpdate-slider {
    filter: blur(2px) brightness(0.8);
    opacity: 0.5;
    transition: filter 0.32s, opacity 0.32s;
}
.toggle-loading-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(.4,0,.2,1);
}
.toggle-loading-anim .toggle-loading-overlay {
    opacity: 1 !important;
    pointer-events: auto;
}
.toggle-slider, .autoFillUpdate-slider {
    background: linear-gradient(135deg, #e0e7ff 0%, #f4f6fb 100%) !important;
    border: 1.5px solid rgba(59,130,246,0.18) !important;
    box-shadow: 0 2px 8px rgba(59,130,246,0.10), 0 0 0 2px #e0e7ff inset !important;
    transition: background 0.32s cubic-bezier(.4,0,.2,1), box-shadow 0.32s cubic-bezier(.4,0,.2,1), opacity 0.22s cubic-bezier(.4,0,.2,1), border 0.32s cubic-bezier(.4,0,.2,1);
}
input:checked + .toggle-slider,
input:checked + .autoFillUpdate-slider {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    border: 1.5px solid #3b82f6 !important;
    box-shadow: 0 2px 16px 0 #3b82f633, 0 0 0 2px #3b82f6 inset !important;
}
.toggle-switch:hover input:checked + .toggle-slider,
.toggle-switch:hover input:checked + .autoFillUpdate-slider {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    box-shadow: 0 0 0 10px #3b82f644, 0 2px 16px 0 #3b82f633, 0 0 16px #1d4ed8cc, 0 0 0 2px #3b82f6 inset !important;
    transform: scale(1.04);
    transition: box-shadow 0.32s, background 0.32s, transform 0.32s;
}
.toggle-slider:before {
    background: linear-gradient(135deg, #fff 60%, #e0e7ff 100%) !important;
    box-shadow: 0 2px 8px #3b82f622 !important;
}
input:checked + .toggle-slider:before {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
    box-shadow: 0 4px 16px #3b82f633 !important;
}
.toggle-switch {
    margin-left: 32px;
    margin-right: 0;
    flex-shrink: 0;
    position: relative;
    width: 68px;
    height: 38px;
    display: inline-block;
    transition: box-shadow 0.3s;
}
.toggle-switch:hover .toggle-slider,
.toggle-switch:hover .autoFillUpdate-slider {
    box-shadow: 0 0 0 8px #3b82f644, 0 2px 12px #3b82f633, 0 0 16px #1d4ed8cc;
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%) !important;
    transform: scale(1.04);
    transition: box-shadow 0.32s, background 0.32s, transform 0.32s;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 30px;
    width: 30px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #fff 60%, #ffe0b2 100%);
    transition: 0.35s cubic-bezier(.4,0,.2,1);
    border-radius: 50%;
    box-shadow: 0 2px 8px #ff980022;
}
input:checked + .toggle-slider {
    background: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%);
    box-shadow: 0 0 0 8px #a78bfa22, 0 2px 12px #a78bfa33;
}
input:checked + .toggle-slider:before {
    transform: translateX(30px) scale(1.12);
    background: linear-gradient(135deg, #ffe0b2 0%, #c7d2fe 100%);
    box-shadow: 0 4px 16px #ff980033;
}
.toggle-loader {
    position: absolute;
    right: -38px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    width: 28px;
    height: 28px;
    display: none;
    pointer-events: none;
}
.toggle-switch[data-loading="true"] .toggle-loader {
    display: inline-block;
    animation: fadeIn 0.3s;
}
.toggle-loader:after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border: 3px solid #a78bfa;
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-card-main {
    margin: 0 auto 36px auto;
    padding: 36px 36px 24px 36px;
    min-width: 420px;
    max-width: 100%;
    width: 100%;
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.07);
    border-radius: 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    opacity: 1;
}

.modal-window.fade-modal {
    animation: fadeIn 0.4s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 32px #a78bfa33, 0 2px 12px #a78bfa22;
    border-radius: 18px;
    background: #fff;
}
.modal-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 18px #3b82f633;
}
.modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 8px 28px #3b82f644;
}
.modal-actions .btn-secondary {
    background: #f8fafc;
    color: #1d4ed8;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 2px 8px #3b82f611;
}
.modal-actions .btn-secondary:hover {
    background: #e0e7ff;
    color: #1d4ed8;
    box-shadow: 0 4px 16px #3b82f622;
}

@media (max-width: 1100px) {
    .toggle-cards-row, .info-cards {
        flex-direction: column;
        gap: 28px;
        align-items: center;
    }
    .toggle-card, .info-card-main {
        min-width: 0;
        max-width: 100%;
    }
}
@media (max-width: 600px) {
    .main-header {
        flex-direction: column;
        gap: 16px;
    }
    .toggle-card-content {
        flex-direction: column;
        align-items: stretch;
        padding: 28px 12px 24px 12px;
        min-height: 0;
    }
    .toggle-switch {
        margin: 24px 0 0 0;
        align-self: flex-end;
    }
    .info-card-main {
        padding: 18px 6px 12px 6px;
    }
}
