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

/* Auth Page Container */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #0a1628 0%, #0f2847 50%, #0a1628 100%);
    position: relative;
    overflow: hidden;
}

/* Background Elements */
.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Auth Wrapper */
.auth-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 550px;
    background: rgba(15, 40, 71, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 24px;
    box-shadow: 
        0 0 40px rgba(14, 165, 233, 0.2),
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1;
}

/* Credentials Panel */
.auth-wrapper .credentials-panel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
}

.credentials-panel.signin {
    left: 0;
}

.credentials-panel.signup {
    right: 0;
    padding: 20px 35px;
}

/* Slide Animation Elements */
.credentials-panel.signin .slide-element {
    transform: translateX(0%);
    transition: 0.7s ease;
    opacity: 1;
}

.credentials-panel.signin .slide-element:nth-child(1) { transition-delay: 0.3s; }
.credentials-panel.signin .slide-element:nth-child(2) { transition-delay: 0.4s; }
.credentials-panel.signin .slide-element:nth-child(3) { transition-delay: 0.5s; }
.credentials-panel.signin .slide-element:nth-child(4) { transition-delay: 0.6s; }
.credentials-panel.signin .slide-element:nth-child(5) { transition-delay: 0.7s; }
.credentials-panel.signin .slide-element:nth-child(6) { transition-delay: 0.8s; }

.auth-wrapper.toggled .credentials-panel.signin .slide-element {
    transform: translateX(-120%);
    opacity: 0;
}

.auth-wrapper.toggled .credentials-panel.signin .slide-element:nth-child(1) { transition-delay: 0s; }
.auth-wrapper.toggled .credentials-panel.signin .slide-element:nth-child(2) { transition-delay: 0.1s; }
.auth-wrapper.toggled .credentials-panel.signin .slide-element:nth-child(3) { transition-delay: 0.2s; }
.auth-wrapper.toggled .credentials-panel.signin .slide-element:nth-child(4) { transition-delay: 0.3s; }
.auth-wrapper.toggled .credentials-panel.signin .slide-element:nth-child(5) { transition-delay: 0.4s; }
.auth-wrapper.toggled .credentials-panel.signin .slide-element:nth-child(6) { transition-delay: 0.5s; }

.credentials-panel.signup .slide-element {
    transform: translateX(120%);
    transition: 0.7s ease;
    opacity: 0;
    filter: blur(10px);
}

.credentials-panel.signup .slide-element:nth-child(1) { transition-delay: 0s; }
.credentials-panel.signup .slide-element:nth-child(2) { transition-delay: 0.1s; }
.credentials-panel.signup .slide-element:nth-child(3) { transition-delay: 0.2s; }
.credentials-panel.signup .slide-element:nth-child(4) { transition-delay: 0.3s; }
.credentials-panel.signup .slide-element:nth-child(5) { transition-delay: 0.4s; }
.credentials-panel.signup .slide-element:nth-child(6) { transition-delay: 0.5s; }
.credentials-panel.signup .slide-element:nth-child(7) { transition-delay: 0.6s; }
.credentials-panel.signup .slide-element:nth-child(8) { transition-delay: 0.7s; }

.auth-wrapper.toggled .credentials-panel.signup .slide-element {
    transform: translateX(0%);
    opacity: 1;
    filter: blur(0px);
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(1) { transition-delay: 1.2s; }
.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(2) { transition-delay: 1.3s; }
.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(3) { transition-delay: 1.4s; }
.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(4) { transition-delay: 1.5s; }
.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(5) { transition-delay: 1.6s; }
.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(6) { transition-delay: 1.7s; }
.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(7) { transition-delay: 1.8s; }
.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(8) { transition-delay: 1.9s; }

/* Panel Headers */
.credentials-panel h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
}

.credentials-panel .auth-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 25px;
}

/* Field Wrapper */
.field-wrapper {
    position: relative;
    width: 100%;
    height: 48px;
    margin-top: 16px;
}

/* Smaller fields for signup */
.credentials-panel.signup .field-wrapper {
    height: 44px;
    margin-top: 12px;
}

/* Input fields - максимальная специфичность */
.auth-page .field-wrapper input,
.auth-page .field-wrapper input:not([type="checkbox"]),
.auth-page .field-wrapper input[type="email"],
.auth-page .field-wrapper input[type="password"],
.auth-page .field-wrapper input[type="text"],
.auth-page input.form-control,
section.auth-page input {
    width: 100% !important;
    height: 100% !important;
    background: #0d1f35 !important;
    background-color: #0d1f35 !important;
    border: 1px solid rgba(14, 165, 233, 0.3) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px 8px 0 0 !important;
    outline: none !important;
    font-size: 15px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 500 !important;
    padding: 15px 45px 5px 15px !important;
    transition: border-color 0.3s ease, background-color 0.3s ease !important;
    font-family: 'Poppins', sans-serif !important;
    box-shadow: none !important;
    caret-color: #38bdf8 !important;
    opacity: 1 !important;
}

.auth-page .field-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
}

