* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent: #ff6b6b;
    --success: #4cc9f0;
    --error: #e63946;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.08);
}

body {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    background: white;
}

/* Left side - Form */
.form-container {
    width: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    transition: all 0.4s ease;
    z-index: 10;
}

.logo {
    position: absolute;
    top: 30px;
    left: 40px;
    font-weight: 700;
    font-size: 24px;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.logo-icon {
    margin-right: 10px;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.form-content {
    width: 100%;
    max-width: 420px;
    padding: 0px;
    border-radius: 20px;
}

.form-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
}

.form-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.form-toggle {
    background: none;
    border: none;
    padding: 8px 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.3s;
}

.form-toggle.active {
    color: var(--primary);
}

.form-toggle.active::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.form {
    margin-top: 24px;
}

.form.hidden {
    display: none;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-field {
    position: relative;
}

.input-field input,
.input-field select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.input-field input:focus,
.input-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.input-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-secondary);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
    font-size: 14px;
}

.social-login {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-primary);
}

.social-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

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

.vk-btn {
    background: #4a76a8;
    color: white;
    border: 1px solid #4a76a8;
}

.vk-btn:hover {
    background: #3d638f;
    border-color: #3d638f;
}

/* Right side - Animated Canvas */
.canvas-container {
    width: 50%;
    background: linear-gradient(135deg, #964adb, #3100a0);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.canvas-content {
    width: 100%;
    max-width: 500px;
    text-align: center;
    z-index: 2;
    padding: 40px;
}

.canvas-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.canvas-subtitle {
    font-size: 18px;
    margin-bottom: 32px;
    color: white;
    opacity: 0.9;
}

.features {
    text-align: left;
    margin: 32px 0;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.feature i {
    margin-right: 15px;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-content h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.feature-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.cta-button {
    display: inline-block;
    padding: 16px 40px;
    background: white;
    color: var(--primary);
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 16px;
    transition: all 0.3s;
    border: 2px solid white;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    background: transparent;
    color: white;
}

/* Animated background shapes */
.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 70px;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: 6s;
}

.shape-5 {
    width: 120px;
    height: 120px;
    top: 20%;
    left: 10%;
    animation-delay: 8s;
}

.polygon {
    position: absolute;
    background: rgba(255, 255, 255, 0.07);
    animation: rotate 20s infinite linear;
}

.polygon-1 {
    width: 180px;
    height: 180px;
    top: 10%;
    right: 20%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: 1s;
}

.polygon-2 {
    width: 120px;
    height: 120px;
    bottom: 15%;
    right: 10%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation-delay: 5s;
}

/* Animation keyframes */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-10px, 15px) rotate(5deg);
    }
    50% {
        transform: translate(5px, -15px) rotate(-5deg);
    }
    75% {
        transform: translate(15px, 10px) rotate(3deg);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Testimonial */
.testimonial {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    text-align: left;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 15px;
    color: white;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.author-details h4 {
    font-size: 16px;
    margin-bottom: 2px;
}

.author-details p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Animation */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Password strength indicator */
.password-strength {
    height: 5px;
    border-radius: 5px;
    margin-top: 8px;
    background: #eee;
    overflow: hidden;
}

.strength-meter {
    height: 100%;
    width: 0;
    transition: width 0.3s, background 0.3s;
}

/* Loading animation */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Message Boxes */
.message-box {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    width: 100%;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-error-login, 
.message-error-signup, 
.message-error-forgot {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: -10px;
    margin-bottom: 15px;
}

/* Progressive Signup Styles */
.progress-bar-container {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}

.progress-step {
    flex: 1;
    height: 4px;
    background-color: var(--border);
    border-radius: 2px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.4s ease-in-out;
    border-radius: 2px;
}

.signup-step {
    display: none;
}

.signup-step.active {
    display: block;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.step-nav-btn {
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.step-nav-btn.next {
    background-color: var(--primary);
    color: #fff;
    border: none;
    flex-grow: 1;
}

.step-nav-btn.next:hover {
    background-color: var(--primary-dark);
}

.step-nav-btn.back {
    background-color: var(--secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    flex-grow: 1;
}

.step-nav-btn.back:hover {
    background-color: #e9ecef;
}

.full-width-btn {
    width: 100%;
    margin-top: 15px;
}

.match-message {
    font-size: 0.85rem;
    margin-top: -10px;
    margin-bottom: 10px;
    height: 1.2em;
    text-align: right;
}

/* Responsive design */
@media (max-width: 900px) {
    body {
        flex-direction: column;
        overflow: auto;
    }
    
    .form-container {
        width: 100%;
        padding: 30px 20px;
        animation: slideInFromLeft 0.6s ease-out;
    }
    
    .canvas-container {
        display: none;
    }
    
    .form-content {
        max-width: 100%;
        animation: scaleIn 0.5s ease-out 0.2s both;
    }
    
    .logo {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 30px;
        animation: slideInFromLeft 0.5s ease-out;
    }

    .form-title {
        animation: slideInFromRight 0.6s ease-out 0.3s both;
    }

    .form-subtitle {
        animation: slideInFromRight 0.6s ease-out 0.4s both;
    }

    .form-controls {
        animation: fadeIn 0.6s ease-out 0.5s both;
    }

    .input-group {
        animation: slideInFromLeft 0.5s ease-out both;
    }

    .input-group:nth-child(1) {
        animation-delay: 0.6s;
    }

    .input-group:nth-child(2) {
        animation-delay: 0.7s;
    }

    .input-group:nth-child(3) {
        animation-delay: 0.8s;
    }

    .input-group:nth-child(4) {
        animation-delay: 0.9s;
    }

    .btn {
        animation: scaleIn 0.5s ease-out 1s both;
    }

    .divider {
        animation: fadeIn 0.5s ease-out 1.1s both;
    }

    .social-login {
        animation: slideInFromRight 0.5s ease-out 1.2s both;
    }

    .message-box {
        animation: slideInFromLeft 0.5s ease-out;
    }

    /* Subtle hover effects for mobile */
    .input-field input:focus,
    .input-field select:focus {
        transform: scale(1.01);
        transition: transform 0.2s ease;
    }

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

    .social-btn:active {
        transform: scale(0.97);
    }
}

/* Additional mobile-specific animations */
@media (max-width: 900px) {
    @keyframes pulseSubtle {
        0%, 100% {
            opacity: 1;
        }
        50% {
            opacity: 0.8;
        }
    }

    .form-toggle.active::after {
        animation: pulseSubtle 2s ease-in-out infinite;
    }

    .password-toggle {
        transition: transform 0.2s ease;
    }

    .password-toggle:active {
        transform: translateY(-50%) scale(1.2);
    }
}