﻿/* ===== СТРАНИЦА ВХОДА ===== */
@keyframes loginFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateX(28px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginBgZoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.08);
    }
}

@keyframes tabIndicator {
    from {
        transform: scaleX(0.6);
        opacity: 0.6;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes btnShine {
    0% {
        left: -120%;
    }
    100% {
        left: 120%;
    }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    background-image: url(../image/bg.png);
    background-size: cover;
    background-position: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: -5%;
    background-image: url(../image/bg.png);
    background-size: cover;
    background-position: center;
    animation: loginBgZoom 24s ease-in-out infinite alternate;
    z-index: 0;
}

.login-page::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.75));
    z-index: 0;
}

.login-container {
    display: flex;
    max-width: 1000px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
    animation: loginFadeIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== ЛЕВАЯ ЧАСТЬ (БРЕНД) ===== */
.login-brand {
    flex: 1;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(0, 0, 0, 0.6));
    padding: 50px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    animation: loginFadeUp 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.brand-content {
    color: #fff;
    max-width: 300px;
}

.brand-title {
    display: inline-block;
    font-family: "Audiowide", sans-serif;
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    letter-spacing: 0.06em;
    margin-bottom: 30px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: loginFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.brand-title:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.brand-content h2 {
    font-family: "Montserrat", sans-serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0 0 15px 0;
    animation: loginFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.brand-content p {
    font-family: "Montserrat", sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.65;
    margin: 0 0 30px 0;
    animation: loginFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "Montserrat", sans-serif;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    animation: loginFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-feature:nth-child(1) {
    animation-delay: 0.55s;
}

.brand-feature:nth-child(2) {
    animation-delay: 0.68s;
}

.brand-feature:nth-child(3) {
    animation-delay: 0.81s;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: #e74c3c;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}

.feature-icon svg {
    display: block;
}

.brand-feature:hover .feature-icon {
    transform: scale(1.12);
    color: #ff6b57;
}

/* ===== ПРАВАЯ ЧАСТЬ (ФОРМЫ) ===== */
.login-forms {
    flex: 1;
    padding: 50px 40px;
    background: rgba(0, 0, 0, 0.4);
    min-height: 500px;
    animation: loginSlideIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* Вкладки */
.form-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 4px;
    margin-bottom: 30px;
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.25s ease;
    font-family: "Montserrat", sans-serif;
    position: relative;
    z-index: 1;
}

.tab-btn.active {
    background: rgba(231, 76, 60, 0.8);
    color: #fff;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3);
    animation: tabIndicator 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-btn:hover:not(.active) {
    color: #fff;
    transform: translateY(-1px);
}

/* Формы */
.form {
    display: none;
    opacity: 0;
    transform: translateY(16px);
}

.form.active {
    display: block;
    animation: loginFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.form.form-leaving {
    display: block;
    animation: loginFormLeave 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.form.form-entering {
    animation: loginFormEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes loginFormLeave {
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

@keyframes loginFormEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form.active .form-group,
.form.active h3,
.form.active .form-subtitle,
.form.active .form-options,
.form.active .form-agreement,
.form.active .btn-submit,
.form.active .form-footer {
    animation: loginFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.form.active h3 { animation-delay: 0.05s; }
.form.active .form-subtitle { animation-delay: 0.1s; }
.form.active .form-group:nth-of-type(1) { animation-delay: 0.15s; }
.form.active .form-group:nth-of-type(2) { animation-delay: 0.2s; }
.form.active .form-group:nth-of-type(3) { animation-delay: 0.25s; }
.form.active .form-group:nth-of-type(4) { animation-delay: 0.3s; }
.form.active .form-group:nth-of-type(5) { animation-delay: 0.35s; }
.form.active .form-group:nth-of-type(6) { animation-delay: 0.4s; }
.form.active .form-options,
.form.active .form-agreement { animation-delay: 0.38s; }
.form.active .btn-submit { animation-delay: 0.45s; }
.form.active .form-footer { animation-delay: 0.5s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form h3 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.form-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin: 0 0 25px 0;
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-family: "Montserrat", sans-serif;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #e74c3c;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
    transform: translateY(-2px);
}

.form-group input.input-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.form-hint--error {
    color: #e74c3c;
}

.form-field-banner {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #ffc9c2;
}

.form-field-banner[hidden] {
    display: none;
}

/* Показать/скрыть пароль */
.form-group:has(.password-toggle) input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
}

.password-toggle-icon {
    display: block;
}

.password-toggle-icon--hide {
    display: none;
}

.password-toggle--visible .password-toggle-icon--show {
    display: none;
}

.password-toggle--visible .password-toggle-icon--hide {
    display: block;
}

/* Опции (чекбокс + забыли пароль) */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #e74c3c;
    cursor: pointer;
}

.forgot-password {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #e74c3c;
}

/* Кнопка отправки */
.form-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.form-message--error {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.form-message--success {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: "Montserrat", sans-serif;
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.btn-submit:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.4);
}

.btn-submit:hover::after {
    animation: btnShine 0.75s ease;
}

.btn-submit:active {
    transform: translateY(0);
}

/* Соглашение */
.form-agreement {
    margin-bottom: 25px;
}

.agreement-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.agreement-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.agreement-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.agreement-checkmark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 7px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.agreement-checkmark::after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    margin-top: -2px;
    transition: transform 0.2s ease;
}

.agreement-checkbox:checked + .agreement-checkmark {
    background: #e74c3c;
    border-color: #e74c3c;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.35);
}

.agreement-checkbox:checked + .agreement-checkmark::after {
    transform: rotate(45deg) scale(1);
}

.agreement-checkbox:focus-visible + .agreement-checkmark {
    outline: 2px solid rgba(231, 76, 60, 0.6);
    outline-offset: 2px;
}

.agreement-card:has(.agreement-checkbox:checked) {
    border-color: rgba(231, 76, 60, 0.35);
    background: rgba(231, 76, 60, 0.06);
    box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.1);
}

.agreement-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.agreement-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.agreement-desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.6;
}

.agreement-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.agreement-link:hover {
    color: #f06050;
    border-bottom-color: #f06050;
}

/* Футер формы */
.form-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin: 20px 0 0 0;
}

.form-footer a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Кнопка "На главную" */
.btn-back-home {
    display: inline-block;
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease, transform 0.3s ease;
    animation: loginFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

.btn-back-home:hover {
    color: #fff;
    transform: translateX(-4px);
}

@media (prefers-reduced-motion: reduce) {
    .login-page::before,
    .login-container,
    .brand-title,
    .brand-content h2,
    .brand-content p,
    .brand-feature,
    .login-forms,
    .form.active,
    .form.active *,
    .btn-back-home {
        animation: none !important;
    }

    .form-group input:focus {
        transform: none;
    }
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        border-radius: 20px;
    }

    .login-brand {
        display: none; /* Скрываем бренд на телефонах */
    }

    .login-forms {
        padding: 30px 25px;
        min-height: auto;
    }

    .form-tabs {
        margin-bottom: 20px;
    }

    .tab-btn {
        font-size: 14px;
        padding: 10px 15px;
    }

    .form h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .login-forms {
        padding: 20px 15px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-submit {
        padding: 14px;
        font-size: 16px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}