/* Автозаполнение браузера */
.auth-page .field-wrapper input:-webkit-autofill,
.auth-page .field-wrapper input:-webkit-autofill:hover,
.auth-page .field-wrapper input:-webkit-autofill:focus,
.auth-page .field-wrapper input:-webkit-autofill:active,
.auth-page input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #0d1f35 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: #0d1f35 !important;
    color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
    caret-color: #38bdf8 !important;
}

/* Фокус и активное состояние */
.auth-page .field-wrapper input:focus,
.auth-page .field-wrapper input:not([type="checkbox"]):focus,
.auth-page .field-wrapper input[type="email"]:focus,
.auth-page .field-wrapper input[type="password"]:focus,
.auth-page .field-wrapper input[type="text"]:focus,
.auth-page input:focus {
    border-bottom-color: #0ea5e9 !important;
    background: #132d4a !important;
    background-color: #132d4a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Состояние с валидным значением */
.auth-page .field-wrapper input:not([type="checkbox"]):valid,
.auth-page .field-wrapper input:not(:placeholder-shown) {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.field-wrapper label:not(.form-check-label) {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    transition: 0.3s ease;
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
}

.field-wrapper input:not([type="checkbox"]):focus ~ label:not(.form-check-label),
.field-wrapper input:not([type="checkbox"]):valid ~ label:not(.form-check-label),
.field-wrapper input:not([type="checkbox"]):not(:placeholder-shown) ~ label:not(.form-check-label) {
    top: 8px;
    font-size: 11px;
    color: #0ea5e9;
}

.field-wrapper i:not(.form-check-input ~ i) {
    position: absolute;
    top: 50%;
    right: 15px;
    font-size: 16px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    transition: 0.3s ease;
}

.field-wrapper input:not([type="checkbox"]):focus ~ i,
.field-wrapper input:not([type="checkbox"]):valid ~ i {
    color: #0ea5e9;
}

/* Checkbox styling */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 12px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    height: auto;
    box-sizing: border-box;
}

.checkbox-wrapper:hover {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.3);
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    accent-color: #0ea5e9;
    cursor: pointer;
    margin: 0;
}

.checkbox-wrapper label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
}

.checkbox-wrapper label a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
}

.checkbox-wrapper label a:hover {
    text-decoration: underline;
    color: #38bdf8;
}

/* Submit Button */
.submit-button {
    position: relative;
    width: 100%;
    height: 48px;
    margin-top: 25px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.submit-button::before {
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0;
    transition: 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

.submit-button:hover::before {
    opacity: 1;
}

/* Switch Link */
.switch-link {
    font-size: 13px;
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.switch-link a {
    text-decoration: none;
    color: #0ea5e9;
    font-weight: 600;
    transition: 0.3s ease;
}

.switch-link a:hover {
    color: #06b6d4;
    text-decoration: underline;
}

/* Welcome Section */
.welcome-section {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 40px;
}

.welcome-section.signin {
    right: 0;
}

.welcome-section.signup {
    left: 0;
    pointer-events: none;
}

.welcome-section h2 {
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 15px;
}

.welcome-section p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 320px;
    line-height: 1.6;
}

/* Welcome Section Animations */
.welcome-section.signin .slide-element {
    transform: translateX(0);
    transition: 0.7s ease;
    opacity: 1;
    filter: blur(0px);
}

.welcome-section.signin .slide-element:nth-child(1) { transition-delay: 0.3s; }
.welcome-section.signin .slide-element:nth-child(2) { transition-delay: 0.4s; }
.welcome-section.signin .slide-element:nth-child(3) { transition-delay: 0.5s; }

.auth-wrapper.toggled .welcome-section.signin .slide-element {
    transform: translateX(120%);
    opacity: 0;
    filter: blur(10px);
}

.auth-wrapper.toggled .welcome-section.signin .slide-element:nth-child(1) { transition-delay: 0s; }
.auth-wrapper.toggled .welcome-section.signin .slide-element:nth-child(2) { transition-delay: 0.1s; }
.auth-wrapper.toggled .welcome-section.signin .slide-element:nth-child(3) { transition-delay: 0.2s; }

.welcome-section.signup .slide-element {
    transform: translateX(-120%);
    transition: 0.7s ease;
    opacity: 0;
    filter: blur(10px);
}

.welcome-section.signup .slide-element:nth-child(1) { transition-delay: 0s; }
.welcome-section.signup .slide-element:nth-child(2) { transition-delay: 0.1s; }
.welcome-section.signup .slide-element:nth-child(3) { transition-delay: 0.2s; }

.auth-wrapper.toggled .welcome-section.signup .slide-element {
    transform: translateX(0%);
    opacity: 1;
    filter: blur(0);
}

.auth-wrapper.toggled .welcome-section.signup .slide-element:nth-child(1) { transition-delay: 1.1s; }
.auth-wrapper.toggled .welcome-section.signup .slide-element:nth-child(2) { transition-delay: 1.2s; }
.auth-wrapper.toggled .welcome-section.signup .slide-element:nth-child(3) { transition-delay: 1.3s; }

/* Background Shapes */
.auth-wrapper .background-shape {
    position: absolute;
    right: 0;
    top: -5px;
    height: 700px;
    width: 950px;
    background: linear-gradient(45deg, #0a1628, #0ea5e9);
    transform: rotate(10deg) skewY(40deg);
    transform-origin: bottom right;
    transition: 1.5s ease;
    transition-delay: 0.8s;
    z-index: -1;
}

.auth-wrapper.toggled .background-shape {
    transform: rotate(0deg) skewY(0deg);
    transition-delay: 0.3s;
}

.auth-wrapper .secondary-shape {
    position: absolute;
    left: 250px;
    top: 100%;
    height: 800px;
    width: 950px;
    background: #0a1628;
    border-top: 3px solid #0ea5e9;
    transform: rotate(0deg) skewY(0deg);
    transform-origin: bottom left;
    transition: 1.5s ease;
    transition-delay: 0.3s;
    z-index: -1;
}

.auth-wrapper.toggled .secondary-shape {
    transform: rotate(-11deg) skewY(-41deg);
    transition-delay: 0.8s;
}

/* Forgot Password Link - styled as button */
.forgot-password {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.forgot-password:hover {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.3);
}

/* Checkbox row container */
.auth-options-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    margin-top: 15px;
    gap: 10px;
}

.auth-options-row .checkbox-wrapper,
.auth-options-row .forgot-password {
    margin-top: 0;
}

/* Error Messages */
.auth-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.5);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #fca5a5;
}

