* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 100px 20px 20px;
    position: relative;
}

/* Carrusel de fondo */
.carousel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.carousel-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: carousel-fade-zoom 18s infinite;
    filter: brightness(0.35);
}

.carousel-item:nth-child(1) { animation-delay: 0s; }
.carousel-item:nth-child(2) { animation-delay: 6s; }
.carousel-item:nth-child(3) { animation-delay: 12s; }

@keyframes carousel-fade-zoom {
    0% { opacity: 0; transform: scale(1); }
    5% { opacity: 1; transform: scale(1); }
    28% { opacity: 1; transform: scale(1.15); }
    33% { opacity: 0; transform: scale(1.15); }
    100% { opacity: 0; transform: scale(1.15); }
}

.carousel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(62, 62, 80, 0.8) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

/* Botón volver */
.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    text-decoration: none;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-5px);
}

/* Contenedor principal */
.container {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 900px;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    animation: containerEntrance 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: auto 0;
}

@keyframes containerEntrance {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(100px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Formularios */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-in {
    left: 0;
    z-index: 2;
}

.sign-up {
    left: 0;
    z-index: 1;
    opacity: 0;
}

.container.active .sign-in {
    transform: translateX(100%);
}

.container.active .sign-up {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: slideShow 0.8s ease;
}

@keyframes slideShow {
    0%, 49.99% {
        opacity: 0;
        z-index: 1;
    }
    50%, 100% {
        opacity: 1;
        z-index: 5;
    }
}

form {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    width: 100%;
    overflow-y: auto;
}

h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Botones de redes sociales */
.social-login {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    width: 100%;
    max-width: 350px;
}

.social-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95em;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.social-btn.google {
    color: #db4437;
    border-color: #db4437;
}

.social-btn.google:hover {
    background: #db4437;
    color: white;
}

.social-btn.facebook {
    color: #1877f2;
    border-color: #1877f2;
}

.social-btn.facebook:hover {
    background: #1877f2;
    color: white;
}

.social-btn i {
    font-size: 1.3em;
}

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #999;
    font-size: 0.9em;
    width: 100%;
    max-width: 350px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    padding: 0 15px;
}

/* Inputs */
.input-group {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin: 10px 0;
}

input {
    background: #f0f0f0;
    border: 2px solid transparent;
    padding: 14px 20px 14px 45px;
    border-radius: 12px;
    width: 100%;
    outline: none;
    font-size: 1em;
    transition: all 0.4s ease;
}

input:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    transition: color 0.3s ease;
}

input:focus + .input-icon {
    color: #667eea;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1em;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #667eea;
}

/* Checkbox */
.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    margin: 15px 0;
    cursor: pointer;
}

.remember-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    padding: 0;
}

.remember-wrapper label {
    color: #666;
    font-size: 0.95em;
    cursor: pointer;
}

/* Enlaces */
form a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.95em;
    margin: 10px 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

form a:hover {
    color: #764ba2;
}

/* Botones */
button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1em;
    padding: 14px 50px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    margin-top: 15px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    width: 100%;
    max-width: 350px;
}

button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:active {
    transform: scale(0.95);
}

/* Panel de toggle */
.toggle-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.container.active .toggle-container {
    transform: translateX(-100%);
}

.toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    color: white;
    position: relative;
    left: -100%;
    width: 200%;
    transform: translateX(0);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.container.active .toggle {
    transform: translateX(50%);
}

.toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    text-align: center;
    top: 0;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toggle-left {
    transform: translateX(-200%);
}

.container.active .toggle-left {
    transform: translateX(0);
}

.toggle-right {
    right: 0;
    transform: translateX(0);
}

.container.active .toggle-right {
    transform: translateX(200%);
}

.toggle-panel h1 {
    color: white;
    font-size: 2.2em;
    margin-bottom: 20px;
}

.toggle-panel p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hidden {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 14px 50px;
    font-size: 1em;
}

.hidden:hover {
    background: white;
    color: #667eea;
}

/* Footer */
.footer {
    position: relative;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 20px;
    margin-top: auto;
    width: 100%;
}

.footer p {
    font-size: 0.9em;
    line-height: 1.6;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 18px 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.show {
    display: flex;
}

.notification.success {
    border-left: 4px solid #27ae60;
}

.notification.error {
    border-left: 4px solid #e74c3c;
}

.notification i {
    font-size: 1.5em;
}

.notification.success i {
    color: #27ae60;
}

.notification.error i {
    color: #e74c3c;
}

.notification-text {
    color: #333;
    font-weight: 600;
}

/* Botón de cambio móvil */
.mobile-toggle {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 80px 10px 20px;
    }

    .container {
        width: 100%;
        max-width: 100%;
        min-height: auto;
        max-height: none;
        flex-direction: column;
        border-radius: 20px;
        margin: 0;
    }

    .form-container {
        width: 100%;
        position: relative !important;
        min-height: auto;
        height: auto;
        left: 0 !important;
        transform: none !important;
    }

    .sign-in {
        position: relative !important;
        display: block;
        opacity: 1;
        z-index: 2;
    }

    .sign-up {
        position: relative !important;
        display: none;
        opacity: 1;
        z-index: 1;
    }

    .container.active .sign-in {
        display: none;
    }

    .container.active .sign-up {
        display: block;
        z-index: 2;
    }

    .toggle-container {
        display: none;
    }

    /* Botón de cambio visible en móvil */
    .mobile-toggle {
        display: block;
        background: transparent;
        border: 2px solid #667eea;
        color: #667eea;
        padding: 12px 30px;
        border-radius: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-top: 15px;
        width: 100%;
        max-width: 350px;
    }

    .mobile-toggle:hover {
        background: #667eea;
        color: white;
    }

    form {
        padding: 30px 20px;
        min-height: auto;
        overflow-y: visible;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .social-login {
        flex-direction: column;
        gap: 10px;
    }

    .back-btn {
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
    }

    .notification {
        top: 20px;
        right: 20px;
        left: 20px;
        width: auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 70px 10px 15px;
    }

    .container {
        border-radius: 15px;
    }

    form {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .input-group {
        max-width: 100%;
    }

    .social-login,
    .divider,
    button[type="submit"] {
        max-width: 100%;
    }

    input {
        padding: 12px 15px 12px 40px;
        font-size: 0.95em;
    }

    button[type="submit"] {
        padding: 12px 40px;
    }
}