* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos del body */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Contenedor principal */
.container {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

/* Toggle entre formularios */
.form-toggle {
    display: flex;
    margin-bottom: 2rem;
    border-radius: 25px;
    overflow: hidden;
    background: #f0f0f0;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
}

/* Contenedor de formularios */
.form-container {
    position: relative;
    overflow: hidden;
}

/* Estilos de formularios */
.form {
    display: none;
    animation: slideIn 0.3s ease;
}

.form.active {
    display: block;
}

/* Animación de entrada */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 1.5rem;
}

/* Etiquetas */
label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fafafa;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

/* Botones */
.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Mensajes */
.message {
    margin-top: 1rem;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

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

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

/* Loading */
.loading {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Animación del spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Títulos */
h2 {
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .toggle-btn {
        padding: 10px;
        font-size: 14px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        padding: 10px 12px;
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Estados de validación */
.form-group.error input {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-group.success input {
    border-color: #28a745;
    background-color: #f0fff4;
}

/* Texto de ayuda */
.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.help-text.error {
    color: #dc3545;
}