/* css/splash.css */

/* ========== Сплэш-скрин ========== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#splash-screen.hide {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

/* Фоновое изображение */
.splash-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../icons/splash-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.splash-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

/* ========== Модальное окно авторизации ========== */
.login-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.login-modal.hide {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.login-modal-content {
    background: var(--color-white);
    border-radius: 20px;
    padding: 28px 24px 24px;
    width: calc(100% - 48px);
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-modal-car {
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto;
    animation: car-bounce-subtle 1.5s ease-in-out infinite alternate;
}

.login-modal-car svg {
    width: 100%;
    height: auto;
    display: block;
}

@keyframes car-bounce-subtle {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-input-white {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: var(--font-size-md);
    background: var(--color-bg);
    color: var(--color-dark-gray);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input-white:focus {
    border-color: var(--color-dynamic-red);
    box-shadow: 0 0 0 3px var(--color-dynamic-red-25);
    outline: none;
}

.login-input-white::placeholder {
    color: var(--color-medium-gray);
}

.login-error-red {
    min-height: 18px;
    font-size: var(--font-size-sm);
    color: var(--color-dynamic-red);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-error-red.show {
    opacity: 1;
}

.login-btn-red {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--color-dynamic-red);
    color: var(--color-white);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.login-btn-red:hover {
    background: #c0040e;
}

.login-btn-red:active {
    transform: scale(0.98);
}

.login-btn-red:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.login-modal-content.shake {
    animation: shake 0.5s ease;
}

/* ========== Контент сплэш-скрина (после логина) ========== */
.splash-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
    z-index: 5;
    padding: 40px 24px 0 0;
}

/* Машинка 45% ширины экрана */
.splash-car {
    width: 45vw;
    max-width: 320px;
    height: auto;
    animation: car-bounce 0.7s ease-in-out infinite alternate;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.splash-car svg {
    width: 100%;
    height: auto;
}

/* Полоска загрузки — та же ширина что и машинка */
.splash-loader {
    width: 45vw;
    max-width: 320px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

/* Бегущая полоска — эффект движения */
.splash-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 35%;
    height: 100%;
    background: var(--color-white);
    border-radius: 2px;
    animation: loader-drive 0.8s ease-in-out infinite;
}

/* ========== Анимации ========== */
@keyframes car-bounce {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

@keyframes loader-drive {
    0%   { left: -35%; }
    100% { left: 100%; }
}

/* ========== Адаптив ========== */
@media (max-width: 400px) {
    .login-modal-content {
        padding: 24px 20px 20px;
    }
    
    .splash-content {
        padding: 30px 16px 0 0;
    }
}