.field-error {
    font-size: 11px;
    color: #fca5a5;
    margin-top: 5px;
}

/* Status Message */
.auth-status {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #86efac;
}

/* Logo in Auth */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-logo img {
    height: 90px;
    width: auto;
}

/* Logo in Welcome Section - larger */
.welcome-section .auth-logo {
    margin-bottom: 30px;
}

.welcome-section .auth-logo img {
    height: 160px;
    width: auto;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .auth-page {
        padding: 20px 15px;
        min-height: calc(100vh - 150px);
    }

    .auth-wrapper {
        min-height: auto;
        max-width: 400px;
        /* Отключаем backdrop-filter на мобильных для лучшей производительности */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(15, 40, 71, 0.95);
    }

    .auth-wrapper .credentials-panel,
    .welcome-section {
        width: 100%;
        position: relative;
    }

    .credentials-panel.signin,
    .credentials-panel.signup {
        padding: 30px 25px;
        left: 0;
        right: 0;
    }

    .credentials-panel.signin {
        display: flex;
    }

    .credentials-panel.signup {
        display: none;
    }

    .auth-wrapper.toggled .credentials-panel.signin {
        display: none;
    }

    .auth-wrapper.toggled .credentials-panel.signup {
        display: flex;
    }

    .credentials-panel.signin .slide-element,
    .credentials-panel.signup .slide-element {
        transform: translateY(0) !important;
        opacity: 1 !important;
        filter: none !important;
        animation: slideInUp 0.5s ease forwards;
    }

    .credentials-panel.signin .slide-element:nth-child(1),
    .credentials-panel.signup .slide-element:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
    .credentials-panel.signin .slide-element:nth-child(2),
    .credentials-panel.signup .slide-element:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
    .credentials-panel.signin .slide-element:nth-child(3),
    .credentials-panel.signup .slide-element:nth-child(3) { animation-delay: 0.3s; opacity: 0; }
    .credentials-panel.signin .slide-element:nth-child(4),
    .credentials-panel.signup .slide-element:nth-child(4) { animation-delay: 0.4s; opacity: 0; }
    .credentials-panel.signin .slide-element:nth-child(5),
    .credentials-panel.signup .slide-element:nth-child(5) { animation-delay: 0.5s; opacity: 0; }
    .credentials-panel.signup .slide-element:nth-child(6) { animation-delay: 0.6s; opacity: 0; }
    .credentials-panel.signup .slide-element:nth-child(7) { animation-delay: 0.7s; opacity: 0; }
    .credentials-panel.signup .slide-element:nth-child(8) { animation-delay: 0.8s; opacity: 0; }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .welcome-section {
        display: none;
    }

    .credentials-panel h2 {
        font-size: 24px;
    }

    .auth-wrapper .background-shape,
    .auth-wrapper .secondary-shape {
        display: none;
    }

    .field-wrapper {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .credentials-panel.signin,
    .credentials-panel.signup {
        padding: 25px 20px;
    }

    .credentials-panel h2 {
        font-size: 22px;
    }

    .field-wrapper input,
    .field-wrapper label {
        font-size: 13px;
    }

    .submit-button {
        font-size: 14px;
        height: 44px;
    }

    .switch-link {
        font-size: 12px;
    }
}

/* Decorative Glow Elements */
.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
}

.auth-glow-1 {
    width: 200px;
    height: 200px;
    background: rgba(14, 165, 233, 0.3);
    top: -50px;
    right: 50px;
}

.auth-glow-2 {
    width: 150px;
    height: 150px;
    background: rgba(6, 182, 212, 0.2);
    bottom: 20px;
    left: 30px;
}

