@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* Общие стили с улучшенной адаптивностью */
body {
    font-family: 'Montserrat', Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Используем min-height вместо height */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1 {
    margin-bottom: 20px;
    font-weight: 600;
}

.auth-container {
    background-color: #fff;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 3.25em;
    width: 100%;
    max-width: 450px; /* Добавляем max-width для лучшей адаптивности */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    align-items: center;
    margin: 20px auto; /* Центрирование блока */
    box-sizing: border-box;
}

.input-container {
    width: 300px;
    position: relative;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Стиль для иконки ошибки */
.error-icon {
    display: none;
    margin-right: 6px;
    line-height: 0;
    vertical-align: middle;
}

/* Показываем иконку, когда инпут имеет класс input-error */
.input-error ~ .error-message .error-icon {
    display: inline-block;
}

.input-error {
    border: 2px solid #ff3b30 !important;
    box-shadow: 0 0 5px rgba(255, 59, 48, 0.3);
}

.error-message {
    color: #ff3b30;
    font-size: 14px;
    margin-top: 2px;
    text-align: left;
    min-height: 16px;
    width: 100%;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

input[type="email"] {
    padding: 10px 15px; /* Упрощаем паддинг, так как иконка теперь не внутри инпута */
    width: 100%;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 18px;
    font-size: 16px;
    font-family: 'Montserrat', Arial, sans-serif;
    margin-bottom: 0;
}

button {
    padding: 24px;
    height: 40px;
    font-size: 16px;
    color: white;
    background-color: #007BFF;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    /* box-shadow: 0 4px 6px rgba(0, 123, 255, 0.25); */
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: #0062cc;
    box-shadow: 0 6px 12px rgba(0, 98, 204, 0.3);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 98, 204, 0.2);
}

#dashboard_buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.button-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
}

.button-icon {
    margin-right: 4px;
}

#dashboard_buttons button {
    width: 100%;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-logo img {
    height: 40px;
    width: auto;
    filter: brightness(0); /* Делает SVG черным */
}

.footer-disclaimer {
    font-size: 12px;
    color: #666;
    max-width: 70%;
    line-height: 1.4;
}

/* Для адаптивного дизайна на мобильных устройствах */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-bottom: 100px; 
        justify-content: flex-start; 
    }
    
    h1 {
        font-size: 24px; 
        margin-bottom: 15px;
    }
    
    .auth-container {
        width: 100%;
        max-width: 100%;
        padding: 2.5em 1.5em;
        margin: 15px auto 0; 
        box-sizing: border-box;
        gap: 20px; 
    }
    
    input[type="email"] {
        width: 100%;
        height: 50px; 
        padding: 12px 20px; 
        box-sizing: border-box;
        font-size: 16px;
    }
    
    .input-container {
        width: 100%;
        margin-bottom: 5px;
    }
    
    button {
        width: 100%;
        height: 50px; 
        padding: 0 24px; 
        font-size: 16px; 
    }
    
    #dashboard_buttons {
        width: 100%;
        gap: 16px; 
    }
    
    #dashboard_buttons button {
        width: 100%;
        height: 50px; 
        padding: 0 20px;
        justify-content: center; 
    }
    
    .button-with-icon {
        gap: 10px; 
    }
    
    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .footer-disclaimer {
        max-width: 100%;
        text-align: left;
    }
    
    /* Стили для кастомного алерта на мобильных */
    .custom-alert {
        width: 90%;
        margin: 0 10px;
    }
}

/* Стили для кастомного алерта */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-alert {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.custom-alert-overlay.active .custom-alert {
    transform: translateY(0);
}

.custom-alert-content {
    padding: 20px;
    display: flex;
    align-items: center;
}

.custom-alert-icon {
    margin-right: 15px;
    flex-shrink: 0;
    position: relative;
}

.custom-alert-icon svg {
    display: none; 
}

.custom-alert-success .success-icon {
    display: block;
}

.custom-alert-error .error-icon {
    display: block; 
}

.custom-alert-message {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.custom-alert-close {
    border-top: 1px solid #eee;
    padding: 12px;
    font-weight: 600;
    color: #007BFF;
    background: none;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 0;
    height: auto;
}

.custom-alert-close:hover {
    background-color: #f8f8f8;
    transform: none;
    box-shadow: none;
}

.custom-alert-error .custom-alert-icon svg {
    stroke: #ff3b30;
}

.custom-alert-success .custom-alert-icon svg {
    stroke: #28a745;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-bottom: 100px;
        justify-content: flex-start; 
    }
    
    h1 {
        font-size: 24px; 
        margin-bottom: 15px;
    }
    
    .auth-container {
        width: 100%;
        max-width: 100%;
        padding: 2.5em 1.5em;
        margin: 15px auto 0; 
        box-sizing: border-box;
        gap: 20px;
    }
    
    input[type="email"] {
        width: 100%;
        height: 50px;
        padding: 12px 20px;
        box-sizing: border-box;
        font-size: 16px; 
    }
    
    .input-container {
        width: 100%;
        margin-bottom: 5px; 
    }
    
    button {
        width: 100%;
        height: 50px; 
        padding: 0 24px; 
        font-size: 16px; 
    }
    
    #dashboard_buttons {
        width: 100%;
        gap: 16px; 
    }
    
    #dashboard_buttons button {
        width: 100%;
        height: 50px; 
        padding: 0 20px; 
        justify-content: center;
    }
    
    .button-with-icon {
        gap: 10px; 
    }
    
    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .footer-disclaimer {
        max-width: 100%;
        text-align: left;
    }

    .custom-alert {
        width: 90%;
        margin: 0 10px;
    }
}
